Skip to content

Commit

Permalink
Checklist icons
Browse files Browse the repository at this point in the history
  • Loading branch information
mriddle committed May 3, 2016
1 parent 5d66fa3 commit 909b956
Show file tree
Hide file tree
Showing 38 changed files with 339 additions and 5 deletions.
1 change: 1 addition & 0 deletions AllListsViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ class AllListsViewController: UITableViewController, ListDetailViewControllerDel
cell.detailTextLabel!.text = "\(checklist.countUncheckedItems()) Remaining"
}

cell.imageView!.image = UIImage(named: checklist.iconName)
return cell
}

Expand Down
4 changes: 4 additions & 0 deletions Checklists.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
A8961D4F1CD19E87006AFAF4 /* ItemDetailViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A8961D4E1CD19E87006AFAF4 /* ItemDetailViewController.swift */; };
A8961D541CD309B0006AFAF4 /* AllListsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A8961D531CD309B0006AFAF4 /* AllListsViewController.swift */; };
A8961D561CD31108006AFAF4 /* Checklist.swift in Sources */ = {isa = PBXBuildFile; fileRef = A8961D551CD31108006AFAF4 /* Checklist.swift */; };
A8F92F251CD7302D005009A6 /* IconPikerViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A8F92F241CD7302D005009A6 /* IconPikerViewController.swift */; };
A8FAB6981CD6CB75007E7222 /* ListDetailViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A8FAB6971CD6CB75007E7222 /* ListDetailViewController.swift */; };
/* End PBXBuildFile section */

Expand All @@ -33,6 +34,7 @@
A8961D4E1CD19E87006AFAF4 /* ItemDetailViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = ItemDetailViewController.swift; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.swift; };
A8961D531CD309B0006AFAF4 /* AllListsViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = AllListsViewController.swift; path = ../AllListsViewController.swift; sourceTree = "<group>"; };
A8961D551CD31108006AFAF4 /* Checklist.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Checklist.swift; sourceTree = "<group>"; };
A8F92F241CD7302D005009A6 /* IconPikerViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = IconPikerViewController.swift; path = ../IconPikerViewController.swift; sourceTree = "<group>"; };
A8FAB6971CD6CB75007E7222 /* ListDetailViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ListDetailViewController.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */

