Skip to content

Commit 3b41f00

Browse files
stevetreaseSteve Trease
authored andcommitted
Added row deletion option.
1 parent 263d8cd commit 3b41f00

File tree

8 files changed

+16
-8
lines changed

8 files changed

+16
-8
lines changed
Binary file not shown.

Swift Push 4/AppDelegate.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
3636
notifications.insert(item, atIndex: 0)
3737

3838
// display an additional set of test notifications
39+
3940
/*
4041
let formatter = NSNumberFormatter()
4142
formatter.numberStyle = NSNumberFormatterStyle.SpellOutStyle
@@ -50,7 +51,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
5051
}
5152
*/
5253

53-
5454
let types: UIUserNotificationType =
5555
[UIUserNotificationType.Alert, UIUserNotificationType.Badge, UIUserNotificationType.Sound]
5656

Swift Push 4/Base.lproj/LaunchScreen.storyboard

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2-
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="8187.4" systemVersion="15A279b" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" initialViewController="01J-lp-oVM">
2+
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="8191" systemVersion="15B17c" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" initialViewController="01J-lp-oVM">
33
<dependencies>
4-
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="8151.3"/>
4+
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="8154"/>
55
<capability name="Constraints with non-1.0 multipliers" minToolsVersion="5.1"/>
66
</dependencies>
77
<scenes>

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="none" allowsSelection="NO" showsSelectionImmediatelyOnTouchBegin="NO" rowHeight="44" sectionHeaderHeight="22" sectionFooterHeight="22" id="r7i-6Z-zg0">
28+
<tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" pagingEnabled="YES" dataMode="prototypes" style="plain" allowsSelection="NO" allowsSelectionDuringEditing="YES" 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/>
@@ -43,7 +43,7 @@
4343
<rect key="frame" x="0.0" y="86" width="600" height="44"/>
4444
<autoresizingMask key="autoresizingMask"/>
4545
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="WCw-Qf-5nD" id="37f-cq-3Eg">
46-
<rect key="frame" x="0.0" y="0.0" width="600" height="44"/>
46+
<rect key="frame" x="0.0" y="0.0" width="600" height="43.5"/>
4747
<autoresizingMask key="autoresizingMask"/>
4848
<subviews>
4949
<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>601</string>
22+
<string>604</string>
2323
<key>LSRequiresIPhoneOS</key>
2424
<true/>
2525
<key>UIBackgroundModes</key>

Swift Push 4/MasterViewController.swift

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,14 @@ class MasterViewController: UITableViewController, UISearchResultsUpdating {
120120
}
121121

122122

123+
override func tableView(tableView: UITableView, commitEditingStyle editingStyle: UITableViewCellEditingStyle, forRowAtIndexPath indexPath: NSIndexPath) {
124+
if editingStyle == UITableViewCellEditingStyle.Delete {
125+
notifications.removeAtIndex(indexPath.row)
126+
tableView.deleteRowsAtIndexPaths([indexPath], withRowAnimation: UITableViewRowAnimation.Automatic)
127+
}
128+
}
129+
130+
123131
func updateSearchResultsForSearchController(searchController: UISearchController)
124132
{
125133
print(updateSearchResultsForSearchController)

Swift Push 4/NotificationData.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import Foundation
99

1010
// A single, global instance of this class
1111
var notifications = [NotificationData]()
12-
let maxNotifications = 128
12+
let maxNotifications = 256
1313

1414
class NotificationData {
1515
var alert: String = ""

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>601</string>
9+
<string>604</string>
1010
<key>Key</key>
1111
<string>CurrentBuildNumber</string>
1212
<key>Title</key>

0 commit comments

Comments
 (0)