Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 28 additions & 6 deletions OptionSelector.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,12 @@
objects = {

/* Begin PBXBuildFile section */
3DA24BD11B7AD088002076F1 /* MainList.m in Sources */ = {isa = PBXBuildFile; fileRef = 3DA24BD01B7AD088002076F1 /* MainList.m */; };
3DA24BD41B7AD1A5002076F1 /* SubList.m in Sources */ = {isa = PBXBuildFile; fileRef = 3DA24BD31B7AD1A5002076F1 /* SubList.m */; };
3DA24BD71B7AD223002076F1 /* ObjectsInsideLists.m in Sources */ = {isa = PBXBuildFile; fileRef = 3DA24BD61B7AD223002076F1 /* ObjectsInsideLists.m */; };
3DCCBC9B1B7AE12D00010417 /* CQCategory.m in Sources */ = {isa = PBXBuildFile; fileRef = 3DCCBC9A1B7AE12D00010417 /* CQCategory.m */; };
8DECE7921B78082B0064D760 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 8DECE7911B78082B0064D760 /* main.m */; };
8DECE7951B78082B0064D760 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 8DECE7941B78082B0064D760 /* AppDelegate.m */; };
8DECE7981B78082B0064D760 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 8DECE7971B78082B0064D760 /* ViewController.m */; };
8DECE79B1B78082B0064D760 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 8DECE7991B78082B0064D760 /* Main.storyboard */; };
8DECE79D1B78082B0064D760 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 8DECE79C1B78082B0064D760 /* Images.xcassets */; };
8DECE7A01B78082B0064D760 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 8DECE79E1B78082B0064D760 /* LaunchScreen.xib */; };
Expand All @@ -27,13 +30,19 @@
/* End PBXContainerItemProxy section */