Expand Down Expand Up @@ -67,6 +69,7 @@
isa = PBXGroup;
children = (
A8961D531CD309B0006AFAF4 /* AllListsViewController.swift */,
A8F92F241CD7302D005009A6 /* IconPikerViewController.swift */,
A81172C41CD0660E00BA3196 /* AppDelegate.swift */,
A83B303B1CD6ECF800D38D88 /* DataModel.swift */,
A81172C61CD0660E00BA3196 /* ChecklistViewController.swift */,
Expand Down Expand Up @@ -158,6 +161,7 @@
A8FAB6981CD6CB75007E7222 /* ListDetailViewController.swift in Sources */,
A8961D4F1CD19E87006AFAF4 /* ItemDetailViewController.swift in Sources */,
A8961D561CD31108006AFAF4 /* Checklist.swift in Sources */,
A8F92F251CD7302D005009A6 /* IconPikerViewController.swift in Sources */,
A81172D91CD0859800BA3196 /* ChecklistItem.swift in Sources */,
A83B303C1CD6ECF800D38D88 /* DataModel.swift in Sources */,
A8961D541CD309B0006AFAF4 /* AllListsViewController.swift in Sources */,
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 18 additions & 0 deletions Checklists/Assets.xcassets/Appointments.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "Appointments@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "Appointments@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 18 additions & 0 deletions Checklists/Assets.xcassets/Birthdays.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "Birthdays@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "Birthdays@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 18 additions & 0 deletions Checklists/Assets.xcassets/Chores.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "Chores@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "Chores@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
6 changes: 6 additions & 0 deletions Checklists/Assets.xcassets/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"info" : {
"version" : 1,
"author" : "xcode"
}
}
18 changes: 18 additions & 0 deletions Checklists/Assets.xcassets/Drinks.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "Drinks@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "Drinks@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 18 additions & 0 deletions Checklists/Assets.xcassets/Folder.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "Folder@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "Folder@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 18 additions & 0 deletions Checklists/Assets.xcassets/Groceries.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "Groceries@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "Groceries@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 18 additions & 0 deletions Checklists/Assets.xcassets/Inbox.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "Inbox@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "Inbox@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 18 additions & 0 deletions Checklists/Assets.xcassets/No Icon.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "No Icon@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "No Icon@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 18 additions & 0 deletions Checklists/Assets.xcassets/Photos.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "Photos@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "Photos@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 18 additions & 0 deletions Checklists/Assets.xcassets/Trips.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "Trips@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "Trips@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
73 changes: 73 additions & 0 deletions Checklists/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,40 @@
</tableViewCell>
</cells>
</tableViewSection>
<tableViewSection id="0CF-dL-YUk">
<cells>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="default" accessoryType="disclosureIndicator" indentationWidth="10" id="hre-Ix-lgf">
<rect key="frame" x="0.0" y="179" width="600" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="hre-Ix-lgf" id="gwL-JT-zSg">
<rect key="frame" x="0.0" y="0.0" width="567" height="43"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="Icon" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="UdI-Gx-WBq">
<rect key="frame" x="17" y="11" width="33" height="21"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="e3a-mX-LrB">
<rect key="frame" x="523" y="4" width="36" height="36"/>
<constraints>
<constraint firstAttribute="height" constant="36" id="80t-Fk-FAk"/>
<constraint firstAttribute="width" constant="36" id="Vyk-sZ-VaT"/>
</constraints>
</imageView>
</subviews>
<constraints>
<constraint firstAttribute="trailing" secondItem="e3a-mX-LrB" secondAttribute="trailing" constant="8" id="PXJ-eO-aRl"/>
<constraint firstItem="e3a-mX-LrB" firstAttribute="top" secondItem="gwL-JT-zSg" secondAttribute="top" constant="4" id="pEt-Bj-uLZ"/>
</constraints>
</tableViewCellContentView>
<connections>
<segue destination="UUX-Sa-v3d" kind="show" identifier="PickIcon" id="1Dy-N8-a0B"/>
</connections>
</tableViewCell>
</cells>
</tableViewSection>
</sections>
<connections>
<outlet property="dataSource" destination="704-DC-qeA" id="ImH-19-wfA"/>
Expand All @@ -198,13 +232,52 @@
<simulatedToolbarMetrics key="simulatedBottomBarMetrics"/>
<connections>
<outlet property="doneBarButton" destination="4nq-G7-fzh" id="lP2-Wu-7Nt"/>
<outlet property="iconImageView" destination="e3a-mX-LrB" id="pvf-Xh-WGY"/>
<outlet property="textField" destination="1Zm-C4-47M" id="2iZ-u3-kmd"/>
</connections>
</tableViewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="fF0-qu-vds" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="1595" y="1634"/>
</scene>
<!--Choose Icon-->
<scene sceneID="TSu-ha-rRc">
<objects>
<tableViewController id="UUX-Sa-v3d" customClass="IconPickerViewController" customModule="Checklists" customModuleProvider="target" sceneMemberID="viewController">
<tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="44" sectionHeaderHeight="28" sectionFooterHeight="28" id="voz-Ok-x5M">
<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 clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" reuseIdentifier="IconCell" textLabel="jFK-wH-g6X" style="IBUITableViewCellStyleDefault" id="3fi-e8-9pY">
<rect key="frame" x="0.0" y="92" width="600" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="3fi-e8-9pY" id="fEb-NG-QQj">
<rect key="frame" x="0.0" y="0.0" width="600" height="43"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" multipleTouchEnabled="YES" contentMode="left" text="Title" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="jFK-wH-g6X">
<rect key="frame" x="15" y="0.0" width="570" height="43"/>
<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="UUX-Sa-v3d" id="GMJ-ai-wYO"/>
<outlet property="delegate" destination="UUX-Sa-v3d" id="H6h-yQ-7RV"/>
</connections>
</tableView>
<navigationItem key="navigationItem" title="Choose Icon" id="YeP-Hk-dET"/>
</tableViewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="8G0-GV-Rlh" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="2258" y="1633"/>
</scene>
<!--Navigation Controller-->
<scene sceneID="yoE-Pf-QTm">
<objects>
Expand Down
6 changes: 5 additions & 1 deletion Checklists/Checklist.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@ import UIKit
class Checklist: NSObject, NSCoding {
var name: String
var items: [ChecklistItem]
var iconName: String

init(name: String, items: [ChecklistItem]) {
init(name: String, items: [ChecklistItem], iconName: String) {
self.name = name
self.items = items
self.iconName = iconName
super.init()
}

Expand All @@ -21,11 +23,13 @@ class Checklist: NSObject, NSCoding {
required init?(coder aDecoder: NSCoder) {
name = aDecoder.decodeObjectForKey("Name") as! String
items = aDecoder.decodeObjectForKey("Items") as! [ChecklistItem]
iconName = aDecoder.decodeObjectForKey("IconName") as! String
super.init()
}

func encodeWithCoder(aCoder: NSCoder) {
aCoder.encodeObject(name, forKey: "Name")
aCoder.encodeObject(items, forKey: "Items")
aCoder.encodeObject(iconName, forKey: "IconName")
}
}
2 changes: 1 addition & 1 deletion Checklists/DataModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class DataModel {
let firstTime = userDefaults.boolForKey("FirstTime")

if firstTime {
let checklist = Checklist(name: "List", items: [])
let checklist = Checklist(name: "List", items: [], iconName: "No Icon")
lists.append(checklist)
indexOfSelectedChecklist = 0
userDefaults.setBool(false, forKey: "FirstTime")
Expand Down
Loading

0 comments on commit 909b956

Please sign in to comment.