Skip to content

Commit 94d8118

Browse files
stevetreaseSteve Trease
authored andcommitted
Changed tableview to alternating coloured cells with no divider
1 parent db3263c commit 94d8118

File tree

6 files changed

+18
-9
lines changed

6 files changed

+18
-9
lines changed

Swift Push 4/AppDelegate.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,16 +34,16 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
3434
item.alert = "Swift Push (\(versionNumber!)) starting on " + UIDevice.currentDevice().name
3535
notifications.insert(item, atIndex: 0)
3636

37-
// display an additional set of test messages
38-
/*
37+
// display an additional set of test notifications
38+
3939
let formatter = NSNumberFormatter()
4040
formatter.numberStyle = NSNumberFormatterStyle.SpellOutStyle
4141
for i in 1...10 {
4242
item = NotificationData()
4343
item.alert = "test data " + formatter.stringFromNumber(i)!
4444
notifications.insert(item, atIndex: 0)
4545
}
46-
*/
46+
4747

4848
let types: UIUserNotificationType =
4949
[UIUserNotificationType.Alert, UIUserNotificationType.Badge, UIUserNotificationType.Sound]

Swift Push 4/Base.lproj/Main.storyboard

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
<scene sceneID="smW-Zh-WAh">
2626
<objects>
2727
<tableViewController title="Master" clearsSelectionOnViewWillAppear="NO" id="7bK-jq-Zjz" customClass="MasterViewController" customModule="Swift_Push_4" customModuleProvider="target" sceneMemberID="viewController">
28-
<tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" allowsSelection="NO" showsSelectionImmediatelyOnTouchBegin="NO" rowHeight="44" sectionHeaderHeight="22" sectionFooterHeight="22" id="r7i-6Z-zg0">
28+
<tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="none" allowsSelection="NO" showsSelectionImmediatelyOnTouchBegin="NO" rowHeight="44" sectionHeaderHeight="22" sectionFooterHeight="22" id="r7i-6Z-zg0">
2929
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
3030
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
3131
<animations/>
@@ -35,7 +35,7 @@
3535
<rect key="frame" x="0.0" y="86" width="600" height="44"/>
3636
<autoresizingMask key="autoresizingMask"/>
3737
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="WCw-Qf-5nD" id="37f-cq-3Eg">
38-
<rect key="frame" x="0.0" y="0.0" width="600" height="43.5"/>
38+
<rect key="frame" x="0.0" y="0.0" width="600" height="44"/>
3939
<autoresizingMask key="autoresizingMask"/>
4040
<subviews>
4141
<label opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="left" text="Title" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="Arm-wq-HPj">

Swift Push 4/Info.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<key>CFBundleSignature</key>
2020
<string>????</string>
2121
<key>CFBundleVersion</key>
22-
<string>556</string>
22+
<string>566</string>
2323
<key>LSRequiresIPhoneOS</key>
2424
<true/>
2525
<key>UIBackgroundModes</key>

Swift Push 4/MasterViewController.swift

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,16 @@ class MasterViewController: UITableViewController, UISearchResultsUpdating {
8787

8888
cell.textLabel?.text = notification.alert as String
8989
cell.detailTextLabel?.text = NSDateFormatter.localizedStringFromDate(notification.timeStampSent, dateStyle: .MediumStyle, timeStyle: .ShortStyle) as String
90-
+ " (\(notification.messageID))"
90+
91+
if (notification.messageID != 0) {
92+
cell.detailTextLabel!.text = cell.detailTextLabel!.text! + " (\(notification.messageID))"
93+
}
94+
95+
if(indexPath.row % 2 == 0){
96+
cell.backgroundColor = UIColor.whiteColor()
97+
} else{
98+
cell.backgroundColor = UIColor.lightGrayColor().colorWithAlphaComponent(0.20)
99+
}
91100

92101
return cell
93102
}
@@ -104,7 +113,7 @@ class MasterViewController: UITableViewController, UISearchResultsUpdating {
104113
} else {
105114
self.filteredNotifications = notifications.filter({( notification: NotificationData) -> Bool in
106115
// let categoryMatch = (scope == "All") || (notification.alert == scope)
107-
let stringMatch = notification.alert.lowercaseString.rangeOfString(searchController.searchBar.text!.lowercaseString)
116+
let stringMatch = notification.alert.rangeOfString(searchController.searchBar.text!, options: .CaseInsensitiveSearch)
108117
return (stringMatch != nil)
109118
})
110119
}

Swift Push 4/Settings.bundle/Root.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<array>
77
<dict>
88
<key>DefaultValue</key>
9-
<string>556</string>
9+
<string>566</string>
1010
<key>Key</key>
1111
<string>CurrentBuildNumber</string>
1212
<key>Title</key>

0 commit comments

Comments
 (0)