-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Homework Done - Diana #28
Open
Diana71
wants to merge
6
commits into
accesscode-2-2:master
Choose a base branch
from
Diana71:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 3 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
37b6035
Homework Done - Diana
Diana71 ff8fb7f
Homework Done - Diana
Diana71 b26200c
Added mp3 files
Diana71 4c05f9c
Added background images
Diana71 7698296
User can change background in all TableViews
Diana71 5827936
Font color
Diana71 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// | ||
// AllCategoriesTableViewController.h | ||
// OptionSelector | ||
// | ||
// Created by Diana Elezaj on 8/13/15. | ||
// Copyright (c) 2015 Diana Elezaj. All rights reserved. | ||
// | ||
|
||
#import <UIKit/UIKit.h> | ||
|
||
|
||
@interface AllCategoriesTableViewController : UITableViewController | ||
|
||
@property (nonatomic)NSArray *CQCategory; | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,141 @@ | ||
// | ||
// AllCategoriesTableViewController.m | ||
// OptionSelector | ||
// | ||
// Created by Diana Elezaj on 8/13/15. | ||
// Copyright (c) 2015 Diana Elezaj. All rights reserved. | ||
// | ||
|
||
#import "AllCategoriesTableViewController.h" | ||
#import "CQCategory.h" | ||
#import "DetailsTableViewController.h" | ||
|
||
|
||
@interface AllCategoriesTableViewController () | ||
@property (nonatomic) NSArray *allCategories; | ||
|
||
@end | ||
|
||
@implementation AllCategoriesTableViewController | ||
|
||
- (void)initializeData | ||
{ | ||
CQCategory *PhoneRingtone = [[CQCategory alloc] init]; | ||
CQCategory *SoundProfile = [[CQCategory alloc] init]; | ||
CQCategory *IncomingCallVibration = [[CQCategory alloc] init]; | ||
CQCategory *BackgroundColor = [[CQCategory alloc] init]; | ||
|
||
PhoneRingtone.name = @"Phone Ringtone ♫"; | ||
PhoneRingtone.options = @[ | ||
@"Phone Ringing", | ||
@"Vintage Phone Ringing", | ||
@"Tongue Rolling", | ||
@"Doorbell", | ||
@"Two Tone Doorbell", | ||
@"Telephone Ring" | ||
]; | ||
|
||
SoundProfile.name = @"Sound Profile"; | ||
SoundProfile.options = @[ | ||
@"Sound", | ||
@"Vibrate Only", | ||
@"Silent" | ||
]; | ||
|
||
IncomingCallVibration.name = @"Incoming Call Vibration"; | ||
IncomingCallVibration.options = @[ | ||
@"Long Lasting", | ||
@"Rapid", | ||
@"Short repeated", | ||
@"Standartd", | ||
@"Ticktock" | ||
]; | ||
|
||
BackgroundColor.name = @"Background Color"; | ||
BackgroundColor.options = @[ | ||
@"Blue", | ||
@"Green", | ||
@"Red", | ||
@"Yellow" | ||
]; | ||
|
||
self.allCategories = @[PhoneRingtone, SoundProfile, IncomingCallVibration, BackgroundColor]; | ||
|
||
} | ||
|
||
- (void)viewDidLoad { | ||
[super viewDidLoad]; | ||
[self initializeData]; | ||
self.navigationItem.title = @"🔅Settings🔅"; | ||
|
||
} | ||
|
||
- (void)viewWillAppear:(BOOL)animated | ||
{ | ||
[super viewWillAppear:animated]; | ||
// set navigation bar's tint color when being shown | ||
self.navigationController.navigationBar.barTintColor = [UIColor colorWithRed:0.60 green:0.78 blue:0.95 alpha:1.0]; | ||
} | ||
|
||
- (void)viewDidAppear:(BOOL)animated { | ||
[self.tableView reloadData]; | ||
|
||
} | ||
|
||
|
||
|
||
#pragma mark Cells color | ||
- (void)tableView: (UITableView*)tableView | ||
willDisplayCell: (UITableViewCell*)cell | ||
forRowAtIndexPath: (NSIndexPath*)indexPath | ||
{ | ||
cell.backgroundColor = indexPath.row % 2 | ||
? [UIColor colorWithRed:0.87 green:0.93 blue:0.98 alpha:1.0] | ||
: [UIColor whiteColor]; | ||
} | ||
|
||
|
||
|
||
|
||
|
||
|
||
#pragma mark - Table view data source | ||
|
||
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { | ||
// Return the number of sections. | ||
return 1; | ||
} | ||
|
||
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { | ||
// Return the number of rows in the section. | ||
return self.allCategories.count; | ||
} | ||
|
||
|
||
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { | ||
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"CategorySelected" forIndexPath:indexPath]; | ||
CQCategory *displayCategory = [self.allCategories objectAtIndex:indexPath.row]; | ||
|
||
cell.textLabel.text = displayCategory.name; | ||
|
||
cell.detailTextLabel.text = displayCategory.selection; | ||
|
||
return cell; | ||
} | ||
|
||
#pragma mark - Navigation | ||
|
||
|
||
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { | ||
|
||
DetailsTableViewController *vc = segue.destinationViewController; | ||
|
||
NSIndexPath *indexPath = [self.tableView indexPathForSelectedRow]; | ||
|
||
CQCategory *newCategory = [self.allCategories objectAtIndex:indexPath.row]; | ||
vc.category = newCategory; | ||
|
||
vc.delegate = self; | ||
} | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,94 @@ | ||
<?xml version="1.0" encoding="UTF-8" standalone="no"?> | ||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="6211" systemVersion="14A298i" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="vXZ-lx-hvc"> | ||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="7706" systemVersion="14B25" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="jYj-9P-BcS"> | ||
<dependencies> | ||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6204"/> | ||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="7703"/> | ||
</dependencies> | ||
<scenes> | ||
<!--View Controller--> | ||
<scene sceneID="ufC-wZ-h7g"> | ||
<!--Root View Controller--> | ||
<scene sceneID="N9g-Ik-mB0"> | ||
<objects> | ||
<viewController id="vXZ-lx-hvc" customClass="ViewController" customModuleProvider="" sceneMemberID="viewController"> | ||
<layoutGuides> | ||
<viewControllerLayoutGuide type="top" id="jyV-Pf-zRb"/> | ||
<viewControllerLayoutGuide type="bottom" id="2fi-mo-0CV"/> | ||
</layoutGuides> | ||
<view key="view" contentMode="scaleToFill" id="kh9-bI-dsS"> | ||
<tableViewController id="DgN-vN-cZ6" customClass="AllCategoriesTableViewController" sceneMemberID="viewController"> | ||
<tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="44" sectionHeaderHeight="22" sectionFooterHeight="22" id="DUk-Td-wab"> | ||
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/> | ||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> | ||
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/> | ||
</view> | ||
</viewController> | ||
<placeholder placeholderIdentifier="IBFirstResponder" id="x5A-6p-PRh" sceneMemberID="firstResponder"/> | ||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> | ||
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/> | ||
<prototypes> | ||
<tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" reuseIdentifier="CategorySelected" textLabel="E8H-4R-6ad" detailTextLabel="1z2-pD-5Y1" style="IBUITableViewCellStyleValue1" id="Bf1-oW-JSe"> | ||
<autoresizingMask key="autoresizingMask"/> | ||
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="Bf1-oW-JSe" id="759-YH-Dlb"> | ||
<autoresizingMask key="autoresizingMask"/> | ||
<subviews> | ||
<label opaque="NO" multipleTouchEnabled="YES" contentMode="left" text="Title" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="E8H-4R-6ad"> | ||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> | ||
<fontDescription key="fontDescription" type="system" pointSize="16"/> | ||
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/> | ||
<nil key="highlightedColor"/> | ||
</label> | ||
<label opaque="NO" multipleTouchEnabled="YES" contentMode="left" text="Detail" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="1z2-pD-5Y1"> | ||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> | ||
<fontDescription key="fontDescription" type="system" pointSize="16"/> | ||
<color key="textColor" red="0.34642683928753881" green="0.42926369073331527" blue="1" alpha="1" colorSpace="calibratedRGB"/> | ||
<nil key="highlightedColor"/> | ||
</label> | ||
</subviews> | ||
</tableViewCellContentView> | ||
<connections> | ||
<segue destination="p1g-wz-AlW" kind="show" id="ZI4-zg-D93"/> | ||
</connections> | ||
</tableViewCell> | ||
</prototypes> | ||
<connections> | ||
<outlet property="dataSource" destination="DgN-vN-cZ6" id="s6c-hS-qon"/> | ||
<outlet property="delegate" destination="DgN-vN-cZ6" id="ZcT-qD-dvF"/> | ||
</connections> | ||
</tableView> | ||
<navigationItem key="navigationItem" title="Root View Controller" id="Tsa-dd-TvU"/> | ||
</tableViewController> | ||
<placeholder placeholderIdentifier="IBFirstResponder" id="eVF-Ou-Ne5" userLabel="First Responder" sceneMemberID="firstResponder"/> | ||
</objects> | ||
<point key="canvasLocation" x="529" y="198"/> | ||
</scene> | ||
<!--Details Table View Controller--> | ||
<scene sceneID="qEK-kq-2zu"> | ||
<objects> | ||
<tableViewController id="p1g-wz-AlW" customClass="DetailsTableViewController" sceneMemberID="viewController"> | ||
<tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="44" sectionHeaderHeight="22" sectionFooterHeight="22" id="NFv-Jv-EE3"> | ||
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/> | ||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> | ||
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/> | ||
<prototypes> | ||
<tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" reuseIdentifier="OptionSelected" id="IHh-Jt-Nug"> | ||
<autoresizingMask key="autoresizingMask"/> | ||
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="IHh-Jt-Nug" id="5yR-lR-II5"> | ||
<autoresizingMask key="autoresizingMask"/> | ||
</tableViewCellContentView> | ||
</tableViewCell> | ||
</prototypes> | ||
<connections> | ||
<outlet property="dataSource" destination="p1g-wz-AlW" id="gX2-wb-xMZ"/> | ||
<outlet property="delegate" destination="p1g-wz-AlW" id="Vur-1x-mr0"/> | ||
</connections> | ||
</tableView> | ||
</tableViewController> | ||
<placeholder placeholderIdentifier="IBFirstResponder" id="1PT-mB-4U7" userLabel="First Responder" sceneMemberID="firstResponder"/> | ||
</objects> | ||
<point key="canvasLocation" x="1207" y="198"/> | ||
</scene> | ||
<!--Navigation Controller--> | ||
<scene sceneID="qsA-KI-74B"> | ||
<objects> | ||
<navigationController id="jYj-9P-BcS" sceneMemberID="viewController"> | ||
<navigationBar key="navigationBar" contentMode="scaleToFill" id="rup-FA-oKe"> | ||
<rect key="frame" x="0.0" y="0.0" width="320" height="44"/> | ||
<autoresizingMask key="autoresizingMask"/> | ||
</navigationBar> | ||
<connections> | ||
<segue destination="DgN-vN-cZ6" kind="relationship" relationship="rootViewController" id="JqY-yc-1A0"/> | ||
</connections> | ||
</navigationController> | ||
<placeholder placeholderIdentifier="IBFirstResponder" id="5YD-uc-vnA" userLabel="First Responder" sceneMemberID="firstResponder"/> | ||
</objects> | ||
<point key="canvasLocation" x="-291" y="198"/> | ||
</scene> | ||
</scenes> | ||
</document> |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// | ||
// CQCategory.h | ||
// OptionSelector | ||
// | ||
// Created by Diana Elezaj on 8/13/15. | ||
// Copyright (c) 2015 Diana Elezaj. All rights reserved. | ||
// | ||
|
||
#import <Foundation/Foundation.h> | ||
|
||
@interface CQCategory : NSObject | ||
|
||
|
||
@property (nonatomic)NSString *name; | ||
@property (nonatomic)NSArray *options; | ||
@property (nonatomic)NSString *selection; | ||
|
||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// | ||
// CQCategory.m | ||
// OptionSelector | ||
// | ||
// Created by Diana Elezaj on 8/13/15. | ||
// Copyright (c) 2015 Diana Elezaj. All rights reserved. | ||
// | ||
|
||
#import "CQCategory.h" | ||
|
||
@implementation CQCategory | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// | ||
// DetailsTableViewController.h | ||
// OptionSelector | ||
// | ||
// Created by Diana Elezaj on 8/13/15. | ||
// Copyright (c) 2015 Diana Elezaj. All rights reserved. | ||
// | ||
|
||
#import <UIKit/UIKit.h> | ||
#import "CQCategory.h" | ||
|
||
#import "AllCategoriesTableViewController.h" | ||
|
||
|
||
@interface DetailsTableViewController : UITableViewController | ||
|
||
@property (nonatomic) CQCategory *category; | ||
@property (nonatomic,weak) AllCategoriesTableViewController *delegate; | ||
|
||
@end |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good property names