/* Begin PBXFileReference section */
3DA24BCF1B7AD088002076F1 /* MainList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MainList.h; sourceTree = "<group>"; };
3DA24BD01B7AD088002076F1 /* MainList.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MainList.m; sourceTree = "<group>"; };
3DA24BD21B7AD1A5002076F1 /* SubList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SubList.h; sourceTree = "<group>"; };
3DA24BD31B7AD1A5002076F1 /* SubList.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SubList.m; sourceTree = "<group>"; };
3DA24BD51B7AD223002076F1 /* ObjectsInsideLists.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ObjectsInsideLists.h; sourceTree = "<group>"; };
3DA24BD61B7AD223002076F1 /* ObjectsInsideLists.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ObjectsInsideLists.m; sourceTree = "<group>"; };
3DCCBC991B7AE12D00010417 /* CQCategory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CQCategory.h; sourceTree = "<group>"; };
3DCCBC9A1B7AE12D00010417 /* CQCategory.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CQCategory.m; sourceTree = "<group>"; };
8DECE78C1B78082B0064D760 /* OptionSelector.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = OptionSelector.app; sourceTree = BUILT_PRODUCTS_DIR; };
8DECE7901B78082B0064D760 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
8DECE7911B78082B0064D760 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
8DECE7931B78082B0064D760 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
8DECE7941B78082B0064D760 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
8DECE7961B78082B0064D760 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = "<group>"; };
8DECE7971B78082B0064D760 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = "<group>"; };
8DECE79A1B78082B0064D760 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
8DECE79C1B78082B0064D760 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = "<group>"; };
8DECE79F1B78082B0064D760 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = "<group>"; };
Expand Down Expand Up @@ -83,8 +92,14 @@
children = (
8DECE7931B78082B0064D760 /* AppDelegate.h */,
8DECE7941B78082B0064D760 /* AppDelegate.m */,
8DECE7961B78082B0064D760 /* ViewController.h */,
8DECE7971B78082B0064D760 /* ViewController.m */,
3DA24BD51B7AD223002076F1 /* ObjectsInsideLists.h */,
3DA24BD61B7AD223002076F1 /* ObjectsInsideLists.m */,
3DCCBC991B7AE12D00010417 /* CQCategory.h */,
3DCCBC9A1B7AE12D00010417 /* CQCategory.m */,
3DA24BCF1B7AD088002076F1 /* MainList.h */,
3DA24BD01B7AD088002076F1 /* MainList.m */,
3DA24BD21B7AD1A5002076F1 /* SubList.h */,
3DA24BD31B7AD1A5002076F1 /* SubList.m */,
8DECE7991B78082B0064D760 /* Main.storyboard */,
8DECE79C1B78082B0064D760 /* Images.xcassets */,
8DECE79E1B78082B0064D760 /* LaunchScreen.xib */,
Expand Down Expand Up @@ -219,9 +234,12 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
8DECE7981B78082B0064D760 /* ViewController.m in Sources */,
3DA24BD11B7AD088002076F1 /* MainList.m in Sources */,
3DCCBC9B1B7AE12D00010417 /* CQCategory.m in Sources */,
8DECE7951B78082B0064D760 /* AppDelegate.m in Sources */,
3DA24BD41B7AD1A5002076F1 /* SubList.m in Sources */,
8DECE7921B78082B0064D760 /* main.m in Sources */,
3DA24BD71B7AD223002076F1 /* ObjectsInsideLists.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -378,6 +396,7 @@
"$(inherited)",
);
INFOPLIST_FILE = OptionSelectorTests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 8.3;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_NAME = "$(TARGET_NAME)";
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/OptionSelector.app/OptionSelector";
Expand All @@ -393,6 +412,7 @@
"$(inherited)",
);
INFOPLIST_FILE = OptionSelectorTests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 8.3;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_NAME = "$(TARGET_NAME)";
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/OptionSelector.app/OptionSelector";
Expand All @@ -418,6 +438,7 @@
8DECE7B11B78082B0064D760 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
8DECE7B21B78082B0064D760 /* Build configuration list for PBXNativeTarget "OptionSelectorTests" */ = {
isa = XCConfigurationList;
Expand All @@ -426,6 +447,7 @@
8DECE7B41B78082B0064D760 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
Expand Down
109 changes: 94 additions & 15 deletions OptionSelector/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
@@ -1,25 +1,104 @@
<?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="14E46" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="UsM-Fv-pob">
<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">
<!--Navigation Controller-->
<scene sceneID="mXz-GA-o1x">
<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">
<navigationController id="UsM-Fv-pob" sceneMemberID="viewController">
<navigationBar key="navigationBar" contentMode="scaleToFill" id="eGr-Ga-QRo">
<rect key="frame" x="0.0" y="0.0" width="320" height="44"/>
<autoresizingMask key="autoresizingMask"/>
</navigationBar>
<connections>
<segue destination="qgq-Kg-9ED" kind="relationship" relationship="rootViewController" id="P9e-db-Ce4"/>
</connections>
</navigationController>
<placeholder placeholderIdentifier="IBFirstResponder" id="Cx3-H3-s2z" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="-5" y="317"/>
</scene>
<!--Main List-->
<scene sceneID="XdW-bX-952">
<objects>
<tableViewController id="qgq-Kg-9ED" customClass="MainList" sceneMemberID="viewController">
<tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="44" sectionHeaderHeight="22" sectionFooterHeight="22" id="Ehg-iZ-T2j">
<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="MainListID" textLabel="iqg-0l-GJf" detailTextLabel="EKS-37-TFW" style="IBUITableViewCellStyleValue1" id="gzG-R6-NMP">
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="gzG-R6-NMP" id="5Hz-nt-EnE">
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" multipleTouchEnabled="YES" contentMode="left" text="Title" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="iqg-0l-GJf">
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="16"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" multipleTouchEnabled="YES" contentMode="left" text="Detail" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="EKS-37-TFW">
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="16"/>
<color key="textColor" red="0.55686274509803924" green="0.55686274509803924" blue="0.57647058823529407" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
</subviews>
</tableViewCellContentView>
<connections>
<segue destination="bM6-HK-PfZ" kind="show" identifier="SubListSegue" id="Ypa-J7-KOD"/>
</connections>
</tableViewCell>
</prototypes>
<connections>
<outlet property="dataSource" destination="qgq-Kg-9ED" id="cty-Rt-xeM"/>
<outlet property="delegate" destination="qgq-Kg-9ED" id="4ZZ-O6-cK8"/>
</connections>
</tableView>
<navigationItem key="navigationItem" id="tPj-PE-JDI"/>
</tableViewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="Vky-hz-kRw" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="677" y="317"/>
</scene>
<!--Sub List-->
<scene sceneID="eQa-uZ-0ty">
<objects>
<tableViewController id="bM6-HK-PfZ" customClass="SubList" sceneMemberID="viewController">
<tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="44" sectionHeaderHeight="22" sectionFooterHeight="22" id="IsO-Bq-4vF">
<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="SubListID" textLabel="1dF-HU-Tg9" style="IBUITableViewCellStyleDefault" id="jGv-gv-DHZ">
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="jGv-gv-DHZ" id="vIA-uy-zip">
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" multipleTouchEnabled="YES" contentMode="left" text="Title" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="1dF-HU-Tg9">
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="16"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
</subviews>
</tableViewCellContentView>
</tableViewCell>
</prototypes>
<connections>
<outlet property="dataSource" destination="bM6-HK-PfZ" id="qYd-Pu-duC"/>
<outlet property="delegate" destination="bM6-HK-PfZ" id="zAx-1a-34O"/>
</connections>
</tableView>
<toolbarItems/>
<simulatedToolbarMetrics key="simulatedBottomBarMetrics"/>
</tableViewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="OtN-4A-r9u" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="1347" y="317"/>
</scene>
</scenes>
</document>
17 changes: 17 additions & 0 deletions OptionSelector/CQCategory.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
//
// CQCategory.h
// OptionSelector
//
// Created by Fatima Zenine Villanueva on 8/11/15.
// Copyright (c) 2015 Mike Kavouras. All rights reserved.
//

#import <Foundation/Foundation.h>

@interface CQCategory : NSObject

@property (nonatomic) NSString *name;
@property (nonatomic) NSArray *options;
@property (nonatomic) NSString *selection;

@end
13 changes: 13 additions & 0 deletions OptionSelector/CQCategory.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
//
// CQCategory.m
// OptionSelector
//
// Created by Fatima Zenine Villanueva on 8/11/15.
// Copyright (c) 2015 Mike Kavouras. All rights reserved.
//

#import "CQCategory.h"

@implementation CQCategory

@end
16 changes: 16 additions & 0 deletions OptionSelector/MainList.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
//
// MainList.h
// OptionSelector
//
// Created by Fatima Zenine Villanueva on 8/11/15.
// Copyright (c) 2015 Mike Kavouras. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "CQCategory.h"

@interface MainList : UITableViewController

@property (nonatomic) CQCategory *mainCQ;

@end
62 changes: 62 additions & 0 deletions OptionSelector/MainList.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
//
// MainList.m
// OptionSelector
//
// Created by Fatima Zenine Villanueva on 8/11/15.
// Copyright (c) 2015 Mike Kavouras. All rights reserved.
//

#import "MainList.h"
#import "ObjectsInsideLists.h"
#import "CQCategory.h"
#import "SubList.h"

@interface MainList ()

@property (nonatomic) ObjectsInsideLists *model;

@end

@implementation MainList

- (void)viewDidLoad {
[super viewDidLoad];
// loads the model with data from ObjectsInsideLists
self.model = [[ObjectsInsideLists alloc]init];
}

- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
[self.tableView reloadData];
}

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
return 1;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
return self.model.videoGames.count;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"MainListID" forIndexPath:indexPath];
CQCategory *category = self.model.videoGames[indexPath.row];
cell.textLabel.text = category.name;
cell.detailTextLabel.text= category.selection;
return cell;
}

- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
NSLog(@"Preparing for Segue");
if([segue.identifier isEqualToString:@"SubListSegue"])
{
NSIndexPath *indexPath = [self.tableView indexPathForSelectedRow];
SubList *sublistVC = segue.destinationViewController;
CQCategory *category = self.model.videoGames[indexPath.row];
sublistVC.title = category.name;
sublistVC.sublistCQ = [self.model.videoGames objectAtIndex:indexPath.row];
NSLog(@"%@", sublistVC.sublistCQ.options);
}
}

@end
15 changes: 15 additions & 0 deletions OptionSelector/ObjectsInsideLists.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
//
// ObjectsInsideLists.h
// OptionSelector
//
// Created by Fatima Zenine Villanueva on 8/11/15.
// Copyright (c) 2015 Mike Kavouras. All rights reserved.
//

#import <Foundation/Foundation.h>

@interface ObjectsInsideLists : NSObject

@property (nonatomic) NSArray *videoGames;

@end
Loading