Skip to content

Commit 16634b6

Browse files
author
Steve Trease
committed
Make text search case insensitive.
1 parent 6964074 commit 16634b6

File tree

5 files changed

+8
-11
lines changed

5 files changed

+8
-11
lines changed

Swift Push 3/Base.lproj/Main.storyboard

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
1414
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
1515
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
16-
<searchBar key="tableHeaderView" contentMode="redraw" placeholder="Search for text" id="eAE-ew-HFb">
17-
<rect key="frame" x="0.0" y="0.0" width="600" height="44"/>
16+
<searchBar key="tableHeaderView" contentMode="redraw" placeholder="Search" showsCancelButton="YES" id="eAE-ew-HFb">
17+
<rect key="frame" x="0.0" y="64" width="600" height="44"/>
1818
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
1919
<textInputTraits key="textInputTraits" autocorrectionType="no" spellCheckingType="no"/>
2020
<connections>
@@ -31,13 +31,13 @@
3131
<label opaque="NO" multipleTouchEnabled="YES" contentMode="left" text="Title" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="TNL-cU-lIg">
3232
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
3333
<fontDescription key="fontDescription" name="HelveticaNeue" family="Helvetica Neue" pointSize="16"/>
34-
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
34+
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
3535
<nil key="highlightedColor"/>
3636
</label>
3737
<label opaque="NO" multipleTouchEnabled="YES" contentMode="left" text="Subtitle" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="EDd-wh-mgO">
3838
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
3939
<fontDescription key="fontDescription" type="system" pointSize="11"/>
40-
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
40+
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
4141
<nil key="highlightedColor"/>
4242
</label>
4343
</subviews>

Swift Push 3/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>230</string>
22+
<string>232</string>
2323
<key>LSRequiresIPhoneOS</key>
2424
<true/>
2525
<key>UIBackgroundModes</key>

Swift Push 3/NotificationsTableViewController.swift

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ class NotificationsTableViewController: UITableViewController, UISearchBarDelega
1515
func filterContentForSearchText(searchText: String) {
1616
// Filter the array using the filter method
1717
self.filteredNotifications = notifications.filter({( notification: NotificationData) -> Bool in
18-
// let categoryMatch = (scope == "All") || (notification.alert == scope)
19-
let stringMatch = notification.alert.rangeOfString(searchText)
18+
let stringMatch = notification.alert.lowercaseString.rangeOfString(searchText.lowercaseString)
2019
return (stringMatch != nil)
2120
})
2221
}
22+
2323
func searchDisplayController(controller: UISearchDisplayController!, shouldReloadTableForSearchString searchString: String!) -> Bool {
2424
self.filterContentForSearchText(searchString)
2525
return true
@@ -78,12 +78,9 @@ class NotificationsTableViewController: UITableViewController, UISearchBarDelega
7878
override func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
7979
// #warning Incomplete method implementation.
8080
// Return the number of rows in the section.
81-
// println("numberOfRowsInSection")
8281
if tableView == self.searchDisplayController!.searchResultsTableView {
83-
println("filtered ")
8482
return self.filteredNotifications.count
8583
} else {
86-
println("unfiltered ")
8784
return notifications.count
8885
}
8986
}

Swift Push 3/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>230</string>
9+
<string>232</string>
1010
<key>Key</key>
1111
<string>CurrentBuildNumber</string>
1212
<key>Title</key>

0 commit comments

Comments
 (0)