diff --git a/Lister/About Lister.pdf b/Lister/About Lister.pdf
index 81f7643d..f03a08db 100644
Binary files a/Lister/About Lister.pdf and b/Lister/About Lister.pdf differ
diff --git a/Lister/Swift/Common/AllListItemsPresenter.swift b/Lister/Common/AllListItemsPresenter.swift
similarity index 99%
rename from Lister/Swift/Common/AllListItemsPresenter.swift
rename to Lister/Common/AllListItemsPresenter.swift
index 240b3a35..66bceed1 100644
--- a/Lister/Swift/Common/AllListItemsPresenter.swift
+++ b/Lister/Common/AllListItemsPresenter.swift
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2015 Apple Inc. All Rights Reserved.
+ Copyright (C) 2016 Apple Inc. All Rights Reserved.
See LICENSE.txt for this sample’s licensing information
Abstract:
diff --git a/Lister/Swift/Common/AppConfiguration.swift b/Lister/Common/AppConfiguration.swift
similarity index 99%
rename from Lister/Swift/Common/AppConfiguration.swift
rename to Lister/Common/AppConfiguration.swift
index 778fc144..61a40a36 100644
--- a/Lister/Swift/Common/AppConfiguration.swift
+++ b/Lister/Common/AppConfiguration.swift
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2015 Apple Inc. All Rights Reserved.
+ Copyright (C) 2016 Apple Inc. All Rights Reserved.
See LICENSE.txt for this sample’s licensing information
Abstract:
diff --git a/Lister/Swift/Common/CheckBoxLayer.swift b/Lister/Common/CheckBoxLayer.swift
similarity index 98%
rename from Lister/Swift/Common/CheckBoxLayer.swift
rename to Lister/Common/CheckBoxLayer.swift
index f8660d44..9413901c 100644
--- a/Lister/Swift/Common/CheckBoxLayer.swift
+++ b/Lister/Common/CheckBoxLayer.swift
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2015 Apple Inc. All Rights Reserved.
+ Copyright (C) 2016 Apple Inc. All Rights Reserved.
See LICENSE.txt for this sample’s licensing information
Abstract:
diff --git a/Lister/Swift/Common/IncompleteListItemsPresenter.swift b/Lister/Common/IncompleteListItemsPresenter.swift
similarity index 99%
rename from Lister/Swift/Common/IncompleteListItemsPresenter.swift
rename to Lister/Common/IncompleteListItemsPresenter.swift
index 9142d376..8f527a1c 100644
--- a/Lister/Swift/Common/IncompleteListItemsPresenter.swift
+++ b/Lister/Common/IncompleteListItemsPresenter.swift
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2015 Apple Inc. All Rights Reserved.
+ Copyright (C) 2016 Apple Inc. All Rights Reserved.
See LICENSE.txt for this sample’s licensing information
Abstract:
diff --git a/Lister/Swift/Common/List.swift b/Lister/Common/List.swift
similarity index 96%
rename from Lister/Swift/Common/List.swift
rename to Lister/Common/List.swift
index 10ef8f54..f809ff36 100644
--- a/Lister/Swift/Common/List.swift
+++ b/Lister/Common/List.swift
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2015 Apple Inc. All Rights Reserved.
+ Copyright (C) 2016 Apple Inc. All Rights Reserved.
See LICENSE.txt for this sample’s licensing information
Abstract:
@@ -18,7 +18,7 @@ import Foundation
the Objective-C version of Lister to unarchive a `List` instance that was archived in the Swift version.
*/
@objc(AAPLList)
-final public class List: NSObject, NSCoding, NSCopying, CustomDebugStringConvertible {
+final public class List: NSObject, NSCoding, NSCopying {
// MARK: Types
/**
diff --git a/Lister/Swift/Common/ListColorUI.swift b/Lister/Common/ListColorUI.swift
similarity index 97%
rename from Lister/Swift/Common/ListColorUI.swift
rename to Lister/Common/ListColorUI.swift
index 06e57eaf..572504ee 100644
--- a/Lister/Swift/Common/ListColorUI.swift
+++ b/Lister/Common/ListColorUI.swift
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2015 Apple Inc. All Rights Reserved.
+ Copyright (C) 2016 Apple Inc. All Rights Reserved.
See LICENSE.txt for this sample’s licensing information
Abstract:
diff --git a/Lister/Swift/Common/ListItem.swift b/Lister/Common/ListItem.swift
similarity index 96%
rename from Lister/Swift/Common/ListItem.swift
rename to Lister/Common/ListItem.swift
index 6f9fb2c8..87040f31 100644
--- a/Lister/Swift/Common/ListItem.swift
+++ b/Lister/Common/ListItem.swift
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2015 Apple Inc. All Rights Reserved.
+ Copyright (C) 2016 Apple Inc. All Rights Reserved.
See LICENSE.txt for this sample’s licensing information
Abstract:
@@ -18,7 +18,7 @@ import Foundation
version of Lister to unarchive a `ListItem` instance that was archived in the Swift version.
*/
@objc(AAPLListItem)
-final public class ListItem: NSObject, NSCoding, NSCopying, CustomDebugStringConvertible {
+final public class ListItem: NSObject, NSCoding, NSCopying {
// MARK: Types
/**
@@ -130,6 +130,6 @@ final public class ListItem: NSObject, NSCoding, NSCopying, CustomDebugStringCon
// MARK: DebugPrintable
public override var debugDescription: String {
- return "\"\(text)\""
+ return "\"\(text)\" [\(isComplete ? "X" : " ")]"
}
}
diff --git a/Lister/Swift/Common/ListPresenterAlgorithms.swift b/Lister/Common/ListPresenterAlgorithms.swift
similarity index 98%
rename from Lister/Swift/Common/ListPresenterAlgorithms.swift
rename to Lister/Common/ListPresenterAlgorithms.swift
index ec2caac7..24e9cfdf 100644
--- a/Lister/Swift/Common/ListPresenterAlgorithms.swift
+++ b/Lister/Common/ListPresenterAlgorithms.swift
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2015 Apple Inc. All Rights Reserved.
+ Copyright (C) 2016 Apple Inc. All Rights Reserved.
See LICENSE.txt for this sample’s licensing information
Abstract:
diff --git a/Lister/Swift/Common/ListPresenterDelegate.swift b/Lister/Common/ListPresenterDelegate.swift
similarity index 99%
rename from Lister/Swift/Common/ListPresenterDelegate.swift
rename to Lister/Common/ListPresenterDelegate.swift
index 3575ebd5..094e0a44 100644
--- a/Lister/Swift/Common/ListPresenterDelegate.swift
+++ b/Lister/Common/ListPresenterDelegate.swift
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2015 Apple Inc. All Rights Reserved.
+ Copyright (C) 2016 Apple Inc. All Rights Reserved.
See LICENSE.txt for this sample’s licensing information
Abstract:
diff --git a/Lister/Swift/Common/ListPresenterType.swift b/Lister/Common/ListPresenterType.swift
similarity index 98%
rename from Lister/Swift/Common/ListPresenterType.swift
rename to Lister/Common/ListPresenterType.swift
index 377030a3..22998422 100644
--- a/Lister/Swift/Common/ListPresenterType.swift
+++ b/Lister/Common/ListPresenterType.swift
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2015 Apple Inc. All Rights Reserved.
+ Copyright (C) 2016 Apple Inc. All Rights Reserved.
See LICENSE.txt for this sample’s licensing information
Abstract:
diff --git a/Lister/Swift/Common/ListPresenterUtilities.swift b/Lister/Common/ListPresenterUtilities.swift
similarity index 98%
rename from Lister/Swift/Common/ListPresenterUtilities.swift
rename to Lister/Common/ListPresenterUtilities.swift
index c06080c5..5a1e27ac 100644
--- a/Lister/Swift/Common/ListPresenterUtilities.swift
+++ b/Lister/Common/ListPresenterUtilities.swift
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2015 Apple Inc. All Rights Reserved.
+ Copyright (C) 2016 Apple Inc. All Rights Reserved.
See LICENSE.txt for this sample’s licensing information
Abstract:
diff --git a/Lister/LICENSE.txt b/Lister/LICENSE.txt
index a26f5a41..adad4ad3 100644
--- a/Lister/LICENSE.txt
+++ b/Lister/LICENSE.txt
@@ -1,5 +1,5 @@
Sample code project: Lister (for watchOS, iOS, and OS X)
-Version: 3.0
+Version: 3.3
IMPORTANT: This Apple software is supplied to you by Apple
Inc. ("Apple") in consideration of your agreement to the following
@@ -39,4 +39,4 @@ AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE),
STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
-Copyright (C) 2015 Apple Inc. All Rights Reserved.
+Copyright (C) 2016 Apple Inc. All Rights Reserved.
diff --git a/Lister/Swift/Lister Tests/AppLaunchContextTests.swift b/Lister/Lister Tests/AppLaunchContextTests.swift
similarity index 67%
rename from Lister/Swift/Lister Tests/AppLaunchContextTests.swift
rename to Lister/Lister Tests/AppLaunchContextTests.swift
index bfa657e5..a5495195 100644
--- a/Lister/Swift/Lister Tests/AppLaunchContextTests.swift
+++ b/Lister/Lister Tests/AppLaunchContextTests.swift
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2015 Apple Inc. All Rights Reserved.
+ Copyright (C) 2016 Apple Inc. All Rights Reserved.
See LICENSE.txt for this sample’s licensing information
Abstract:
@@ -42,7 +42,12 @@ class AppLaunchContextTests: XCTestCase {
AppConfiguration.UserActivity.listColorUserInfoKey: color.rawValue
])
- let launchContext = AppLaunchContext(userActivity: userActivity)
+ let listsController = AppConfiguration.sharedConfiguration.listsControllerForCurrentConfigurationWithPathExtension(AppConfiguration.listerFileExtension, firstQueryHandler: nil)
+ let possibleLaunchContext = AppLaunchContext(userActivity: userActivity, listsController: listsController)
+
+ XCTAssertNotNil(possibleLaunchContext)
+
+ guard let launchContext = possibleLaunchContext else { return }
XCTAssertEqual(launchContext.listURL.absoluteURL, listURLs.first!.absoluteURL)
XCTAssertEqual(launchContext.listColor, color)
@@ -56,7 +61,12 @@ class AppLaunchContextTests: XCTestCase {
AppConfiguration.UserActivity.listColorUserInfoKey: color.rawValue
])
- let launchContext = AppLaunchContext(userActivity: userActivity)
+ let listsController = AppConfiguration.sharedConfiguration.listsControllerForCurrentConfigurationWithPathExtension(AppConfiguration.listerFileExtension, firstQueryHandler: nil)
+ let possibleLaunchContext = AppLaunchContext(userActivity: userActivity, listsController: listsController)
+
+ XCTAssertNotNil(possibleLaunchContext)
+
+ guard let launchContext = possibleLaunchContext else { return }
XCTAssertEqual(launchContext.listURL.absoluteURL, listURLs.first!.absoluteURL)
XCTAssertEqual(launchContext.listColor, color)
@@ -71,7 +81,12 @@ class AppLaunchContextTests: XCTestCase {
AppConfiguration.UserActivity.listColorUserInfoKey: color.rawValue
])
- let launchContext = AppLaunchContext(userActivity: userActivity)
+ let listsController = AppConfiguration.sharedConfiguration.listsControllerForCurrentConfigurationWithPathExtension(AppConfiguration.listerFileExtension, firstQueryHandler: nil)
+ let possibleLaunchContext = AppLaunchContext(userActivity: userActivity, listsController: listsController)
+
+ XCTAssertNotNil(possibleLaunchContext)
+
+ guard let launchContext = possibleLaunchContext else { return }
XCTAssertEqual(launchContext.listURL.absoluteURL, listURLs.first!.absoluteURL)
XCTAssertEqual(launchContext.listColor, color)
@@ -88,7 +103,11 @@ class AppLaunchContextTests: XCTestCase {
let colorQueryItem = NSURLQueryItem(name: AppConfiguration.ListerScheme.colorQueryKey, value: colorQueryValue)
urlComponents.queryItems = [colorQueryItem]
- let launchContext = AppLaunchContext(listerURL: urlComponents.URL!)
+ let possibleLaunchContext = AppLaunchContext(listerURL: urlComponents.URL!)
+
+ XCTAssertNotNil(possibleLaunchContext)
+
+ guard let launchContext = possibleLaunchContext else { return }
XCTAssertEqual(launchContext.listURL.absoluteURL, listURLs.first!.absoluteURL)
XCTAssertEqual(launchContext.listColor, color)
diff --git a/Lister/Objective-C/Lister Tests/Info.plist b/Lister/Lister Tests/Info.plist
similarity index 100%
rename from Lister/Objective-C/Lister Tests/Info.plist
rename to Lister/Lister Tests/Info.plist
diff --git a/Lister/Objective-C/Lister Watch App/Assets/Badge/glance-0@2x.png b/Lister/Lister Watch App/Assets/Badge/glance-0@2x.png
similarity index 100%
rename from Lister/Objective-C/Lister Watch App/Assets/Badge/glance-0@2x.png
rename to Lister/Lister Watch App/Assets/Badge/glance-0@2x.png
diff --git a/Lister/Objective-C/Lister Watch App/Assets/Badge/glance-10@2x.png b/Lister/Lister Watch App/Assets/Badge/glance-10@2x.png
similarity index 100%
rename from Lister/Objective-C/Lister Watch App/Assets/Badge/glance-10@2x.png
rename to Lister/Lister Watch App/Assets/Badge/glance-10@2x.png
diff --git a/Lister/Objective-C/Lister Watch App/Assets/Badge/glance-11@2x.png b/Lister/Lister Watch App/Assets/Badge/glance-11@2x.png
similarity index 100%
rename from Lister/Objective-C/Lister Watch App/Assets/Badge/glance-11@2x.png
rename to Lister/Lister Watch App/Assets/Badge/glance-11@2x.png
diff --git a/Lister/Objective-C/Lister Watch App/Assets/Badge/glance-12@2x.png b/Lister/Lister Watch App/Assets/Badge/glance-12@2x.png
similarity index 100%
rename from Lister/Objective-C/Lister Watch App/Assets/Badge/glance-12@2x.png
rename to Lister/Lister Watch App/Assets/Badge/glance-12@2x.png
diff --git a/Lister/Objective-C/Lister Watch App/Assets/Badge/glance-13@2x.png b/Lister/Lister Watch App/Assets/Badge/glance-13@2x.png
similarity index 100%
rename from Lister/Objective-C/Lister Watch App/Assets/Badge/glance-13@2x.png
rename to Lister/Lister Watch App/Assets/Badge/glance-13@2x.png
diff --git a/Lister/Objective-C/Lister Watch App/Assets/Badge/glance-14@2x.png b/Lister/Lister Watch App/Assets/Badge/glance-14@2x.png
similarity index 100%
rename from Lister/Objective-C/Lister Watch App/Assets/Badge/glance-14@2x.png
rename to Lister/Lister Watch App/Assets/Badge/glance-14@2x.png
diff --git a/Lister/Objective-C/Lister Watch App/Assets/Badge/glance-15@2x.png b/Lister/Lister Watch App/Assets/Badge/glance-15@2x.png
similarity index 100%
rename from Lister/Objective-C/Lister Watch App/Assets/Badge/glance-15@2x.png
rename to Lister/Lister Watch App/Assets/Badge/glance-15@2x.png
diff --git a/Lister/Objective-C/Lister Watch App/Assets/Badge/glance-16@2x.png b/Lister/Lister Watch App/Assets/Badge/glance-16@2x.png
similarity index 100%
rename from Lister/Objective-C/Lister Watch App/Assets/Badge/glance-16@2x.png
rename to Lister/Lister Watch App/Assets/Badge/glance-16@2x.png
diff --git a/Lister/Objective-C/Lister Watch App/Assets/Badge/glance-17@2x.png b/Lister/Lister Watch App/Assets/Badge/glance-17@2x.png
similarity index 100%
rename from Lister/Objective-C/Lister Watch App/Assets/Badge/glance-17@2x.png
rename to Lister/Lister Watch App/Assets/Badge/glance-17@2x.png
diff --git a/Lister/Objective-C/Lister Watch App/Assets/Badge/glance-18@2x.png b/Lister/Lister Watch App/Assets/Badge/glance-18@2x.png
similarity index 100%
rename from Lister/Objective-C/Lister Watch App/Assets/Badge/glance-18@2x.png
rename to Lister/Lister Watch App/Assets/Badge/glance-18@2x.png
diff --git a/Lister/Objective-C/Lister Watch App/Assets/Badge/glance-19@2x.png b/Lister/Lister Watch App/Assets/Badge/glance-19@2x.png
similarity index 100%
rename from Lister/Objective-C/Lister Watch App/Assets/Badge/glance-19@2x.png
rename to Lister/Lister Watch App/Assets/Badge/glance-19@2x.png
diff --git a/Lister/Objective-C/Lister Watch App/Assets/Badge/glance-1@2x.png b/Lister/Lister Watch App/Assets/Badge/glance-1@2x.png
similarity index 100%
rename from Lister/Objective-C/Lister Watch App/Assets/Badge/glance-1@2x.png
rename to Lister/Lister Watch App/Assets/Badge/glance-1@2x.png
diff --git a/Lister/Objective-C/Lister Watch App/Assets/Badge/glance-20@2x.png b/Lister/Lister Watch App/Assets/Badge/glance-20@2x.png
similarity index 100%
rename from Lister/Objective-C/Lister Watch App/Assets/Badge/glance-20@2x.png
rename to Lister/Lister Watch App/Assets/Badge/glance-20@2x.png
diff --git a/Lister/Objective-C/Lister Watch App/Assets/Badge/glance-21@2x.png b/Lister/Lister Watch App/Assets/Badge/glance-21@2x.png
similarity index 100%
rename from Lister/Objective-C/Lister Watch App/Assets/Badge/glance-21@2x.png
rename to Lister/Lister Watch App/Assets/Badge/glance-21@2x.png
diff --git a/Lister/Objective-C/Lister Watch App/Assets/Badge/glance-22@2x.png b/Lister/Lister Watch App/Assets/Badge/glance-22@2x.png
similarity index 100%
rename from Lister/Objective-C/Lister Watch App/Assets/Badge/glance-22@2x.png
rename to Lister/Lister Watch App/Assets/Badge/glance-22@2x.png
diff --git a/Lister/Objective-C/Lister Watch App/Assets/Badge/glance-23@2x.png b/Lister/Lister Watch App/Assets/Badge/glance-23@2x.png
similarity index 100%
rename from Lister/Objective-C/Lister Watch App/Assets/Badge/glance-23@2x.png
rename to Lister/Lister Watch App/Assets/Badge/glance-23@2x.png
diff --git a/Lister/Objective-C/Lister Watch App/Assets/Badge/glance-24@2x.png b/Lister/Lister Watch App/Assets/Badge/glance-24@2x.png
similarity index 100%
rename from Lister/Objective-C/Lister Watch App/Assets/Badge/glance-24@2x.png
rename to Lister/Lister Watch App/Assets/Badge/glance-24@2x.png
diff --git a/Lister/Objective-C/Lister Watch App/Assets/Badge/glance-25@2x.png b/Lister/Lister Watch App/Assets/Badge/glance-25@2x.png
similarity index 100%
rename from Lister/Objective-C/Lister Watch App/Assets/Badge/glance-25@2x.png
rename to Lister/Lister Watch App/Assets/Badge/glance-25@2x.png
diff --git a/Lister/Objective-C/Lister Watch App/Assets/Badge/glance-26@2x.png b/Lister/Lister Watch App/Assets/Badge/glance-26@2x.png
similarity index 100%
rename from Lister/Objective-C/Lister Watch App/Assets/Badge/glance-26@2x.png
rename to Lister/Lister Watch App/Assets/Badge/glance-26@2x.png
diff --git a/Lister/Objective-C/Lister Watch App/Assets/Badge/glance-27@2x.png b/Lister/Lister Watch App/Assets/Badge/glance-27@2x.png
similarity index 100%
rename from Lister/Objective-C/Lister Watch App/Assets/Badge/glance-27@2x.png
rename to Lister/Lister Watch App/Assets/Badge/glance-27@2x.png
diff --git a/Lister/Objective-C/Lister Watch App/Assets/Badge/glance-28@2x.png b/Lister/Lister Watch App/Assets/Badge/glance-28@2x.png
similarity index 100%
rename from Lister/Objective-C/Lister Watch App/Assets/Badge/glance-28@2x.png
rename to Lister/Lister Watch App/Assets/Badge/glance-28@2x.png
diff --git a/Lister/Objective-C/Lister Watch App/Assets/Badge/glance-29@2x.png b/Lister/Lister Watch App/Assets/Badge/glance-29@2x.png
similarity index 100%
rename from Lister/Objective-C/Lister Watch App/Assets/Badge/glance-29@2x.png
rename to Lister/Lister Watch App/Assets/Badge/glance-29@2x.png
diff --git a/Lister/Objective-C/Lister Watch App/Assets/Badge/glance-2@2x.png b/Lister/Lister Watch App/Assets/Badge/glance-2@2x.png
similarity index 100%
rename from Lister/Objective-C/Lister Watch App/Assets/Badge/glance-2@2x.png
rename to Lister/Lister Watch App/Assets/Badge/glance-2@2x.png
diff --git a/Lister/Objective-C/Lister Watch App/Assets/Badge/glance-30@2x.png b/Lister/Lister Watch App/Assets/Badge/glance-30@2x.png
similarity index 100%
rename from Lister/Objective-C/Lister Watch App/Assets/Badge/glance-30@2x.png
rename to Lister/Lister Watch App/Assets/Badge/glance-30@2x.png
diff --git a/Lister/Objective-C/Lister Watch App/Assets/Badge/glance-31@2x.png b/Lister/Lister Watch App/Assets/Badge/glance-31@2x.png
similarity index 100%
rename from Lister/Objective-C/Lister Watch App/Assets/Badge/glance-31@2x.png
rename to Lister/Lister Watch App/Assets/Badge/glance-31@2x.png
diff --git a/Lister/Objective-C/Lister Watch App/Assets/Badge/glance-32@2x.png b/Lister/Lister Watch App/Assets/Badge/glance-32@2x.png
similarity index 100%
rename from Lister/Objective-C/Lister Watch App/Assets/Badge/glance-32@2x.png
rename to Lister/Lister Watch App/Assets/Badge/glance-32@2x.png
diff --git a/Lister/Objective-C/Lister Watch App/Assets/Badge/glance-33@2x.png b/Lister/Lister Watch App/Assets/Badge/glance-33@2x.png
similarity index 100%
rename from Lister/Objective-C/Lister Watch App/Assets/Badge/glance-33@2x.png
rename to Lister/Lister Watch App/Assets/Badge/glance-33@2x.png
diff --git a/Lister/Objective-C/Lister Watch App/Assets/Badge/glance-34@2x.png b/Lister/Lister Watch App/Assets/Badge/glance-34@2x.png
similarity index 100%
rename from Lister/Objective-C/Lister Watch App/Assets/Badge/glance-34@2x.png
rename to Lister/Lister Watch App/Assets/Badge/glance-34@2x.png
diff --git a/Lister/Objective-C/Lister Watch App/Assets/Badge/glance-35@2x.png b/Lister/Lister Watch App/Assets/Badge/glance-35@2x.png
similarity index 100%
rename from Lister/Objective-C/Lister Watch App/Assets/Badge/glance-35@2x.png
rename to Lister/Lister Watch App/Assets/Badge/glance-35@2x.png
diff --git a/Lister/Objective-C/Lister Watch App/Assets/Badge/glance-36@2x.png b/Lister/Lister Watch App/Assets/Badge/glance-36@2x.png
similarity index 100%
rename from Lister/Objective-C/Lister Watch App/Assets/Badge/glance-36@2x.png
rename to Lister/Lister Watch App/Assets/Badge/glance-36@2x.png
diff --git a/Lister/Objective-C/Lister Watch App/Assets/Badge/glance-37@2x.png b/Lister/Lister Watch App/Assets/Badge/glance-37@2x.png
similarity index 100%
rename from Lister/Objective-C/Lister Watch App/Assets/Badge/glance-37@2x.png
rename to Lister/Lister Watch App/Assets/Badge/glance-37@2x.png
diff --git a/Lister/Objective-C/Lister Watch App/Assets/Badge/glance-38@2x.png b/Lister/Lister Watch App/Assets/Badge/glance-38@2x.png
similarity index 100%
rename from Lister/Objective-C/Lister Watch App/Assets/Badge/glance-38@2x.png
rename to Lister/Lister Watch App/Assets/Badge/glance-38@2x.png
diff --git a/Lister/Objective-C/Lister Watch App/Assets/Badge/glance-39@2x.png b/Lister/Lister Watch App/Assets/Badge/glance-39@2x.png
similarity index 100%
rename from Lister/Objective-C/Lister Watch App/Assets/Badge/glance-39@2x.png
rename to Lister/Lister Watch App/Assets/Badge/glance-39@2x.png
diff --git a/Lister/Objective-C/Lister Watch App/Assets/Badge/glance-3@2x.png b/Lister/Lister Watch App/Assets/Badge/glance-3@2x.png
similarity index 100%
rename from Lister/Objective-C/Lister Watch App/Assets/Badge/glance-3@2x.png
rename to Lister/Lister Watch App/Assets/Badge/glance-3@2x.png
diff --git a/Lister/Objective-C/Lister Watch App/Assets/Badge/glance-40@2x.png b/Lister/Lister Watch App/Assets/Badge/glance-40@2x.png
similarity index 100%
rename from Lister/Objective-C/Lister Watch App/Assets/Badge/glance-40@2x.png
rename to Lister/Lister Watch App/Assets/Badge/glance-40@2x.png
diff --git a/Lister/Objective-C/Lister Watch App/Assets/Badge/glance-41@2x.png b/Lister/Lister Watch App/Assets/Badge/glance-41@2x.png
similarity index 100%
rename from Lister/Objective-C/Lister Watch App/Assets/Badge/glance-41@2x.png
rename to Lister/Lister Watch App/Assets/Badge/glance-41@2x.png
diff --git a/Lister/Objective-C/Lister Watch App/Assets/Badge/glance-42@2x.png b/Lister/Lister Watch App/Assets/Badge/glance-42@2x.png
similarity index 100%
rename from Lister/Objective-C/Lister Watch App/Assets/Badge/glance-42@2x.png
rename to Lister/Lister Watch App/Assets/Badge/glance-42@2x.png
diff --git a/Lister/Objective-C/Lister Watch App/Assets/Badge/glance-43@2x.png b/Lister/Lister Watch App/Assets/Badge/glance-43@2x.png
similarity index 100%
rename from Lister/Objective-C/Lister Watch App/Assets/Badge/glance-43@2x.png
rename to Lister/Lister Watch App/Assets/Badge/glance-43@2x.png
diff --git a/Lister/Objective-C/Lister Watch App/Assets/Badge/glance-44@2x.png b/Lister/Lister Watch App/Assets/Badge/glance-44@2x.png
similarity index 100%
rename from Lister/Objective-C/Lister Watch App/Assets/Badge/glance-44@2x.png
rename to Lister/Lister Watch App/Assets/Badge/glance-44@2x.png
diff --git a/Lister/Objective-C/Lister Watch App/Assets/Badge/glance-4@2x.png b/Lister/Lister Watch App/Assets/Badge/glance-4@2x.png
similarity index 100%
rename from Lister/Objective-C/Lister Watch App/Assets/Badge/glance-4@2x.png
rename to Lister/Lister Watch App/Assets/Badge/glance-4@2x.png
diff --git a/Lister/Objective-C/Lister Watch App/Assets/Badge/glance-5@2x.png b/Lister/Lister Watch App/Assets/Badge/glance-5@2x.png
similarity index 100%
rename from Lister/Objective-C/Lister Watch App/Assets/Badge/glance-5@2x.png
rename to Lister/Lister Watch App/Assets/Badge/glance-5@2x.png
diff --git a/Lister/Objective-C/Lister Watch App/Assets/Badge/glance-6@2x.png b/Lister/Lister Watch App/Assets/Badge/glance-6@2x.png
similarity index 100%
rename from Lister/Objective-C/Lister Watch App/Assets/Badge/glance-6@2x.png
rename to Lister/Lister Watch App/Assets/Badge/glance-6@2x.png
diff --git a/Lister/Objective-C/Lister Watch App/Assets/Badge/glance-7@2x.png b/Lister/Lister Watch App/Assets/Badge/glance-7@2x.png
similarity index 100%
rename from Lister/Objective-C/Lister Watch App/Assets/Badge/glance-7@2x.png
rename to Lister/Lister Watch App/Assets/Badge/glance-7@2x.png
diff --git a/Lister/Objective-C/Lister Watch App/Assets/Badge/glance-8@2x.png b/Lister/Lister Watch App/Assets/Badge/glance-8@2x.png
similarity index 100%
rename from Lister/Objective-C/Lister Watch App/Assets/Badge/glance-8@2x.png
rename to Lister/Lister Watch App/Assets/Badge/glance-8@2x.png
diff --git a/Lister/Objective-C/Lister Watch App/Assets/Badge/glance-9@2x.png b/Lister/Lister Watch App/Assets/Badge/glance-9@2x.png
similarity index 100%
rename from Lister/Objective-C/Lister Watch App/Assets/Badge/glance-9@2x.png
rename to Lister/Lister Watch App/Assets/Badge/glance-9@2x.png
diff --git a/Lister/Objective-C/Lister Watch App/Assets/CheckBox/checkbox-blue-checked@2x.png b/Lister/Lister Watch App/Assets/CheckBox/checkbox-blue-checked@2x.png
similarity index 100%
rename from Lister/Objective-C/Lister Watch App/Assets/CheckBox/checkbox-blue-checked@2x.png
rename to Lister/Lister Watch App/Assets/CheckBox/checkbox-blue-checked@2x.png
diff --git a/Lister/Objective-C/Lister Watch App/Assets/CheckBox/checkbox-blue-unchecked@2x.png b/Lister/Lister Watch App/Assets/CheckBox/checkbox-blue-unchecked@2x.png
similarity index 100%
rename from Lister/Objective-C/Lister Watch App/Assets/CheckBox/checkbox-blue-unchecked@2x.png
rename to Lister/Lister Watch App/Assets/CheckBox/checkbox-blue-unchecked@2x.png
diff --git a/Lister/Objective-C/Lister Watch App/Assets/CheckBox/checkbox-gray-checked@2x.png b/Lister/Lister Watch App/Assets/CheckBox/checkbox-gray-checked@2x.png
similarity index 100%
rename from Lister/Objective-C/Lister Watch App/Assets/CheckBox/checkbox-gray-checked@2x.png
rename to Lister/Lister Watch App/Assets/CheckBox/checkbox-gray-checked@2x.png
diff --git a/Lister/Objective-C/Lister Watch App/Assets/CheckBox/checkbox-gray-unchecked@2x.png b/Lister/Lister Watch App/Assets/CheckBox/checkbox-gray-unchecked@2x.png
similarity index 100%
rename from Lister/Objective-C/Lister Watch App/Assets/CheckBox/checkbox-gray-unchecked@2x.png
rename to Lister/Lister Watch App/Assets/CheckBox/checkbox-gray-unchecked@2x.png
diff --git a/Lister/Objective-C/Lister Watch App/Assets/CheckBox/checkbox-green-checked@2x.png b/Lister/Lister Watch App/Assets/CheckBox/checkbox-green-checked@2x.png
similarity index 100%
rename from Lister/Objective-C/Lister Watch App/Assets/CheckBox/checkbox-green-checked@2x.png
rename to Lister/Lister Watch App/Assets/CheckBox/checkbox-green-checked@2x.png
diff --git a/Lister/Objective-C/Lister Watch App/Assets/CheckBox/checkbox-green-unchecked@2x.png b/Lister/Lister Watch App/Assets/CheckBox/checkbox-green-unchecked@2x.png
similarity index 100%
rename from Lister/Objective-C/Lister Watch App/Assets/CheckBox/checkbox-green-unchecked@2x.png
rename to Lister/Lister Watch App/Assets/CheckBox/checkbox-green-unchecked@2x.png
diff --git a/Lister/Objective-C/Lister Watch App/Assets/CheckBox/checkbox-orange-checked@2x.png b/Lister/Lister Watch App/Assets/CheckBox/checkbox-orange-checked@2x.png
similarity index 100%
rename from Lister/Objective-C/Lister Watch App/Assets/CheckBox/checkbox-orange-checked@2x.png
rename to Lister/Lister Watch App/Assets/CheckBox/checkbox-orange-checked@2x.png
diff --git a/Lister/Objective-C/Lister Watch App/Assets/CheckBox/checkbox-orange-unchecked@2x.png b/Lister/Lister Watch App/Assets/CheckBox/checkbox-orange-unchecked@2x.png
similarity index 100%
rename from Lister/Objective-C/Lister Watch App/Assets/CheckBox/checkbox-orange-unchecked@2x.png
rename to Lister/Lister Watch App/Assets/CheckBox/checkbox-orange-unchecked@2x.png
diff --git a/Lister/Objective-C/Lister Watch App/Assets/CheckBox/checkbox-red-checked@2x.png b/Lister/Lister Watch App/Assets/CheckBox/checkbox-red-checked@2x.png
similarity index 100%
rename from Lister/Objective-C/Lister Watch App/Assets/CheckBox/checkbox-red-checked@2x.png
rename to Lister/Lister Watch App/Assets/CheckBox/checkbox-red-checked@2x.png
diff --git a/Lister/Objective-C/Lister Watch App/Assets/CheckBox/checkbox-red-unchecked@2x.png b/Lister/Lister Watch App/Assets/CheckBox/checkbox-red-unchecked@2x.png
similarity index 100%
rename from Lister/Objective-C/Lister Watch App/Assets/CheckBox/checkbox-red-unchecked@2x.png
rename to Lister/Lister Watch App/Assets/CheckBox/checkbox-red-unchecked@2x.png
diff --git a/Lister/Objective-C/Lister Watch App/Assets/CheckBox/checkbox-yellow-checked@2x.png b/Lister/Lister Watch App/Assets/CheckBox/checkbox-yellow-checked@2x.png
similarity index 100%
rename from Lister/Objective-C/Lister Watch App/Assets/CheckBox/checkbox-yellow-checked@2x.png
rename to Lister/Lister Watch App/Assets/CheckBox/checkbox-yellow-checked@2x.png
diff --git a/Lister/Objective-C/Lister Watch App/Assets/CheckBox/checkbox-yellow-unchecked@2x.png b/Lister/Lister Watch App/Assets/CheckBox/checkbox-yellow-unchecked@2x.png
similarity index 100%
rename from Lister/Objective-C/Lister Watch App/Assets/CheckBox/checkbox-yellow-unchecked@2x.png
rename to Lister/Lister Watch App/Assets/CheckBox/checkbox-yellow-unchecked@2x.png
diff --git a/Lister/Objective-C/Lister Watch App/Assets/Menus/check-all@2x.png b/Lister/Lister Watch App/Assets/Menus/check-all@2x.png
similarity index 100%
rename from Lister/Objective-C/Lister Watch App/Assets/Menus/check-all@2x.png
rename to Lister/Lister Watch App/Assets/Menus/check-all@2x.png
diff --git a/Lister/Objective-C/Lister Watch App/Assets/Menus/uncheck-all@2x.png b/Lister/Lister Watch App/Assets/Menus/uncheck-all@2x.png
similarity index 100%
rename from Lister/Objective-C/Lister Watch App/Assets/Menus/uncheck-all@2x.png
rename to Lister/Lister Watch App/Assets/Menus/uncheck-all@2x.png
diff --git a/Lister/Swift/Lister Watch App/Base.lproj/Interface.storyboard b/Lister/Lister Watch App/Base.lproj/Interface.storyboard
similarity index 100%
rename from Lister/Swift/Lister Watch App/Base.lproj/Interface.storyboard
rename to Lister/Lister Watch App/Base.lproj/Interface.storyboard
diff --git a/Lister/Objective-C/Lister WatchKit App/Images.xcassets/AppIcon.appiconset/Contents.json b/Lister/Lister Watch App/Images.xcassets/AppIcon.appiconset/Contents.json
similarity index 100%
rename from Lister/Objective-C/Lister WatchKit App/Images.xcassets/AppIcon.appiconset/Contents.json
rename to Lister/Lister Watch App/Images.xcassets/AppIcon.appiconset/Contents.json
diff --git a/Lister/Objective-C/Lister Watch App/Images.xcassets/AppIcon.appiconset/Lister172.png b/Lister/Lister Watch App/Images.xcassets/AppIcon.appiconset/Lister172.png
similarity index 100%
rename from Lister/Objective-C/Lister Watch App/Images.xcassets/AppIcon.appiconset/Lister172.png
rename to Lister/Lister Watch App/Images.xcassets/AppIcon.appiconset/Lister172.png
diff --git a/Lister/Objective-C/Lister Watch App/Images.xcassets/AppIcon.appiconset/Lister196.png b/Lister/Lister Watch App/Images.xcassets/AppIcon.appiconset/Lister196.png
similarity index 100%
rename from Lister/Objective-C/Lister Watch App/Images.xcassets/AppIcon.appiconset/Lister196.png
rename to Lister/Lister Watch App/Images.xcassets/AppIcon.appiconset/Lister196.png
diff --git a/Lister/Objective-C/Lister Watch App/Images.xcassets/AppIcon.appiconset/Lister58.png b/Lister/Lister Watch App/Images.xcassets/AppIcon.appiconset/Lister58.png
similarity index 100%
rename from Lister/Objective-C/Lister Watch App/Images.xcassets/AppIcon.appiconset/Lister58.png
rename to Lister/Lister Watch App/Images.xcassets/AppIcon.appiconset/Lister58.png
diff --git a/Lister/Objective-C/Lister Watch App/Images.xcassets/AppIcon.appiconset/Lister80.png b/Lister/Lister Watch App/Images.xcassets/AppIcon.appiconset/Lister80.png
similarity index 100%
rename from Lister/Objective-C/Lister Watch App/Images.xcassets/AppIcon.appiconset/Lister80.png
rename to Lister/Lister Watch App/Images.xcassets/AppIcon.appiconset/Lister80.png
diff --git a/Lister/Objective-C/Lister Watch App/Images.xcassets/AppIcon.appiconset/Lister87.png b/Lister/Lister Watch App/Images.xcassets/AppIcon.appiconset/Lister87.png
similarity index 100%
rename from Lister/Objective-C/Lister Watch App/Images.xcassets/AppIcon.appiconset/Lister87.png
rename to Lister/Lister Watch App/Images.xcassets/AppIcon.appiconset/Lister87.png
diff --git a/Lister/Swift/Lister Watch App/Info.plist b/Lister/Lister Watch App/Info.plist
similarity index 97%
rename from Lister/Swift/Lister Watch App/Info.plist
rename to Lister/Lister Watch App/Info.plist
index be9f57d5..2342ca13 100644
--- a/Lister/Swift/Lister Watch App/Info.plist
+++ b/Lister/Lister Watch App/Info.plist
@@ -17,7 +17,7 @@
CFBundlePackageTypeAPPLCFBundleShortVersionString
- 2.0
+ 3.1CFBundleSignature????CFBundleVersion
diff --git a/Lister/Swift/Lister Watch Extension/ExtensionDelegate.swift b/Lister/Lister Watch Extension/ExtensionDelegate.swift
similarity index 93%
rename from Lister/Swift/Lister Watch Extension/ExtensionDelegate.swift
rename to Lister/Lister Watch Extension/ExtensionDelegate.swift
index 2973aa49..c2e9b933 100644
--- a/Lister/Swift/Lister Watch Extension/ExtensionDelegate.swift
+++ b/Lister/Lister Watch Extension/ExtensionDelegate.swift
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2015 Apple Inc. All Rights Reserved.
+ Copyright (C) 2016 Apple Inc. All Rights Reserved.
See LICENSE.txt for this sample’s licensing information
Abstract:
diff --git a/Lister/Swift/Lister Watch Extension/Glance/GlanceInterfaceController.swift b/Lister/Lister Watch Extension/Glance/GlanceInterfaceController.swift
similarity index 99%
rename from Lister/Swift/Lister Watch Extension/Glance/GlanceInterfaceController.swift
rename to Lister/Lister Watch Extension/Glance/GlanceInterfaceController.swift
index d8aad1c7..6beaa438 100644
--- a/Lister/Swift/Lister Watch Extension/Glance/GlanceInterfaceController.swift
+++ b/Lister/Lister Watch Extension/Glance/GlanceInterfaceController.swift
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2015 Apple Inc. All Rights Reserved.
+ Copyright (C) 2016 Apple Inc. All Rights Reserved.
See LICENSE.txt for this sample’s licensing information
Abstract:
@@ -7,7 +7,7 @@
*/
import WatchKit
-import ListerKit
+import ListerWatchKit
class GlanceInterfaceController: WKInterfaceController, ConnectivityListsControllerDelegate, ListPresenterDelegate, NSFilePresenter {
// MARK: Properties
diff --git a/Lister/Swift/Lister Watch Extension/Info.plist b/Lister/Lister Watch Extension/Info.plist
similarity index 93%
rename from Lister/Swift/Lister Watch Extension/Info.plist
rename to Lister/Lister Watch Extension/Info.plist
index 4b871167..9b373120 100644
--- a/Lister/Swift/Lister Watch Extension/Info.plist
+++ b/Lister/Lister Watch Extension/Info.plist
@@ -19,7 +19,7 @@
CFBundlePackageTypeXPC!CFBundleShortVersionString
- 2.0
+ 3.1CFBundleSignature????CFBundleVersion
@@ -29,7 +29,7 @@
NSExtensionAttributesWKAppBundleIdentifier
- ${LISTER_BUNDLE_PREFIX}.Lister.nativewatchkitapp
+ ${LISTER_BUNDLE_PREFIX}.Lister.watchkitappNSExtensionPointIdentifiercom.apple.watchkit
diff --git a/Lister/Swift/Lister Watch Extension/ListInterfaceController.swift b/Lister/Lister Watch Extension/ListInterfaceController.swift
similarity index 96%
rename from Lister/Swift/Lister Watch Extension/ListInterfaceController.swift
rename to Lister/Lister Watch Extension/ListInterfaceController.swift
index 315108aa..09b1c79b 100644
--- a/Lister/Swift/Lister Watch Extension/ListInterfaceController.swift
+++ b/Lister/Lister Watch Extension/ListInterfaceController.swift
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2015 Apple Inc. All Rights Reserved.
+ Copyright (C) 2016 Apple Inc. All Rights Reserved.
See LICENSE.txt for this sample’s licensing information
Abstract:
@@ -8,7 +8,7 @@
import WatchKit
import WatchConnectivity
-import ListerKit
+import ListerWatchKit
/**
The interface controller that presents a list. The interface controller listens for changes to how the list
@@ -233,6 +233,9 @@ class ListInterfaceController: WKInterfaceController, ListPresenterDelegate, NSF
let session = WCSession.defaultSession()
+ // Do not proceed if `session` is not currently `.Activated`.
+ guard session.activationState == .Activated else { return }
+
for transfer in session.outstandingFileTransfers {
if transfer.file.fileURL == self.presentedItemURL! {
transfer.cancel()
@@ -263,6 +266,10 @@ class ListInterfaceController: WKInterfaceController, ListPresenterDelegate, NSF
setupInterfaceTable()
}
+ override func willActivate() {
+ addFilePresenterIfNeeded()
+ }
+
override func didDeactivate() {
saveUnsavedChangesWithCompletionHandler { _ in
self.removeFilePresenterIfNeeded()
diff --git a/Lister/Swift/Lister Watch Extension/ListsInterfaceController.swift b/Lister/Lister Watch Extension/ListsInterfaceController.swift
similarity index 91%
rename from Lister/Swift/Lister Watch Extension/ListsInterfaceController.swift
rename to Lister/Lister Watch Extension/ListsInterfaceController.swift
index 0b7b67ac..9a6ff66e 100644
--- a/Lister/Swift/Lister Watch Extension/ListsInterfaceController.swift
+++ b/Lister/Lister Watch Extension/ListsInterfaceController.swift
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2015 Apple Inc. All Rights Reserved.
+ Copyright (C) 2016 Apple Inc. All Rights Reserved.
See LICENSE.txt for this sample’s licensing information
Abstract:
@@ -7,7 +7,7 @@
*/
import WatchKit
-import ListerKit
+import ListerWatchKit
class ListsInterfaceController: WKInterfaceController, ConnectivityListsControllerDelegate {
// MARK: Types
@@ -83,12 +83,12 @@ class ListsInterfaceController: WKInterfaceController, ConnectivityListsControll
// MARK: Convenience
func configureRowControllerAtIndex(index: Int) {
- let ListRowController = interfaceTable.rowControllerAtIndex(index) as! ColoredTextRowController
+ let listRowController = interfaceTable.rowControllerAtIndex(index) as! ColoredTextRowController
let listInfo = listsController[index]
- ListRowController.setColor(listInfo.color.colorValue)
- ListRowController.setText(listInfo.name)
+ listRowController.setColor(listInfo.color.colorValue)
+ listRowController.setText(listInfo.name)
}
// MARK: Interface Life Cycle
@@ -117,7 +117,8 @@ class ListsInterfaceController: WKInterfaceController, ConnectivityListsControll
let color = List.Color(rawValue: rawColor) else { return }
// Create a `ListInfo` that represents the list at `listInfoURL`.
- let name = listInfoFilePath.lastPathComponent.stringByDeletingPathExtension
+ let lastPathComponent = (listInfoFilePath as NSString).lastPathComponent
+ let name = (lastPathComponent as NSString).stringByDeletingPathExtension
let listInfo = ListInfo(name: name, color: color)
// Present a `ListInterfaceController`.
diff --git a/Lister/Objective-C/Lister Watch Extension/Localizable.strings b/Lister/Lister Watch Extension/Localizable.strings
similarity index 100%
rename from Lister/Objective-C/Lister Watch Extension/Localizable.strings
rename to Lister/Lister Watch Extension/Localizable.strings
diff --git a/Lister/Swift/Lister Watch Extension/Localizable.stringsdict b/Lister/Lister Watch Extension/Localizable.stringsdict
similarity index 100%
rename from Lister/Swift/Lister Watch Extension/Localizable.stringsdict
rename to Lister/Lister Watch Extension/Localizable.stringsdict
diff --git a/Lister/Objective-C/Lister WatchKit App/Assets/Badge/glance-0@2x.png b/Lister/Lister WatchKit App/Assets/Badge/glance-0@2x.png
similarity index 100%
rename from Lister/Objective-C/Lister WatchKit App/Assets/Badge/glance-0@2x.png
rename to Lister/Lister WatchKit App/Assets/Badge/glance-0@2x.png
diff --git a/Lister/Objective-C/Lister WatchKit App/Assets/Badge/glance-10@2x.png b/Lister/Lister WatchKit App/Assets/Badge/glance-10@2x.png
similarity index 100%
rename from Lister/Objective-C/Lister WatchKit App/Assets/Badge/glance-10@2x.png
rename to Lister/Lister WatchKit App/Assets/Badge/glance-10@2x.png
diff --git a/Lister/Objective-C/Lister WatchKit App/Assets/Badge/glance-11@2x.png b/Lister/Lister WatchKit App/Assets/Badge/glance-11@2x.png
similarity index 100%
rename from Lister/Objective-C/Lister WatchKit App/Assets/Badge/glance-11@2x.png
rename to Lister/Lister WatchKit App/Assets/Badge/glance-11@2x.png
diff --git a/Lister/Objective-C/Lister WatchKit App/Assets/Badge/glance-12@2x.png b/Lister/Lister WatchKit App/Assets/Badge/glance-12@2x.png
similarity index 100%
rename from Lister/Objective-C/Lister WatchKit App/Assets/Badge/glance-12@2x.png
rename to Lister/Lister WatchKit App/Assets/Badge/glance-12@2x.png
diff --git a/Lister/Objective-C/Lister WatchKit App/Assets/Badge/glance-13@2x.png b/Lister/Lister WatchKit App/Assets/Badge/glance-13@2x.png
similarity index 100%
rename from Lister/Objective-C/Lister WatchKit App/Assets/Badge/glance-13@2x.png
rename to Lister/Lister WatchKit App/Assets/Badge/glance-13@2x.png
diff --git a/Lister/Objective-C/Lister WatchKit App/Assets/Badge/glance-14@2x.png b/Lister/Lister WatchKit App/Assets/Badge/glance-14@2x.png
similarity index 100%
rename from Lister/Objective-C/Lister WatchKit App/Assets/Badge/glance-14@2x.png
rename to Lister/Lister WatchKit App/Assets/Badge/glance-14@2x.png
diff --git a/Lister/Objective-C/Lister WatchKit App/Assets/Badge/glance-15@2x.png b/Lister/Lister WatchKit App/Assets/Badge/glance-15@2x.png
similarity index 100%
rename from Lister/Objective-C/Lister WatchKit App/Assets/Badge/glance-15@2x.png
rename to Lister/Lister WatchKit App/Assets/Badge/glance-15@2x.png
diff --git a/Lister/Objective-C/Lister WatchKit App/Assets/Badge/glance-16@2x.png b/Lister/Lister WatchKit App/Assets/Badge/glance-16@2x.png
similarity index 100%
rename from Lister/Objective-C/Lister WatchKit App/Assets/Badge/glance-16@2x.png
rename to Lister/Lister WatchKit App/Assets/Badge/glance-16@2x.png
diff --git a/Lister/Objective-C/Lister WatchKit App/Assets/Badge/glance-17@2x.png b/Lister/Lister WatchKit App/Assets/Badge/glance-17@2x.png
similarity index 100%
rename from Lister/Objective-C/Lister WatchKit App/Assets/Badge/glance-17@2x.png
rename to Lister/Lister WatchKit App/Assets/Badge/glance-17@2x.png
diff --git a/Lister/Objective-C/Lister WatchKit App/Assets/Badge/glance-18@2x.png b/Lister/Lister WatchKit App/Assets/Badge/glance-18@2x.png
similarity index 100%
rename from Lister/Objective-C/Lister WatchKit App/Assets/Badge/glance-18@2x.png
rename to Lister/Lister WatchKit App/Assets/Badge/glance-18@2x.png
diff --git a/Lister/Objective-C/Lister WatchKit App/Assets/Badge/glance-19@2x.png b/Lister/Lister WatchKit App/Assets/Badge/glance-19@2x.png
similarity index 100%
rename from Lister/Objective-C/Lister WatchKit App/Assets/Badge/glance-19@2x.png
rename to Lister/Lister WatchKit App/Assets/Badge/glance-19@2x.png
diff --git a/Lister/Objective-C/Lister WatchKit App/Assets/Badge/glance-1@2x.png b/Lister/Lister WatchKit App/Assets/Badge/glance-1@2x.png
similarity index 100%
rename from Lister/Objective-C/Lister WatchKit App/Assets/Badge/glance-1@2x.png
rename to Lister/Lister WatchKit App/Assets/Badge/glance-1@2x.png
diff --git a/Lister/Objective-C/Lister WatchKit App/Assets/Badge/glance-20@2x.png b/Lister/Lister WatchKit App/Assets/Badge/glance-20@2x.png
similarity index 100%
rename from Lister/Objective-C/Lister WatchKit App/Assets/Badge/glance-20@2x.png
rename to Lister/Lister WatchKit App/Assets/Badge/glance-20@2x.png
diff --git a/Lister/Objective-C/Lister WatchKit App/Assets/Badge/glance-21@2x.png b/Lister/Lister WatchKit App/Assets/Badge/glance-21@2x.png
similarity index 100%
rename from Lister/Objective-C/Lister WatchKit App/Assets/Badge/glance-21@2x.png
rename to Lister/Lister WatchKit App/Assets/Badge/glance-21@2x.png
diff --git a/Lister/Objective-C/Lister WatchKit App/Assets/Badge/glance-22@2x.png b/Lister/Lister WatchKit App/Assets/Badge/glance-22@2x.png
similarity index 100%
rename from Lister/Objective-C/Lister WatchKit App/Assets/Badge/glance-22@2x.png
rename to Lister/Lister WatchKit App/Assets/Badge/glance-22@2x.png
diff --git a/Lister/Objective-C/Lister WatchKit App/Assets/Badge/glance-23@2x.png b/Lister/Lister WatchKit App/Assets/Badge/glance-23@2x.png
similarity index 100%
rename from Lister/Objective-C/Lister WatchKit App/Assets/Badge/glance-23@2x.png
rename to Lister/Lister WatchKit App/Assets/Badge/glance-23@2x.png
diff --git a/Lister/Objective-C/Lister WatchKit App/Assets/Badge/glance-24@2x.png b/Lister/Lister WatchKit App/Assets/Badge/glance-24@2x.png
similarity index 100%
rename from Lister/Objective-C/Lister WatchKit App/Assets/Badge/glance-24@2x.png
rename to Lister/Lister WatchKit App/Assets/Badge/glance-24@2x.png
diff --git a/Lister/Objective-C/Lister WatchKit App/Assets/Badge/glance-25@2x.png b/Lister/Lister WatchKit App/Assets/Badge/glance-25@2x.png
similarity index 100%
rename from Lister/Objective-C/Lister WatchKit App/Assets/Badge/glance-25@2x.png
rename to Lister/Lister WatchKit App/Assets/Badge/glance-25@2x.png
diff --git a/Lister/Objective-C/Lister WatchKit App/Assets/Badge/glance-26@2x.png b/Lister/Lister WatchKit App/Assets/Badge/glance-26@2x.png
similarity index 100%
rename from Lister/Objective-C/Lister WatchKit App/Assets/Badge/glance-26@2x.png
rename to Lister/Lister WatchKit App/Assets/Badge/glance-26@2x.png
diff --git a/Lister/Objective-C/Lister WatchKit App/Assets/Badge/glance-27@2x.png b/Lister/Lister WatchKit App/Assets/Badge/glance-27@2x.png
similarity index 100%
rename from Lister/Objective-C/Lister WatchKit App/Assets/Badge/glance-27@2x.png
rename to Lister/Lister WatchKit App/Assets/Badge/glance-27@2x.png
diff --git a/Lister/Objective-C/Lister WatchKit App/Assets/Badge/glance-28@2x.png b/Lister/Lister WatchKit App/Assets/Badge/glance-28@2x.png
similarity index 100%
rename from Lister/Objective-C/Lister WatchKit App/Assets/Badge/glance-28@2x.png
rename to Lister/Lister WatchKit App/Assets/Badge/glance-28@2x.png
diff --git a/Lister/Objective-C/Lister WatchKit App/Assets/Badge/glance-29@2x.png b/Lister/Lister WatchKit App/Assets/Badge/glance-29@2x.png
similarity index 100%
rename from Lister/Objective-C/Lister WatchKit App/Assets/Badge/glance-29@2x.png
rename to Lister/Lister WatchKit App/Assets/Badge/glance-29@2x.png
diff --git a/Lister/Objective-C/Lister WatchKit App/Assets/Badge/glance-2@2x.png b/Lister/Lister WatchKit App/Assets/Badge/glance-2@2x.png
similarity index 100%
rename from Lister/Objective-C/Lister WatchKit App/Assets/Badge/glance-2@2x.png
rename to Lister/Lister WatchKit App/Assets/Badge/glance-2@2x.png
diff --git a/Lister/Objective-C/Lister WatchKit App/Assets/Badge/glance-30@2x.png b/Lister/Lister WatchKit App/Assets/Badge/glance-30@2x.png
similarity index 100%
rename from Lister/Objective-C/Lister WatchKit App/Assets/Badge/glance-30@2x.png
rename to Lister/Lister WatchKit App/Assets/Badge/glance-30@2x.png
diff --git a/Lister/Objective-C/Lister WatchKit App/Assets/Badge/glance-31@2x.png b/Lister/Lister WatchKit App/Assets/Badge/glance-31@2x.png
similarity index 100%
rename from Lister/Objective-C/Lister WatchKit App/Assets/Badge/glance-31@2x.png
rename to Lister/Lister WatchKit App/Assets/Badge/glance-31@2x.png
diff --git a/Lister/Objective-C/Lister WatchKit App/Assets/Badge/glance-32@2x.png b/Lister/Lister WatchKit App/Assets/Badge/glance-32@2x.png
similarity index 100%
rename from Lister/Objective-C/Lister WatchKit App/Assets/Badge/glance-32@2x.png
rename to Lister/Lister WatchKit App/Assets/Badge/glance-32@2x.png
diff --git a/Lister/Objective-C/Lister WatchKit App/Assets/Badge/glance-33@2x.png b/Lister/Lister WatchKit App/Assets/Badge/glance-33@2x.png
similarity index 100%
rename from Lister/Objective-C/Lister WatchKit App/Assets/Badge/glance-33@2x.png
rename to Lister/Lister WatchKit App/Assets/Badge/glance-33@2x.png
diff --git a/Lister/Objective-C/Lister WatchKit App/Assets/Badge/glance-34@2x.png b/Lister/Lister WatchKit App/Assets/Badge/glance-34@2x.png
similarity index 100%
rename from Lister/Objective-C/Lister WatchKit App/Assets/Badge/glance-34@2x.png
rename to Lister/Lister WatchKit App/Assets/Badge/glance-34@2x.png
diff --git a/Lister/Objective-C/Lister WatchKit App/Assets/Badge/glance-35@2x.png b/Lister/Lister WatchKit App/Assets/Badge/glance-35@2x.png
similarity index 100%
rename from Lister/Objective-C/Lister WatchKit App/Assets/Badge/glance-35@2x.png
rename to Lister/Lister WatchKit App/Assets/Badge/glance-35@2x.png
diff --git a/Lister/Objective-C/Lister WatchKit App/Assets/Badge/glance-36@2x.png b/Lister/Lister WatchKit App/Assets/Badge/glance-36@2x.png
similarity index 100%
rename from Lister/Objective-C/Lister WatchKit App/Assets/Badge/glance-36@2x.png
rename to Lister/Lister WatchKit App/Assets/Badge/glance-36@2x.png
diff --git a/Lister/Objective-C/Lister WatchKit App/Assets/Badge/glance-37@2x.png b/Lister/Lister WatchKit App/Assets/Badge/glance-37@2x.png
similarity index 100%
rename from Lister/Objective-C/Lister WatchKit App/Assets/Badge/glance-37@2x.png
rename to Lister/Lister WatchKit App/Assets/Badge/glance-37@2x.png
diff --git a/Lister/Objective-C/Lister WatchKit App/Assets/Badge/glance-38@2x.png b/Lister/Lister WatchKit App/Assets/Badge/glance-38@2x.png
similarity index 100%
rename from Lister/Objective-C/Lister WatchKit App/Assets/Badge/glance-38@2x.png
rename to Lister/Lister WatchKit App/Assets/Badge/glance-38@2x.png
diff --git a/Lister/Objective-C/Lister WatchKit App/Assets/Badge/glance-39@2x.png b/Lister/Lister WatchKit App/Assets/Badge/glance-39@2x.png
similarity index 100%
rename from Lister/Objective-C/Lister WatchKit App/Assets/Badge/glance-39@2x.png
rename to Lister/Lister WatchKit App/Assets/Badge/glance-39@2x.png
diff --git a/Lister/Objective-C/Lister WatchKit App/Assets/Badge/glance-3@2x.png b/Lister/Lister WatchKit App/Assets/Badge/glance-3@2x.png
similarity index 100%
rename from Lister/Objective-C/Lister WatchKit App/Assets/Badge/glance-3@2x.png
rename to Lister/Lister WatchKit App/Assets/Badge/glance-3@2x.png
diff --git a/Lister/Objective-C/Lister WatchKit App/Assets/Badge/glance-40@2x.png b/Lister/Lister WatchKit App/Assets/Badge/glance-40@2x.png
similarity index 100%
rename from Lister/Objective-C/Lister WatchKit App/Assets/Badge/glance-40@2x.png
rename to Lister/Lister WatchKit App/Assets/Badge/glance-40@2x.png
diff --git a/Lister/Objective-C/Lister WatchKit App/Assets/Badge/glance-41@2x.png b/Lister/Lister WatchKit App/Assets/Badge/glance-41@2x.png
similarity index 100%
rename from Lister/Objective-C/Lister WatchKit App/Assets/Badge/glance-41@2x.png
rename to Lister/Lister WatchKit App/Assets/Badge/glance-41@2x.png
diff --git a/Lister/Objective-C/Lister WatchKit App/Assets/Badge/glance-42@2x.png b/Lister/Lister WatchKit App/Assets/Badge/glance-42@2x.png
similarity index 100%
rename from Lister/Objective-C/Lister WatchKit App/Assets/Badge/glance-42@2x.png
rename to Lister/Lister WatchKit App/Assets/Badge/glance-42@2x.png
diff --git a/Lister/Objective-C/Lister WatchKit App/Assets/Badge/glance-43@2x.png b/Lister/Lister WatchKit App/Assets/Badge/glance-43@2x.png
similarity index 100%
rename from Lister/Objective-C/Lister WatchKit App/Assets/Badge/glance-43@2x.png
rename to Lister/Lister WatchKit App/Assets/Badge/glance-43@2x.png
diff --git a/Lister/Objective-C/Lister WatchKit App/Assets/Badge/glance-44@2x.png b/Lister/Lister WatchKit App/Assets/Badge/glance-44@2x.png
similarity index 100%
rename from Lister/Objective-C/Lister WatchKit App/Assets/Badge/glance-44@2x.png
rename to Lister/Lister WatchKit App/Assets/Badge/glance-44@2x.png
diff --git a/Lister/Objective-C/Lister WatchKit App/Assets/Badge/glance-4@2x.png b/Lister/Lister WatchKit App/Assets/Badge/glance-4@2x.png
similarity index 100%
rename from Lister/Objective-C/Lister WatchKit App/Assets/Badge/glance-4@2x.png
rename to Lister/Lister WatchKit App/Assets/Badge/glance-4@2x.png
diff --git a/Lister/Objective-C/Lister WatchKit App/Assets/Badge/glance-5@2x.png b/Lister/Lister WatchKit App/Assets/Badge/glance-5@2x.png
similarity index 100%
rename from Lister/Objective-C/Lister WatchKit App/Assets/Badge/glance-5@2x.png
rename to Lister/Lister WatchKit App/Assets/Badge/glance-5@2x.png
diff --git a/Lister/Objective-C/Lister WatchKit App/Assets/Badge/glance-6@2x.png b/Lister/Lister WatchKit App/Assets/Badge/glance-6@2x.png
similarity index 100%
rename from Lister/Objective-C/Lister WatchKit App/Assets/Badge/glance-6@2x.png
rename to Lister/Lister WatchKit App/Assets/Badge/glance-6@2x.png
diff --git a/Lister/Objective-C/Lister WatchKit App/Assets/Badge/glance-7@2x.png b/Lister/Lister WatchKit App/Assets/Badge/glance-7@2x.png
similarity index 100%
rename from Lister/Objective-C/Lister WatchKit App/Assets/Badge/glance-7@2x.png
rename to Lister/Lister WatchKit App/Assets/Badge/glance-7@2x.png
diff --git a/Lister/Objective-C/Lister WatchKit App/Assets/Badge/glance-8@2x.png b/Lister/Lister WatchKit App/Assets/Badge/glance-8@2x.png
similarity index 100%
rename from Lister/Objective-C/Lister WatchKit App/Assets/Badge/glance-8@2x.png
rename to Lister/Lister WatchKit App/Assets/Badge/glance-8@2x.png
diff --git a/Lister/Objective-C/Lister WatchKit App/Assets/Badge/glance-9@2x.png b/Lister/Lister WatchKit App/Assets/Badge/glance-9@2x.png
similarity index 100%
rename from Lister/Objective-C/Lister WatchKit App/Assets/Badge/glance-9@2x.png
rename to Lister/Lister WatchKit App/Assets/Badge/glance-9@2x.png
diff --git a/Lister/Objective-C/Lister WatchKit App/Assets/CheckBox/checkbox-blue-checked@2x.png b/Lister/Lister WatchKit App/Assets/CheckBox/checkbox-blue-checked@2x.png
similarity index 100%
rename from Lister/Objective-C/Lister WatchKit App/Assets/CheckBox/checkbox-blue-checked@2x.png
rename to Lister/Lister WatchKit App/Assets/CheckBox/checkbox-blue-checked@2x.png
diff --git a/Lister/Objective-C/Lister WatchKit App/Assets/CheckBox/checkbox-blue-unchecked@2x.png b/Lister/Lister WatchKit App/Assets/CheckBox/checkbox-blue-unchecked@2x.png
similarity index 100%
rename from Lister/Objective-C/Lister WatchKit App/Assets/CheckBox/checkbox-blue-unchecked@2x.png
rename to Lister/Lister WatchKit App/Assets/CheckBox/checkbox-blue-unchecked@2x.png
diff --git a/Lister/Objective-C/Lister WatchKit App/Assets/CheckBox/checkbox-gray-checked@2x.png b/Lister/Lister WatchKit App/Assets/CheckBox/checkbox-gray-checked@2x.png
similarity index 100%
rename from Lister/Objective-C/Lister WatchKit App/Assets/CheckBox/checkbox-gray-checked@2x.png
rename to Lister/Lister WatchKit App/Assets/CheckBox/checkbox-gray-checked@2x.png
diff --git a/Lister/Objective-C/Lister WatchKit App/Assets/CheckBox/checkbox-gray-unchecked@2x.png b/Lister/Lister WatchKit App/Assets/CheckBox/checkbox-gray-unchecked@2x.png
similarity index 100%
rename from Lister/Objective-C/Lister WatchKit App/Assets/CheckBox/checkbox-gray-unchecked@2x.png
rename to Lister/Lister WatchKit App/Assets/CheckBox/checkbox-gray-unchecked@2x.png
diff --git a/Lister/Objective-C/Lister WatchKit App/Assets/CheckBox/checkbox-green-checked@2x.png b/Lister/Lister WatchKit App/Assets/CheckBox/checkbox-green-checked@2x.png
similarity index 100%
rename from Lister/Objective-C/Lister WatchKit App/Assets/CheckBox/checkbox-green-checked@2x.png
rename to Lister/Lister WatchKit App/Assets/CheckBox/checkbox-green-checked@2x.png
diff --git a/Lister/Objective-C/Lister WatchKit App/Assets/CheckBox/checkbox-green-unchecked@2x.png b/Lister/Lister WatchKit App/Assets/CheckBox/checkbox-green-unchecked@2x.png
similarity index 100%
rename from Lister/Objective-C/Lister WatchKit App/Assets/CheckBox/checkbox-green-unchecked@2x.png
rename to Lister/Lister WatchKit App/Assets/CheckBox/checkbox-green-unchecked@2x.png
diff --git a/Lister/Objective-C/Lister WatchKit App/Assets/CheckBox/checkbox-orange-checked@2x.png b/Lister/Lister WatchKit App/Assets/CheckBox/checkbox-orange-checked@2x.png
similarity index 100%
rename from Lister/Objective-C/Lister WatchKit App/Assets/CheckBox/checkbox-orange-checked@2x.png
rename to Lister/Lister WatchKit App/Assets/CheckBox/checkbox-orange-checked@2x.png
diff --git a/Lister/Objective-C/Lister WatchKit App/Assets/CheckBox/checkbox-orange-unchecked@2x.png b/Lister/Lister WatchKit App/Assets/CheckBox/checkbox-orange-unchecked@2x.png
similarity index 100%
rename from Lister/Objective-C/Lister WatchKit App/Assets/CheckBox/checkbox-orange-unchecked@2x.png
rename to Lister/Lister WatchKit App/Assets/CheckBox/checkbox-orange-unchecked@2x.png
diff --git a/Lister/Objective-C/Lister WatchKit App/Assets/CheckBox/checkbox-red-checked@2x.png b/Lister/Lister WatchKit App/Assets/CheckBox/checkbox-red-checked@2x.png
similarity index 100%
rename from Lister/Objective-C/Lister WatchKit App/Assets/CheckBox/checkbox-red-checked@2x.png
rename to Lister/Lister WatchKit App/Assets/CheckBox/checkbox-red-checked@2x.png
diff --git a/Lister/Objective-C/Lister WatchKit App/Assets/CheckBox/checkbox-red-unchecked@2x.png b/Lister/Lister WatchKit App/Assets/CheckBox/checkbox-red-unchecked@2x.png
similarity index 100%
rename from Lister/Objective-C/Lister WatchKit App/Assets/CheckBox/checkbox-red-unchecked@2x.png
rename to Lister/Lister WatchKit App/Assets/CheckBox/checkbox-red-unchecked@2x.png
diff --git a/Lister/Objective-C/Lister WatchKit App/Assets/CheckBox/checkbox-yellow-checked@2x.png b/Lister/Lister WatchKit App/Assets/CheckBox/checkbox-yellow-checked@2x.png
similarity index 100%
rename from Lister/Objective-C/Lister WatchKit App/Assets/CheckBox/checkbox-yellow-checked@2x.png
rename to Lister/Lister WatchKit App/Assets/CheckBox/checkbox-yellow-checked@2x.png
diff --git a/Lister/Objective-C/Lister WatchKit App/Assets/CheckBox/checkbox-yellow-unchecked@2x.png b/Lister/Lister WatchKit App/Assets/CheckBox/checkbox-yellow-unchecked@2x.png
similarity index 100%
rename from Lister/Objective-C/Lister WatchKit App/Assets/CheckBox/checkbox-yellow-unchecked@2x.png
rename to Lister/Lister WatchKit App/Assets/CheckBox/checkbox-yellow-unchecked@2x.png
diff --git a/Lister/Objective-C/Lister WatchKit App/Assets/Menus/check-all@2x.png b/Lister/Lister WatchKit App/Assets/Menus/check-all@2x.png
similarity index 100%
rename from Lister/Objective-C/Lister WatchKit App/Assets/Menus/check-all@2x.png
rename to Lister/Lister WatchKit App/Assets/Menus/check-all@2x.png
diff --git a/Lister/Objective-C/Lister WatchKit App/Assets/Menus/uncheck-all@2x.png b/Lister/Lister WatchKit App/Assets/Menus/uncheck-all@2x.png
similarity index 100%
rename from Lister/Objective-C/Lister WatchKit App/Assets/Menus/uncheck-all@2x.png
rename to Lister/Lister WatchKit App/Assets/Menus/uncheck-all@2x.png
diff --git a/Lister/Swift/Lister WatchKit App/Base.lproj/Interface.storyboard b/Lister/Lister WatchKit App/Base.lproj/Interface.storyboard
similarity index 100%
rename from Lister/Swift/Lister WatchKit App/Base.lproj/Interface.storyboard
rename to Lister/Lister WatchKit App/Base.lproj/Interface.storyboard
diff --git a/Lister/Swift/Lister Watch App/Images.xcassets/AppIcon.appiconset/Contents.json b/Lister/Lister WatchKit App/Images.xcassets/AppIcon.appiconset/Contents.json
similarity index 100%
rename from Lister/Swift/Lister Watch App/Images.xcassets/AppIcon.appiconset/Contents.json
rename to Lister/Lister WatchKit App/Images.xcassets/AppIcon.appiconset/Contents.json
diff --git a/Lister/Objective-C/Lister WatchKit App/Images.xcassets/AppIcon.appiconset/Lister172.png b/Lister/Lister WatchKit App/Images.xcassets/AppIcon.appiconset/Lister172.png
similarity index 100%
rename from Lister/Objective-C/Lister WatchKit App/Images.xcassets/AppIcon.appiconset/Lister172.png
rename to Lister/Lister WatchKit App/Images.xcassets/AppIcon.appiconset/Lister172.png
diff --git a/Lister/Objective-C/Lister WatchKit App/Images.xcassets/AppIcon.appiconset/Lister196.png b/Lister/Lister WatchKit App/Images.xcassets/AppIcon.appiconset/Lister196.png
similarity index 100%
rename from Lister/Objective-C/Lister WatchKit App/Images.xcassets/AppIcon.appiconset/Lister196.png
rename to Lister/Lister WatchKit App/Images.xcassets/AppIcon.appiconset/Lister196.png
diff --git a/Lister/Objective-C/Lister WatchKit App/Images.xcassets/AppIcon.appiconset/Lister58.png b/Lister/Lister WatchKit App/Images.xcassets/AppIcon.appiconset/Lister58.png
similarity index 100%
rename from Lister/Objective-C/Lister WatchKit App/Images.xcassets/AppIcon.appiconset/Lister58.png
rename to Lister/Lister WatchKit App/Images.xcassets/AppIcon.appiconset/Lister58.png
diff --git a/Lister/Objective-C/Lister WatchKit App/Images.xcassets/AppIcon.appiconset/Lister80.png b/Lister/Lister WatchKit App/Images.xcassets/AppIcon.appiconset/Lister80.png
similarity index 100%
rename from Lister/Objective-C/Lister WatchKit App/Images.xcassets/AppIcon.appiconset/Lister80.png
rename to Lister/Lister WatchKit App/Images.xcassets/AppIcon.appiconset/Lister80.png
diff --git a/Lister/Objective-C/Lister WatchKit App/Images.xcassets/AppIcon.appiconset/Lister87.png b/Lister/Lister WatchKit App/Images.xcassets/AppIcon.appiconset/Lister87.png
similarity index 100%
rename from Lister/Objective-C/Lister WatchKit App/Images.xcassets/AppIcon.appiconset/Lister87.png
rename to Lister/Lister WatchKit App/Images.xcassets/AppIcon.appiconset/Lister87.png
diff --git a/Lister/Objective-C/Lister Watch App/Info.plist b/Lister/Lister WatchKit App/Info.plist
similarity index 97%
rename from Lister/Objective-C/Lister Watch App/Info.plist
rename to Lister/Lister WatchKit App/Info.plist
index b1e09646..97d48018 100644
--- a/Lister/Objective-C/Lister Watch App/Info.plist
+++ b/Lister/Lister WatchKit App/Info.plist
@@ -17,7 +17,7 @@
CFBundlePackageTypeAPPLCFBundleShortVersionString
- 2.0
+ 3.1CFBundleSignature????CFBundleVersion
diff --git a/Lister/Swift/Lister WatchKit Common/ColoredTextRowController.swift b/Lister/Lister WatchKit Common/ColoredTextRowController.swift
similarity index 93%
rename from Lister/Swift/Lister WatchKit Common/ColoredTextRowController.swift
rename to Lister/Lister WatchKit Common/ColoredTextRowController.swift
index ecbc7603..ba870a21 100644
--- a/Lister/Swift/Lister WatchKit Common/ColoredTextRowController.swift
+++ b/Lister/Lister WatchKit Common/ColoredTextRowController.swift
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2015 Apple Inc. All Rights Reserved.
+ Copyright (C) 2016 Apple Inc. All Rights Reserved.
See LICENSE.txt for this sample’s licensing information
Abstract:
diff --git a/Lister/Swift/Lister WatchKit Common/Glance/GlanceBadge.swift b/Lister/Lister WatchKit Common/Glance/GlanceBadge.swift
similarity index 95%
rename from Lister/Swift/Lister WatchKit Common/Glance/GlanceBadge.swift
rename to Lister/Lister WatchKit Common/Glance/GlanceBadge.swift
index e9d27517..e761e0c5 100644
--- a/Lister/Swift/Lister WatchKit Common/Glance/GlanceBadge.swift
+++ b/Lister/Lister WatchKit Common/Glance/GlanceBadge.swift
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2015 Apple Inc. All Rights Reserved.
+ Copyright (C) 2016 Apple Inc. All Rights Reserved.
See LICENSE.txt for this sample’s licensing information
Abstract:
@@ -128,8 +128,8 @@ class GlanceBadge {
let doneRect = CGRect(x: center.x - 0.5 * doneSize.width, y: center.y + 0.125 * doneSize.height, width: doneSize.width, height: doneSize.height)
- itemsCompleteText.drawInRect(completeRect.integerRect, withAttributes: completeAttributes)
+ itemsCompleteText.drawInRect(completeRect.integral, withAttributes: completeAttributes)
- doneText.drawInRect(doneRect.integerRect, withAttributes: doneAttributes)
+ doneText.drawInRect(doneRect.integral, withAttributes: doneAttributes)
}
}
diff --git a/Lister/Swift/Lister WatchKit Common/ListItemRowController.swift b/Lister/Lister WatchKit Common/ListItemRowController.swift
similarity index 94%
rename from Lister/Swift/Lister WatchKit Common/ListItemRowController.swift
rename to Lister/Lister WatchKit Common/ListItemRowController.swift
index 1ebec78f..9e292395 100644
--- a/Lister/Swift/Lister WatchKit Common/ListItemRowController.swift
+++ b/Lister/Lister WatchKit Common/ListItemRowController.swift
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2015 Apple Inc. All Rights Reserved.
+ Copyright (C) 2016 Apple Inc. All Rights Reserved.
See LICENSE.txt for this sample’s licensing information
Abstract:
diff --git a/Lister/Swift/Lister WatchKit Extension/Glance/GlanceInterfaceController.swift b/Lister/Lister WatchKit Extension/Glance/GlanceInterfaceController.swift
similarity index 99%
rename from Lister/Swift/Lister WatchKit Extension/Glance/GlanceInterfaceController.swift
rename to Lister/Lister WatchKit Extension/Glance/GlanceInterfaceController.swift
index b4bf9252..e247b924 100644
--- a/Lister/Swift/Lister WatchKit Extension/Glance/GlanceInterfaceController.swift
+++ b/Lister/Lister WatchKit Extension/Glance/GlanceInterfaceController.swift
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2015 Apple Inc. All Rights Reserved.
+ Copyright (C) 2016 Apple Inc. All Rights Reserved.
See LICENSE.txt for this sample’s licensing information
Abstract:
diff --git a/Lister/Objective-C/Lister Watch Extension/Images.xcassets/README__ignoredByTemplate__ b/Lister/Lister WatchKit Extension/Images.xcassets/README__ignoredByTemplate__
similarity index 100%
rename from Lister/Objective-C/Lister Watch Extension/Images.xcassets/README__ignoredByTemplate__
rename to Lister/Lister WatchKit Extension/Images.xcassets/README__ignoredByTemplate__
diff --git a/Lister/Swift/Lister WatchKit Extension/Info.plist b/Lister/Lister WatchKit Extension/Info.plist
similarity index 98%
rename from Lister/Swift/Lister WatchKit Extension/Info.plist
rename to Lister/Lister WatchKit Extension/Info.plist
index 9a06ab9d..6c68ce0b 100644
--- a/Lister/Swift/Lister WatchKit Extension/Info.plist
+++ b/Lister/Lister WatchKit Extension/Info.plist
@@ -19,7 +19,7 @@
CFBundlePackageTypeXPC!CFBundleShortVersionString
- 2.0
+ 3.1CFBundleSignature????CFBundleVersion
diff --git a/Lister/Swift/Lister WatchKit Extension/ListInterfaceController.swift b/Lister/Lister WatchKit Extension/ListInterfaceController.swift
similarity index 99%
rename from Lister/Swift/Lister WatchKit Extension/ListInterfaceController.swift
rename to Lister/Lister WatchKit Extension/ListInterfaceController.swift
index ce8e0918..c929c2ab 100644
--- a/Lister/Swift/Lister WatchKit Extension/ListInterfaceController.swift
+++ b/Lister/Lister WatchKit Extension/ListInterfaceController.swift
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2015 Apple Inc. All Rights Reserved.
+ Copyright (C) 2016 Apple Inc. All Rights Reserved.
See LICENSE.txt for this sample’s licensing information
Abstract:
diff --git a/Lister/Objective-C/Lister WatchKit Extension/Lister WatchKit Extension.entitlements b/Lister/Lister WatchKit Extension/Lister WatchKit Extension.entitlements
similarity index 100%
rename from Lister/Objective-C/Lister WatchKit Extension/Lister WatchKit Extension.entitlements
rename to Lister/Lister WatchKit Extension/Lister WatchKit Extension.entitlements
diff --git a/Lister/Swift/Lister WatchKit Extension/ListsInterfaceController.swift b/Lister/Lister WatchKit Extension/ListsInterfaceController.swift
similarity index 94%
rename from Lister/Swift/Lister WatchKit Extension/ListsInterfaceController.swift
rename to Lister/Lister WatchKit Extension/ListsInterfaceController.swift
index 81e85c9c..5d648dbb 100644
--- a/Lister/Swift/Lister WatchKit Extension/ListsInterfaceController.swift
+++ b/Lister/Lister WatchKit Extension/ListsInterfaceController.swift
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2015 Apple Inc. All Rights Reserved.
+ Copyright (C) 2016 Apple Inc. All Rights Reserved.
See LICENSE.txt for this sample’s licensing information
Abstract:
@@ -89,11 +89,11 @@ class ListsInterfaceController: WKInterfaceController, ListsControllerDelegate {
// MARK: Convenience
func configureRowControllerAtIndex(index: Int) {
- let ListRowController = interfaceTable.rowControllerAtIndex(index) as! ColoredTextRowController
+ let listRowController = interfaceTable.rowControllerAtIndex(index) as! ColoredTextRowController
let listInfo = listsController[index]
- ListRowController.setText(listInfo.name)
+ listRowController.setText(listInfo.name)
listInfo.fetchInfoWithCompletionHandler() {
/*
@@ -101,9 +101,9 @@ class ListsInterfaceController: WKInterfaceController, ListsControllerDelegate {
queue, dispatch back to the main queue to make UI updates.
*/
dispatch_async(dispatch_get_main_queue()) {
- let ListRowController = self.interfaceTable.rowControllerAtIndex(index) as! ColoredTextRowController
+ let listRowController = self.interfaceTable.rowControllerAtIndex(index) as! ColoredTextRowController
- ListRowController.setColor(listInfo.color!.colorValue)
+ listRowController.setColor(listInfo.color!.colorValue)
}
}
}
diff --git a/Lister/Objective-C/Lister WatchKit Extension/Localizable.strings b/Lister/Lister WatchKit Extension/Localizable.strings
similarity index 100%
rename from Lister/Objective-C/Lister WatchKit Extension/Localizable.strings
rename to Lister/Lister WatchKit Extension/Localizable.strings
diff --git a/Lister/Swift/Lister WatchKit Extension/Localizable.stringsdict b/Lister/Lister WatchKit Extension/Localizable.stringsdict
similarity index 100%
rename from Lister/Swift/Lister WatchKit Extension/Localizable.stringsdict
rename to Lister/Lister WatchKit Extension/Localizable.stringsdict
diff --git a/Lister/Swift/Lister.xcodeproj/project.pbxproj b/Lister/Lister.xcodeproj/project.pbxproj
similarity index 99%
rename from Lister/Swift/Lister.xcodeproj/project.pbxproj
rename to Lister/Lister.xcodeproj/project.pbxproj
index eae62cdd..c305ab1d 100644
--- a/Lister/Swift/Lister.xcodeproj/project.pbxproj
+++ b/Lister/Lister.xcodeproj/project.pbxproj
@@ -120,8 +120,8 @@
16CD55F51B127D2400DB4F4F /* ExtensionDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 16CD55F41B127D2400DB4F4F /* ExtensionDelegate.swift */; };
16CD55F71B127D2400DB4F4F /* GlanceInterfaceController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 16CD55F61B127D2400DB4F4F /* GlanceInterfaceController.swift */; };
16CD55FD1B127D2400DB4F4F /* Lister Watch App.app in Embed Watch Content */ = {isa = PBXBuildFile; fileRef = 16CD55E11B127D2400DB4F4F /* Lister Watch App.app */; };
- 16CD56141B127E6600DB4F4F /* ListerKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 16CD560C1B127DDC00DB4F4F /* ListerKit.framework */; };
- 16CD56151B127E6600DB4F4F /* ListerKit.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 16CD560C1B127DDC00DB4F4F /* ListerKit.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
+ 16CD56141B127E6600DB4F4F /* ListerWatchKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 16CD560C1B127DDC00DB4F4F /* ListerWatchKit.framework */; };
+ 16CD56151B127E6600DB4F4F /* ListerWatchKit.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 16CD560C1B127DDC00DB4F4F /* ListerWatchKit.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
16DAC8AD18F9BB5400251E9D /* ListColorCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 16DAC8AC18F9BB5400251E9D /* ListColorCell.swift */; };
16DAC8AF18F9DAA800251E9D /* ListCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 16DAC8AE18F9DAA800251E9D /* ListCell.swift */; };
16E63F2E1B128078001D63DF /* GlanceBadge.swift in Sources */ = {isa = PBXBuildFile; fileRef = 16E63F2C1B12806F001D63DF /* GlanceBadge.swift */; };
@@ -512,7 +512,7 @@
dstPath = "";
dstSubfolderSpec = 10;
files = (
- 16CD56151B127E6600DB4F4F /* ListerKit.framework in Embed Frameworks */,
+ 16CD56151B127E6600DB4F4F /* ListerWatchKit.framework in Embed Frameworks */,
);
name = "Embed Frameworks";
runOnlyForDeploymentPostprocessing = 0;
@@ -633,6 +633,7 @@
16AF5213191FF94B0088ED08 /* CheckBox.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = CheckBox.swift; path = ../ListerKit/CheckBox.swift; sourceTree = ""; };
16AF9FD11987FEA3008CAA4C /* LocalListCoordinator.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LocalListCoordinator.swift; sourceTree = ""; };
16AF9FD5198864DA008CAA4C /* CloudListCoordinator.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CloudListCoordinator.swift; sourceTree = ""; };
+ 16BB13ED1B82AFCE006E0F7C /* README.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = ""; };
16C8CB3C1986C2D100F8BCFE /* ListsController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; lineEnding = 0; name = ListsController.swift; path = ../ListerKit/ListsController.swift; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.swift; };
16CBDAA718F6EE3A00233D3C /* Lister.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Lister.app; sourceTree = BUILT_PRODUCTS_DIR; };
16CBDAAB18F6EE3A00233D3C /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
@@ -649,7 +650,7 @@
16CD55F41B127D2400DB4F4F /* ExtensionDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ExtensionDelegate.swift; sourceTree = ""; };
16CD55F61B127D2400DB4F4F /* GlanceInterfaceController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GlanceInterfaceController.swift; sourceTree = ""; };
16CD55FA1B127D2400DB4F4F /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
- 16CD560C1B127DDC00DB4F4F /* ListerKit.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = ListerKit.framework; sourceTree = BUILT_PRODUCTS_DIR; };
+ 16CD560C1B127DDC00DB4F4F /* ListerWatchKit.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = ListerWatchKit.framework; sourceTree = BUILT_PRODUCTS_DIR; };
16CD56101B127DDC00DB4F4F /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
16DAC8AC18F9BB5400251E9D /* ListColorCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ListColorCell.swift; sourceTree = ""; };
16DAC8AE18F9DAA800251E9D /* ListCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ListCell.swift; sourceTree = ""; };
@@ -813,7 +814,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
- 16CD56141B127E6600DB4F4F /* ListerKit.framework in Frameworks */,
+ 16CD56141B127E6600DB4F4F /* ListerWatchKit.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -1111,6 +1112,7 @@
16CBDA9E18F6EE3A00233D3C = {
isa = PBXGroup;
children = (
+ 16BB13ED1B82AFCE006E0F7C /* README.md */,
16CBDAA918F6EE3A00233D3C /* Lister iOS App */,
55EEFA841A1A5C9A00172D58 /* Lister WatchKit App */,
16E63F251B12802C001D63DF /* Shared Lister WatchKit Code */,
@@ -1139,7 +1141,7 @@
1611C5E81A925C1D00472891 /* Lister Tests.xctest */,
16CD55E11B127D2400DB4F4F /* Lister Watch App.app */,
16CD55ED1B127D2400DB4F4F /* Lister Watch Extension.appex */,
- 16CD560C1B127DDC00DB4F4F /* ListerKit.framework */,
+ 16CD560C1B127DDC00DB4F4F /* ListerWatchKit.framework */,
);
name = Products;
sourceTree = "";
@@ -1925,7 +1927,7 @@
);
name = "ListerKit (watchOS)";
productName = "ListerKit (watchOS)";
- productReference = 16CD560C1B127DDC00DB4F4F /* ListerKit.framework */;
+ productReference = 16CD560C1B127DDC00DB4F4F /* ListerWatchKit.framework */;
productType = "com.apple.product-type.framework";
};
16EE5953192016410052916A /* ListerKit */ = {
@@ -2123,6 +2125,7 @@
};
16CD560B1B127DDC00DB4F4F = {
CreatedOnToolsVersion = 7.0;
+ DevelopmentTeam = A93A5CM278;
};
16EE5953192016410052916A = {
CreatedOnToolsVersion = 6.0;
@@ -2803,10 +2806,6 @@
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
ENABLE_STRICT_OBJC_MSGSEND = YES;
- FRAMEWORK_SEARCH_PATHS = (
- "$(SDKROOT)/Developer/Library/Frameworks",
- "$(inherited)",
- );
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
@@ -2826,10 +2825,6 @@
BUNDLE_LOADER = "$(TEST_HOST)";
COPY_PHASE_STRIP = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
- FRAMEWORK_SEARCH_PATHS = (
- "$(SDKROOT)/Developer/Library/Frameworks",
- "$(inherited)",
- );
INFOPLIST_FILE = "Lister Tests/Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MTL_ENABLE_DEBUG_INFO = NO;
@@ -3008,7 +3003,7 @@
IBSC_MODULE = "Lister Watch Extension";
INFOPLIST_FILE = "$(SRCROOT)/Lister Watch App/Info.plist";
MTL_ENABLE_DEBUG_INFO = YES;
- PRODUCT_BUNDLE_IDENTIFIER = "${LISTER_BUNDLE_PREFIX}.Lister.nativewatchkitapp";
+ PRODUCT_BUNDLE_IDENTIFIER = "${LISTER_BUNDLE_PREFIX}.Lister.watchkitapp";
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = watchos;
SKIP_INSTALL = YES;
@@ -3030,7 +3025,7 @@
IBSC_MODULE = "Lister Watch Extension";
INFOPLIST_FILE = "$(SRCROOT)/Lister Watch App/Info.plist";
MTL_ENABLE_DEBUG_INFO = NO;
- PRODUCT_BUNDLE_IDENTIFIER = "${LISTER_BUNDLE_PREFIX}.Lister.nativewatchkitapp";
+ PRODUCT_BUNDLE_IDENTIFIER = "${LISTER_BUNDLE_PREFIX}.Lister.watchkitapp";
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = watchos;
SKIP_INSTALL = YES;
@@ -3052,7 +3047,7 @@
INFOPLIST_FILE = "$(SRCROOT)/Lister Watch Extension/Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks";
MTL_ENABLE_DEBUG_INFO = YES;
- PRODUCT_BUNDLE_IDENTIFIER = "${LISTER_BUNDLE_PREFIX}.Lister.nativewatchkitapp.nativewatchkitextension";
+ PRODUCT_BUNDLE_IDENTIFIER = "${LISTER_BUNDLE_PREFIX}.Lister.watchkitapp.watchkitextension";
PRODUCT_NAME = "${TARGET_NAME}";
SDKROOT = watchos;
SKIP_INSTALL = YES;
@@ -3073,7 +3068,7 @@
INFOPLIST_FILE = "$(SRCROOT)/Lister Watch Extension/Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks";
MTL_ENABLE_DEBUG_INFO = NO;
- PRODUCT_BUNDLE_IDENTIFIER = "${LISTER_BUNDLE_PREFIX}.Lister.nativewatchkitapp.nativewatchkitextension";
+ PRODUCT_BUNDLE_IDENTIFIER = "${LISTER_BUNDLE_PREFIX}.Lister.watchkitapp.watchkitextension";
PRODUCT_NAME = "${TARGET_NAME}";
SDKROOT = watchos;
SKIP_INSTALL = YES;
@@ -3085,7 +3080,9 @@
isa = XCBuildConfiguration;
buildSettings = {
APPLICATION_EXTENSION_API_ONLY = YES;
+ CODE_SIGN_IDENTITY = "Mac Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
+ "CODE_SIGN_IDENTITY[sdk=macosx*]" = "Mac Developer";
CURRENT_PROJECT_VERSION = 1;
DEBUG_INFORMATION_FORMAT = dwarf;
DEFINES_MODULE = YES;
@@ -3100,7 +3097,8 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MTL_ENABLE_DEBUG_INFO = YES;
PRODUCT_BUNDLE_IDENTIFIER = "${LISTER_BUNDLE_PREFIX}.ListerKit--watchOS-";
- PRODUCT_NAME = ListerKit;
+ PRODUCT_NAME = ListerWatchKit;
+ PROVISIONING_PROFILE = "";
SDKROOT = watchos;
SKIP_INSTALL = YES;
TARGETED_DEVICE_FAMILY = 4;
@@ -3113,7 +3111,9 @@
isa = XCBuildConfiguration;
buildSettings = {
APPLICATION_EXTENSION_API_ONLY = YES;
+ CODE_SIGN_IDENTITY = "Mac Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
+ "CODE_SIGN_IDENTITY[sdk=macosx*]" = "Mac Developer";
CURRENT_PROJECT_VERSION = 1;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEFINES_MODULE = YES;
@@ -3127,7 +3127,8 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MTL_ENABLE_DEBUG_INFO = NO;
PRODUCT_BUNDLE_IDENTIFIER = "${LISTER_BUNDLE_PREFIX}.ListerKit--watchOS-";
- PRODUCT_NAME = ListerKit;
+ PRODUCT_NAME = ListerWatchKit;
+ PROVISIONING_PROFILE = "";
SDKROOT = watchos;
SKIP_INSTALL = YES;
TARGETED_DEVICE_FAMILY = 4;
@@ -3283,10 +3284,6 @@
buildSettings = {
EMBEDDED_CONTENT_CONTAINS_SWIFT = YES;
ENABLE_STRICT_OBJC_MSGSEND = YES;
- FRAMEWORK_SEARCH_PATHS = (
- "$(SDKROOT)/Developer/Library/Frameworks",
- "$(inherited)",
- );
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
@@ -3305,10 +3302,6 @@
buildSettings = {
EMBEDDED_CONTENT_CONTAINS_SWIFT = YES;
ENABLE_STRICT_OBJC_MSGSEND = YES;
- FRAMEWORK_SEARCH_PATHS = (
- "$(SDKROOT)/Developer/Library/Frameworks",
- "$(inherited)",
- );
INFOPLIST_FILE = "ListerKit Tests/iOS/Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MTL_ENABLE_DEBUG_INFO = NO;
@@ -3326,10 +3319,6 @@
COMBINE_HIDPI_IMAGES = YES;
EMBEDDED_CONTENT_CONTAINS_SWIFT = YES;
ENABLE_STRICT_OBJC_MSGSEND = YES;
- FRAMEWORK_SEARCH_PATHS = (
- "$(DEVELOPER_FRAMEWORKS_DIR)",
- "$(inherited)",
- );
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
@@ -3353,10 +3342,6 @@
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
EMBEDDED_CONTENT_CONTAINS_SWIFT = YES;
ENABLE_STRICT_OBJC_MSGSEND = YES;
- FRAMEWORK_SEARCH_PATHS = (
- "$(DEVELOPER_FRAMEWORKS_DIR)",
- "$(inherited)",
- );
INFOPLIST_FILE = "ListerKit Tests/OS X/Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks";
MTL_ENABLE_DEBUG_INFO = NO;
diff --git a/Lister/Swift/Lister/AppDelegate.swift b/Lister/Lister/AppDelegate.swift
similarity index 79%
rename from Lister/Swift/Lister/AppDelegate.swift
rename to Lister/Lister/AppDelegate.swift
index 1ed8a3df..ffb8c108 100644
--- a/Lister/Swift/Lister/AppDelegate.swift
+++ b/Lister/Lister/AppDelegate.swift
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2015 Apple Inc. All Rights Reserved.
+ Copyright (C) 2016 Apple Inc. All Rights Reserved.
See LICENSE.txt for this sample’s licensing information
Abstract:
@@ -20,6 +20,24 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UISplitViewControllerDele
static let emptyViewController = "emptyViewController"
}
}
+
+ enum ShortcutIdentifier: String {
+ case NewInToday
+
+ // MARK: Initializers
+
+ init?(fullType: String) {
+ guard let last = fullType.componentsSeparatedByString(".").last else { return nil }
+
+ self.init(rawValue: last)
+ }
+
+ // MARK: Properties
+
+ var type: String {
+ return NSBundle.mainBundle().bundleIdentifier! + ".\(self.rawValue)"
+ }
+ }
// MARK: Properties
@@ -27,6 +45,8 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UISplitViewControllerDele
var listsController: ListsController!
+ var launchedShortcutItem: UIApplicationShortcutItem?
+
/**
A private, local queue used to ensure serialized access to Cloud containers during application
startup.
@@ -78,7 +98,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UISplitViewControllerDele
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
// Observe changes to the user's iCloud account status (account changed, logged out, etc...).
- NSNotificationCenter.defaultCenter().addObserver(self, selector: "handleUbiquityIdentityDidChangeNotification:", name: NSUbiquityIdentityDidChangeNotification, object: nil)
+ NSNotificationCenter.defaultCenter().addObserver(self, selector: #selector(AppDelegate.handleUbiquityIdentityDidChangeNotification(_:)), name: NSUbiquityIdentityDidChangeNotification, object: nil)
// Provide default lists from the app's bundle on first launch.
AppConfiguration.sharedConfiguration.runHandlerOnFirstLaunch {
@@ -93,14 +113,33 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UISplitViewControllerDele
navigationController.topViewController?.navigationItem.leftBarButtonItem = splitViewController.displayModeButtonItem()
navigationController.topViewController?.navigationItem.leftItemsSupplementBackButton = true
- return true
- }
-
- func applicationDidBecomeActive(application: UIApplication) {
+ var shouldPerformAdditionalDelegateHandling = true
+
+ // If a shortcut was launched, display its information and take the appropriate action.
+ if let shortcutItem = launchOptions?[UIApplicationLaunchOptionsShortcutItemKey] as? UIApplicationShortcutItem {
+
+ launchedShortcutItem = shortcutItem
+
+ // This will block "performActionForShortcutItem:completionHandler" from being called.
+ shouldPerformAdditionalDelegateHandling = false
+ }
+
// Make sure that user storage preferences are set up after the app sandbox is extended. See `application(_:, willFinishLaunchingWithOptions:)` above.
dispatch_async(appDelegateQueue) {
self.setupUserStoragePreferences()
}
+
+ return shouldPerformAdditionalDelegateHandling
+ }
+
+ func applicationDidBecomeActive(application: UIApplication) {
+ guard let launchedShortcutItem = launchedShortcutItem else { return }
+
+ // Make sure that shortcut handling occurs after storage preference have been set. See `application(_:, didFinishLaunchingWithOptions:)` above.
+ dispatch_async(appDelegateQueue) {
+ self.handleApplicationShortcutItem(launchedShortcutItem)
+ self.launchedShortcutItem = nil
+ }
}
func application(_: UIApplication, continueUserActivity userActivity: NSUserActivity, restorationHandler: ([AnyObject]?) -> Void) -> Bool {
@@ -121,7 +160,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UISplitViewControllerDele
// Lister currently only opens URLs of the Lister scheme type.
if url.scheme == AppConfiguration.ListerScheme.name {
// Obtain an app launch context from the provided lister:// URL and configure the view controller with it.
- let launchContext = AppLaunchContext(listerURL: url)
+ guard let launchContext = AppLaunchContext(listerURL: url) else { return false }
if let listDocumentsViewController = listDocumentsViewController {
// Make sure that URL opening is handled after the app sandbox is extended. See `application(_:, willFinishLaunchingWithOptions:)` above.
@@ -136,6 +175,13 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UISplitViewControllerDele
return false
}
+ func application(application: UIApplication, performActionForShortcutItem shortcutItem: UIApplicationShortcutItem, completionHandler: (Bool) -> Void) {
+ // Make sure that shortcut handling is coordinated with other activities handled asynchronously.
+ dispatch_async(appDelegateQueue) {
+ completionHandler(self.handleApplicationShortcutItem(shortcutItem))
+ }
+ }
+
// MARK: UISplitViewControllerDelegate
func splitViewController(splitViewController: UISplitViewController, collapseSecondaryViewController secondaryViewController: UIViewController, ontoPrimaryViewController _: UIViewController) -> Bool {
@@ -268,7 +314,9 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UISplitViewControllerDele
}
signedOutController.addAction(action)
- listDocumentsViewController?.presentViewController(signedOutController, animated: true, completion: nil)
+ dispatch_async(dispatch_get_main_queue()) {
+ self.listDocumentsViewController?.presentViewController(signedOutController, animated: true, completion: nil)
+ }
}
func promptUserForStorageOption() {
@@ -295,11 +343,33 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UISplitViewControllerDele
}
storageController.addAction(cloudOption)
- listDocumentsViewController?.presentViewController(storageController, animated: true, completion: nil)
+ dispatch_async(dispatch_get_main_queue()) {
+ self.listDocumentsViewController?.presentViewController(storageController, animated: true, completion: nil)
+ }
}
// MARK: Convenience
+ func handleApplicationShortcutItem(shortcutItem: UIApplicationShortcutItem) -> Bool {
+ // Verify that the provided `shortcutItem`'s `type` is one handled by the application.
+ guard let shortcutIdentifier = ShortcutIdentifier(fullType: shortcutItem.type) else { return false }
+
+ switch shortcutIdentifier {
+ case .NewInToday:
+ guard let listDocuments = self.listDocumentsViewController else { return false }
+ guard let listsController = self.listsController else { return false }
+
+ let todayURL = listsController.documentsDirectory.URLByAppendingPathComponent(AppConfiguration.localizedTodayDocumentNameAndExtension, isDirectory: false)
+ let launchContext = AppLaunchContext(listURL: todayURL, listColor: List.Color.Orange)
+
+ listDocuments.configureViewControllerWithLaunchContext(launchContext)
+
+ return true
+ }
+
+ // The switch is exhaustive so there is no need for a 'final' return statement.
+ }
+
func configureListsController(accountChanged accountChanged: Bool, storageOptionChangeHandler: (Void -> Void)? = nil) {
if listsController != nil && !accountChanged {
// The current controller is correct. There is no need to reconfigure it.
@@ -317,7 +387,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UISplitViewControllerDele
}
else if accountChanged {
// A lists controller is configured; however, it needs to have its coordinator updated based on the account change.
- listsController.listCoordinator = AppConfiguration.sharedConfiguration.listCoordinatorForCurrentConfigurationWithLastPathComponent(AppConfiguration.listerFileExtension, firstQueryHandler: storageOptionChangeHandler)
+ listsController.listCoordinator = AppConfiguration.sharedConfiguration.listCoordinatorForCurrentConfigurationWithPathExtension(AppConfiguration.listerFileExtension, firstQueryHandler: storageOptionChangeHandler)
}
}
}
diff --git a/Lister/Lister/AppLaunchContext.swift b/Lister/Lister/AppLaunchContext.swift
new file mode 100644
index 00000000..892a81c4
--- /dev/null
+++ b/Lister/Lister/AppLaunchContext.swift
@@ -0,0 +1,136 @@
+/*
+ Copyright (C) 2016 Apple Inc. All Rights Reserved.
+ See LICENSE.txt for this sample’s licensing information
+
+ Abstract:
+ A data object for storing context information relevant to how the app was launched.
+*/
+
+import UIKit
+import ListerKit
+
+struct AppLaunchContext {
+ // MARK: Properties
+
+ let listURL: NSURL
+
+ let listColor: List.Color
+
+ // MARK: Initializers
+
+ /**
+ Initializes an `AppLaunchContext` instance with the color and URL provided.
+
+ - parameter listURL: The `URL` of the file to launch to.
+ - parameter listColor: The `List.Color` of the file to launch to.
+ */
+ init(listURL: NSURL, listColor: List.Color) {
+ self.listURL = listURL
+ self.listColor = listColor
+ }
+
+ /**
+ Initializes an `AppLaunchContext` instance with the color and URL designated by the user activity.
+
+ - parameter userActivity: The `userActivity` providing the file URL and list color to launch to.
+ - parameter listsController: The `listsController` to be used to derive the `URL` available in the `userActivty`, if necessary.
+ */
+ init?(userActivity: NSUserActivity, listsController: ListsController) {
+ guard let userInfo = userActivity.userInfo else {
+ assertionFailure("User activity provided to \(#function) has no `userInfo` dictionary.")
+ return nil
+ }
+
+ /*
+ The URL may be provided as either a URL or a URL path via separate keys. Check first for
+ `NSUserActivityDocumentURLKey`, if not provided, obtain the path and create a file URL from it.
+ */
+
+ var possibleURL = userInfo[NSUserActivityDocumentURLKey] as? NSURL
+
+ // If `URL` is `nil` the activity is being continued from a platofrm other than iOS or OS X.
+ if possibleURL == nil {
+ guard let listInfoFilePath = userInfo[AppConfiguration.UserActivity.listURLPathUserInfoKey] as? String else {
+ assertionFailure("The `userInfo` dictionary provided to \(#function) did not contain a URL or URL path.")
+ return nil
+ }
+
+ let fileURLForPath = NSURL(fileURLWithPath: listInfoFilePath, isDirectory: false)
+
+ // Test for the existence of the file at the URL. If it exists proceed.
+ if !fileURLForPath.checkPromisedItemIsReachableAndReturnError(nil) && !fileURLForPath.checkResourceIsReachableAndReturnError(nil) {
+ // If the file does not exist at the URL created from the path construct one based on the filename.
+ let derivedURL = listsController.documentsDirectory.URLByAppendingPathComponent(fileURLForPath.lastPathComponent!, isDirectory: false)
+
+ if !derivedURL.checkPromisedItemIsReachableAndReturnError(nil) && !derivedURL.checkResourceIsReachableAndReturnError(nil) {
+ possibleURL = nil
+ }
+ else {
+ possibleURL = derivedURL
+ }
+ }
+ else {
+ possibleURL = fileURLForPath
+ }
+ }
+
+ guard let URL = possibleURL else {
+ assertionFailure("The `userInfo` dictionary provided to \(#function) did not contain a valid URL.")
+ return nil
+ }
+
+ // Assign the URL resolved from the dictionary.
+ listURL = URL
+
+ // Attempt to obtain the `rawColor` stored as an `Int` value and construct a `List.Color` from it.
+ guard let rawColor = userInfo[AppConfiguration.UserActivity.listColorUserInfoKey] as? Int,
+ let color = List.Color(rawValue: rawColor) else {
+ assertionFailure("The `userInfo` dictionary provided to \(#function) contains an invalid value for `color`.")
+ return nil
+ }
+
+ listColor = color
+ }
+
+ /**
+ Initializes an `AppLaunchContext` instance with the color and URL designated by the lister:// URL.
+
+ - parameter listerURL: The URL adhering to the lister:// scheme providing the file URL and list color to launch to.
+ */
+ init?(listerURL: NSURL) {
+ precondition(listerURL.scheme == AppConfiguration.ListerScheme.name, "Non-lister URL provided to \(#function).")
+
+ guard let filePath = listerURL.path else {
+ assertionFailure("URL provided to \(#function) is missing `path`.")
+ return nil
+ }
+
+ // Construct a file URL from the path of the lister:// URL.
+ listURL = NSURL(fileURLWithPath: filePath, isDirectory: false)
+
+ // Extract the query items to initialize the `listColor` property from the `color` query item.
+ guard let urlComponents = NSURLComponents(URL: listerURL, resolvingAgainstBaseURL: false),
+ let queryItems = urlComponents.queryItems else {
+ assertionFailure("URL provided to \(#function) contains no query items.")
+ return nil
+ }
+
+ // Filter down to only the `color` query items. There should only be one.
+ let colorQueryItems = queryItems.filter { $0.name == AppConfiguration.ListerScheme.colorQueryKey }
+
+ guard let colorQueryItem = colorQueryItems.first where colorQueryItems.count == 1 else {
+ assertionFailure("URL provided to \(#function) should contain only one `color` query item.")
+ return nil
+ }
+
+ // Attempt to obtain the `rawColor` stored as an `Int` value and construct a `List.Color` from it.
+ guard let colorQueryItemValue = colorQueryItem.value,
+ let rawColor = Int(colorQueryItemValue),
+ let color = List.Color(rawValue: rawColor) else {
+ assertionFailure("URL provided to \(#function) contains an invalid value for `color`: \(colorQueryItem.value).")
+ return nil
+ }
+
+ listColor = color
+ }
+}
diff --git a/Lister/Objective-C/Lister/Base.lproj/Launch Screen.storyboard b/Lister/Lister/Base.lproj/Launch Screen.storyboard
similarity index 100%
rename from Lister/Objective-C/Lister/Base.lproj/Launch Screen.storyboard
rename to Lister/Lister/Base.lproj/Launch Screen.storyboard
diff --git a/Lister/Swift/Lister/Base.lproj/Main.storyboard b/Lister/Lister/Base.lproj/Main.storyboard
similarity index 100%
rename from Lister/Swift/Lister/Base.lproj/Main.storyboard
rename to Lister/Lister/Base.lproj/Main.storyboard
diff --git a/Lister/Objective-C/Lister/Images.xcassets/AppIcon.appiconset/Contents.json b/Lister/Lister/Images.xcassets/AppIcon.appiconset/Contents.json
similarity index 94%
rename from Lister/Objective-C/Lister/Images.xcassets/AppIcon.appiconset/Contents.json
rename to Lister/Lister/Images.xcassets/AppIcon.appiconset/Contents.json
index b7f7ed2c..3b5e2c72 100644
--- a/Lister/Objective-C/Lister/Images.xcassets/AppIcon.appiconset/Contents.json
+++ b/Lister/Lister/Images.xcassets/AppIcon.appiconset/Contents.json
@@ -3,7 +3,7 @@
{
"size" : "29x29",
"idiom" : "iphone",
- "filename" : "Lister-29.png",
+ "filename" : "Lister-29-1.png",
"scale" : "1x"
},
{
@@ -21,13 +21,13 @@
{
"size" : "40x40",
"idiom" : "iphone",
- "filename" : "Lister-80.png",
+ "filename" : "Lister-80-1.png",
"scale" : "2x"
},
{
"size" : "40x40",
"idiom" : "iphone",
- "filename" : "Lister-120.png",
+ "filename" : "Lister-120-1.png",
"scale" : "3x"
},
{
@@ -43,7 +43,7 @@
{
"size" : "60x60",
"idiom" : "iphone",
- "filename" : "Lister-120-1.png",
+ "filename" : "Lister-120.png",
"scale" : "2x"
},
{
@@ -55,7 +55,7 @@
{
"size" : "29x29",
"idiom" : "ipad",
- "filename" : "Lister-29-1.png",
+ "filename" : "Lister-29.png",
"scale" : "1x"
},
{
@@ -73,7 +73,7 @@
{
"size" : "40x40",
"idiom" : "ipad",
- "filename" : "Lister-80-1.png",
+ "filename" : "Lister-80.png",
"scale" : "2x"
},
{
@@ -107,6 +107,12 @@
"idiom" : "ipad",
"filename" : "Lister-152.png",
"scale" : "2x"
+ },
+ {
+ "size" : "83.5x83.5",
+ "idiom" : "ipad",
+ "filename" : "Lister-167.png",
+ "scale" : "2x"
}
],
"info" : {
diff --git a/Lister/Objective-C/Lister/Images.xcassets/AppIcon.appiconset/Lister-120-1.png b/Lister/Lister/Images.xcassets/AppIcon.appiconset/Lister-120-1.png
similarity index 100%
rename from Lister/Objective-C/Lister/Images.xcassets/AppIcon.appiconset/Lister-120-1.png
rename to Lister/Lister/Images.xcassets/AppIcon.appiconset/Lister-120-1.png
diff --git a/Lister/Objective-C/Lister/Images.xcassets/AppIcon.appiconset/Lister-120.png b/Lister/Lister/Images.xcassets/AppIcon.appiconset/Lister-120.png
similarity index 100%
rename from Lister/Objective-C/Lister/Images.xcassets/AppIcon.appiconset/Lister-120.png
rename to Lister/Lister/Images.xcassets/AppIcon.appiconset/Lister-120.png
diff --git a/Lister/Objective-C/Lister/Images.xcassets/AppIcon.appiconset/Lister-152.png b/Lister/Lister/Images.xcassets/AppIcon.appiconset/Lister-152.png
similarity index 100%
rename from Lister/Objective-C/Lister/Images.xcassets/AppIcon.appiconset/Lister-152.png
rename to Lister/Lister/Images.xcassets/AppIcon.appiconset/Lister-152.png
diff --git a/Lister/Lister/Images.xcassets/AppIcon.appiconset/Lister-167.png b/Lister/Lister/Images.xcassets/AppIcon.appiconset/Lister-167.png
new file mode 100644
index 00000000..4790af1d
Binary files /dev/null and b/Lister/Lister/Images.xcassets/AppIcon.appiconset/Lister-167.png differ
diff --git a/Lister/Objective-C/Lister/Images.xcassets/AppIcon.appiconset/Lister-180.png b/Lister/Lister/Images.xcassets/AppIcon.appiconset/Lister-180.png
similarity index 100%
rename from Lister/Objective-C/Lister/Images.xcassets/AppIcon.appiconset/Lister-180.png
rename to Lister/Lister/Images.xcassets/AppIcon.appiconset/Lister-180.png
diff --git a/Lister/Objective-C/Lister/Images.xcassets/AppIcon.appiconset/Lister-29-1.png b/Lister/Lister/Images.xcassets/AppIcon.appiconset/Lister-29-1.png
similarity index 100%
rename from Lister/Objective-C/Lister/Images.xcassets/AppIcon.appiconset/Lister-29-1.png
rename to Lister/Lister/Images.xcassets/AppIcon.appiconset/Lister-29-1.png
diff --git a/Lister/Objective-C/Lister/Images.xcassets/AppIcon.appiconset/Lister-29.png b/Lister/Lister/Images.xcassets/AppIcon.appiconset/Lister-29.png
similarity index 100%
rename from Lister/Objective-C/Lister/Images.xcassets/AppIcon.appiconset/Lister-29.png
rename to Lister/Lister/Images.xcassets/AppIcon.appiconset/Lister-29.png
diff --git a/Lister/Objective-C/Lister/Images.xcassets/AppIcon.appiconset/Lister-40.png b/Lister/Lister/Images.xcassets/AppIcon.appiconset/Lister-40.png
similarity index 100%
rename from Lister/Objective-C/Lister/Images.xcassets/AppIcon.appiconset/Lister-40.png
rename to Lister/Lister/Images.xcassets/AppIcon.appiconset/Lister-40.png
diff --git a/Lister/Objective-C/Lister/Images.xcassets/AppIcon.appiconset/Lister-58-1.png b/Lister/Lister/Images.xcassets/AppIcon.appiconset/Lister-58-1.png
similarity index 100%
rename from Lister/Objective-C/Lister/Images.xcassets/AppIcon.appiconset/Lister-58-1.png
rename to Lister/Lister/Images.xcassets/AppIcon.appiconset/Lister-58-1.png
diff --git a/Lister/Objective-C/Lister/Images.xcassets/AppIcon.appiconset/Lister-58.png b/Lister/Lister/Images.xcassets/AppIcon.appiconset/Lister-58.png
similarity index 100%
rename from Lister/Objective-C/Lister/Images.xcassets/AppIcon.appiconset/Lister-58.png
rename to Lister/Lister/Images.xcassets/AppIcon.appiconset/Lister-58.png
diff --git a/Lister/Objective-C/Lister/Images.xcassets/AppIcon.appiconset/Lister-76.png b/Lister/Lister/Images.xcassets/AppIcon.appiconset/Lister-76.png
similarity index 100%
rename from Lister/Objective-C/Lister/Images.xcassets/AppIcon.appiconset/Lister-76.png
rename to Lister/Lister/Images.xcassets/AppIcon.appiconset/Lister-76.png
diff --git a/Lister/Objective-C/Lister/Images.xcassets/AppIcon.appiconset/Lister-80-1.png b/Lister/Lister/Images.xcassets/AppIcon.appiconset/Lister-80-1.png
similarity index 100%
rename from Lister/Objective-C/Lister/Images.xcassets/AppIcon.appiconset/Lister-80-1.png
rename to Lister/Lister/Images.xcassets/AppIcon.appiconset/Lister-80-1.png
diff --git a/Lister/Objective-C/Lister/Images.xcassets/AppIcon.appiconset/Lister-80.png b/Lister/Lister/Images.xcassets/AppIcon.appiconset/Lister-80.png
similarity index 100%
rename from Lister/Objective-C/Lister/Images.xcassets/AppIcon.appiconset/Lister-80.png
rename to Lister/Lister/Images.xcassets/AppIcon.appiconset/Lister-80.png
diff --git a/Lister/Objective-C/Lister/Images.xcassets/AppIcon.appiconset/Lister-87.png b/Lister/Lister/Images.xcassets/AppIcon.appiconset/Lister-87.png
similarity index 100%
rename from Lister/Objective-C/Lister/Images.xcassets/AppIcon.appiconset/Lister-87.png
rename to Lister/Lister/Images.xcassets/AppIcon.appiconset/Lister-87.png
diff --git a/Lister/Objective-C/Lister/Images.xcassets/Contents.json b/Lister/Lister/Images.xcassets/Contents.json
similarity index 100%
rename from Lister/Objective-C/Lister/Images.xcassets/Contents.json
rename to Lister/Lister/Images.xcassets/Contents.json
diff --git a/Lister/Swift/Lister/Info.plist b/Lister/Lister/Info.plist
similarity index 88%
rename from Lister/Swift/Lister/Info.plist
rename to Lister/Lister/Info.plist
index f61e9e8f..712432e0 100644
--- a/Lister/Swift/Lister/Info.plist
+++ b/Lister/Lister/Info.plist
@@ -38,7 +38,7 @@
CFBundlePackageTypeAPPLCFBundleShortVersionString
- 2.0
+ 3.1CFBundleSignature????CFBundleURLTypes
@@ -61,6 +61,17 @@
com.example.apple-samplecode.Lister.editingcom.example.apple-samplecode.Lister.watch
+ UIApplicationShortcutItems
+
+
+ UIApplicationShortcutItemIconType
+ UIApplicationShortcutIconTypeCompose
+ UIApplicationShortcutItemTitle
+ New In Today
+ UIApplicationShortcutItemType
+ $(PRODUCT_BUNDLE_IDENTIFIER).NewInToday
+
+ UILaunchStoryboardNameLaunch ScreenUIMainStoryboardFile
diff --git a/Lister/Swift/Lister/ListCell.swift b/Lister/Lister/ListCell.swift
similarity index 95%
rename from Lister/Swift/Lister/ListCell.swift
rename to Lister/Lister/ListCell.swift
index 5d225b6b..3e5cbadd 100644
--- a/Lister/Swift/Lister/ListCell.swift
+++ b/Lister/Lister/ListCell.swift
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2015 Apple Inc. All Rights Reserved.
+ Copyright (C) 2016 Apple Inc. All Rights Reserved.
See LICENSE.txt for this sample’s licensing information
Abstract:
diff --git a/Lister/Swift/Lister/ListColorCell.swift b/Lister/Lister/ListColorCell.swift
similarity index 95%
rename from Lister/Swift/Lister/ListColorCell.swift
rename to Lister/Lister/ListColorCell.swift
index 92e6ca8f..72e58888 100644
--- a/Lister/Swift/Lister/ListColorCell.swift
+++ b/Lister/Lister/ListColorCell.swift
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2015 Apple Inc. All Rights Reserved.
+ Copyright (C) 2016 Apple Inc. All Rights Reserved.
See LICENSE.txt for this sample’s licensing information
Abstract:
@@ -43,7 +43,7 @@ class ListColorCell: UITableViewCell {
func configure() {
// Set up a gesture recognizer to track taps on color views in the cell.
- let colorGesture = UITapGestureRecognizer(target: self, action: "colorTap:")
+ let colorGesture = UITapGestureRecognizer(target: self, action: #selector(ListColorCell.colorTap(_:)))
colorGesture.numberOfTapsRequired = 1
colorGesture.numberOfTouchesRequired = 1
diff --git a/Lister/Swift/Lister/ListDocumentsViewController.swift b/Lister/Lister/ListDocumentsViewController.swift
similarity index 82%
rename from Lister/Swift/Lister/ListDocumentsViewController.swift
rename to Lister/Lister/ListDocumentsViewController.swift
index 7d0027ff..1d247cf5 100644
--- a/Lister/Swift/Lister/ListDocumentsViewController.swift
+++ b/Lister/Lister/ListDocumentsViewController.swift
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2015 Apple Inc. All Rights Reserved.
+ Copyright (C) 2016 Apple Inc. All Rights Reserved.
See LICENSE.txt for this sample’s licensing information
Abstract:
@@ -43,16 +43,22 @@ class ListDocumentsViewController: UITableViewController, ListsControllerDelegat
private var pendingLaunchContext: AppLaunchContext?
private var watchAppInstalledAtLastStateChange = false
-
- // MARK: View Life Cycle
- override func viewDidLoad() {
- super.viewDidLoad()
+ // MARK: Initializers
+
+ required init?(coder aDecoder: NSCoder) {
+ super.init(coder: aDecoder)
if WCSession.isSupported() {
WCSession.defaultSession().delegate = self
WCSession.defaultSession().activateSession()
}
+ }
+
+ // MARK: View Life Cycle
+
+ override func viewDidLoad() {
+ super.viewDidLoad()
tableView.rowHeight = 44.0
@@ -61,7 +67,7 @@ class ListDocumentsViewController: UITableViewController, ListsControllerDelegat
NSForegroundColorAttributeName: List.Color.Gray.colorValue
]
- NSNotificationCenter.defaultCenter().addObserver(self, selector: "handleContentSizeCategoryDidChangeNotification:", name: UIContentSizeCategoryDidChangeNotification, object: nil)
+ NSNotificationCenter.defaultCenter().addObserver(self, selector: #selector(ListDocumentsViewController.handleContentSizeCategoryDidChangeNotification(_:)), name: UIContentSizeCategoryDidChangeNotification, object: nil)
}
override func viewWillAppear(animated: Bool) {
@@ -98,7 +104,7 @@ class ListDocumentsViewController: UITableViewController, ListsControllerDelegat
override func restoreUserActivityState(activity: NSUserActivity) {
// Obtain an app launch context from the provided activity and configure the view controller with it.
- let launchContext = AppLaunchContext(userActivity: activity)
+ guard let launchContext = AppLaunchContext(userActivity: activity, listsController: listsController) else { return }
configureViewControllerWithLaunchContext(launchContext)
}
@@ -264,7 +270,40 @@ class ListDocumentsViewController: UITableViewController, ListsControllerDelegat
// MARK: WCSessionDelegate
+ func session(session: WCSession, activationDidCompleteWithState activationState: WCSessionActivationState, error: NSError?) {
+ if let error = error {
+ print("session activation failed with error: \(error.localizedDescription)")
+ return
+ }
+
+ // Return early if `session` is not currently `.Activated`.
+ guard activationState == .Activated else { return }
+
+ updateWatchConnectivitySessionApplicationContext()
+ }
+
+ func sessionDidBecomeInactive(session: WCSession) {
+ /*
+ The `sessionDidBecomeInactive(_:)` callback indicates sending has been disabled. If your iOS app
+ sends content to its Watch extension it will need to stop trying at this point. This sample
+ checks the session state before transmitting so no further action is required.
+ */
+ }
+
+ func sessionDidDeactivate(session: WCSession) {
+ /*
+ The `sessionDidDeactivate(_:)` callback indicates `WCSession` is finished delivering content to
+ the iOS app. iOS apps that process content delivered from their Watch Extension should finish
+ processing that content and call `activateSession()`. This sample immediately calls
+ `activateSession()` as the data provided by the Watch Extension is handled immediately.
+ */
+ WCSession.defaultSession().activateSession()
+ }
+
func sessionWatchStateDidChange(session: WCSession) {
+ // Return early if `session` is not currently `.Activated`.
+ guard session.activationState == .Activated else { return }
+
if !watchAppInstalledAtLastStateChange && session.watchAppInstalled {
watchAppInstalledAtLastStateChange = session.watchAppInstalled
updateWatchConnectivitySessionApplicationContext()
@@ -272,13 +311,14 @@ class ListDocumentsViewController: UITableViewController, ListsControllerDelegat
}
func session(session: WCSession, didFinishFileTransfer fileTransfer: WCSessionFileTransfer, error: NSError?) {
- if error != nil {
- print("\(__FUNCTION__), file: \(fileTransfer.file.fileURL), error: \(error!.localizedDescription)")
+ if let error = error {
+ print("\(#function), file: \(fileTransfer.file.fileURL), error: \(error.localizedDescription)")
}
}
func session(session: WCSession, didReceiveFile file: WCSessionFile) {
- listsController.copyListFromURL(file.fileURL, toListWithName:file.fileURL.lastPathComponent!.stringByDeletingPathExtension)
+ guard let lastPathComponent = file.fileURL.lastPathComponent else { return }
+ listsController.copyListFromURL(file.fileURL, toListWithName:(lastPathComponent as NSString).stringByDeletingPathExtension)
}
// MARK: UIStoryboardSegue Handling
@@ -325,15 +365,20 @@ class ListDocumentsViewController: UITableViewController, ListsControllerDelegat
continue configuration from there. Otherwise, configure the view controller directly.
*/
if navigationController?.topViewController is UINavigationController {
- navigationController?.popToRootViewControllerAnimated(false)
- pendingLaunchContext = launchContext
+ dispatch_async(dispatch_get_main_queue()) {
+ // Ensure that any UI updates occur on the main queue.
+ self.navigationController?.popToRootViewControllerAnimated(false)
+ self.pendingLaunchContext = launchContext
+ }
return
}
let listInfo = ListInfo(URL: launchContext.listURL)
listInfo.color = launchContext.listColor
- performSegueWithIdentifier(.ShowListDocumentFromUserActivity, sender: listInfo)
+ dispatch_async(dispatch_get_main_queue()) {
+ self.performSegueWithIdentifier(.ShowListDocumentFromUserActivity, sender: listInfo)
+ }
}
func updateWatchConnectivitySessionApplicationContext() {
@@ -342,17 +387,23 @@ class ListDocumentsViewController: UITableViewController, ListsControllerDelegat
let session = WCSession.defaultSession()
+ // Do not proceed if `session` is not currently `.Activated`.
+ guard session.activationState == .Activated else { return }
+
// Do not proceed if the watch app is not installed on the paired watch.
- if !session.watchAppInstalled { return }
+ guard session.watchAppInstalled else { return }
// This array will be used to collect the data about the lists for the application context.
- var lists: [[String: AnyObject]] = []
+ var lists = [[String: AnyObject]]()
// A background queue to execute operations on to fetch the information about the lists.
let queue = NSOperationQueue()
// This operation will execute last and will actually update the application context.
- let updateApplicationContextOperation = NSBlockOperation(block: {
+ let updateApplicationContextOperation = NSBlockOperation {
do {
+ // Do not proceed if `session` is not currently `.Activated`.
+ guard session.activationState == .Activated else { return }
+
try session.updateApplicationContext([AppConfiguration.ApplicationActivityContext.currentListsKey: lists])
}
catch let error as NSError {
@@ -360,7 +411,7 @@ class ListDocumentsViewController: UITableViewController, ListsControllerDelegat
}
// Requiring an additional catch to satisfy exhaustivity is a known issue.
catch {}
- })
+ }
// Loop through the available lists in order to accumulate contextual information about them.
for idx in 0.. Void) {
+ func expectOnNextChange(expectations: Void -> Void) {
isTesting = true
- self.assertions = assertions
+ self.assertions = expectations
willChangeCallbackCount = 0
remainingExpectedWillChanges = nil
diff --git a/Lister/Swift/ListerKit Tests/ListTests.swift b/Lister/ListerKit Tests/ListTests.swift
similarity index 90%
rename from Lister/Swift/ListerKit Tests/ListTests.swift
rename to Lister/ListerKit Tests/ListTests.swift
index fb0a3419..6b32d3ac 100644
--- a/Lister/Swift/ListerKit Tests/ListTests.swift
+++ b/Lister/ListerKit Tests/ListTests.swift
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2015 Apple Inc. All Rights Reserved.
+ Copyright (C) 2016 Apple Inc. All Rights Reserved.
See LICENSE.txt for this sample’s licensing information
Abstract:
@@ -106,14 +106,14 @@ class ListTests: XCTestCase {
// MARK: Archive Compatibility
/**
- Ensure that the runtime name of the `List` class is "AAPLList". This is to ensure compatibility
- with the Objective-C version of the app that archives its data with the `AAPLList` class.
+ Ensure that the runtime name of the `List` class is "ListerKit.List". This is to ensure compatibility
+ with earlier versions of the app.
*/
func testClassRuntimeNameForArchiveCompatibility() {
let classRuntimeName = NSStringFromClass(List.self)
XCTAssertNotNil(classRuntimeName, "The List class should be an @objc subclass.")
- XCTAssertEqual(classRuntimeName, "AAPLList", "List should be archivable with the ObjC version of Lister.")
+ XCTAssertEqual(classRuntimeName, "AAPLList", "List should be archivable with earlier versions of Lister.")
}
}
diff --git a/Lister/Swift/ListerKit Tests/OS X/Info.plist b/Lister/ListerKit Tests/OS X/Info.plist
similarity index 100%
rename from Lister/Swift/ListerKit Tests/OS X/Info.plist
rename to Lister/ListerKit Tests/OS X/Info.plist
diff --git a/Lister/Swift/ListerKit Tests/iOS/Info.plist b/Lister/ListerKit Tests/iOS/Info.plist
similarity index 100%
rename from Lister/Swift/ListerKit Tests/iOS/Info.plist
rename to Lister/ListerKit Tests/iOS/Info.plist
diff --git a/Lister/Swift/ListerKit/CheckBox.swift b/Lister/ListerKit/CheckBox.swift
similarity index 96%
rename from Lister/Swift/ListerKit/CheckBox.swift
rename to Lister/ListerKit/CheckBox.swift
index 00f5dcf3..e68cb833 100644
--- a/Lister/Swift/ListerKit/CheckBox.swift
+++ b/Lister/ListerKit/CheckBox.swift
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2015 Apple Inc. All Rights Reserved.
+ Copyright (C) 2016 Apple Inc. All Rights Reserved.
See LICENSE.txt for this sample’s licensing information
Abstract:
diff --git a/Lister/Swift/ListerKit/CloudListCoordinator.swift b/Lister/ListerKit/CloudListCoordinator.swift
similarity index 95%
rename from Lister/Swift/ListerKit/CloudListCoordinator.swift
rename to Lister/ListerKit/CloudListCoordinator.swift
index af82bc49..88526a22 100644
--- a/Lister/Swift/ListerKit/CloudListCoordinator.swift
+++ b/Lister/ListerKit/CloudListCoordinator.swift
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2015 Apple Inc. All Rights Reserved.
+ Copyright (C) 2016 Apple Inc. All Rights Reserved.
See LICENSE.txt for this sample’s licensing information
Abstract:
@@ -28,7 +28,7 @@ import Foundation
it must make its delegate aware by calling one of the appropriate error methods defined in the
`ListCoordinatorDelegate` protocol.
*/
-@objc public class CloudListCoordinator: ListCoordinator {
+public class CloudListCoordinator: ListCoordinator {
// MARK: Properties
public weak var delegate: ListCoordinatorDelegate?
@@ -39,7 +39,7 @@ import Foundation
/// Initialized asynchronously in init(predicate:).
private var _documentsDirectory: NSURL!
- private var documentsDirectory: NSURL {
+ public var documentsDirectory: NSURL {
var documentsDirectory: NSURL!
dispatch_sync(documentsDirectoryQueue) {
@@ -104,9 +104,9 @@ import Foundation
// Observe the query.
let notificationCenter = NSNotificationCenter.defaultCenter()
- notificationCenter.addObserver(self, selector: "metadataQueryDidFinishGathering:", name: NSMetadataQueryDidFinishGatheringNotification, object: metadataQuery)
+ notificationCenter.addObserver(self, selector: #selector(CloudListCoordinator.metadataQueryDidFinishGathering(_:)), name: NSMetadataQueryDidFinishGatheringNotification, object: metadataQuery)
- notificationCenter.addObserver(self, selector: "metadataQueryDidUpdate:", name: NSMetadataQueryDidUpdateNotification, object: metadataQuery)
+ notificationCenter.addObserver(self, selector: #selector(CloudListCoordinator.metadataQueryDidUpdate(_:)), name: NSMetadataQueryDidUpdateNotification, object: metadataQuery)
}
// MARK: Lifetime
diff --git a/Lister/Swift/ListerKit/DirectoryMonitor.swift b/Lister/ListerKit/DirectoryMonitor.swift
similarity index 98%
rename from Lister/Swift/ListerKit/DirectoryMonitor.swift
rename to Lister/ListerKit/DirectoryMonitor.swift
index 0238e768..69ffaafb 100644
--- a/Lister/Swift/ListerKit/DirectoryMonitor.swift
+++ b/Lister/ListerKit/DirectoryMonitor.swift
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2015 Apple Inc. All Rights Reserved.
+ Copyright (C) 2016 Apple Inc. All Rights Reserved.
See LICENSE.txt for this sample’s licensing information
Abstract:
diff --git a/Lister/Swift/ListerKit/Info.plist b/Lister/ListerKit/Info.plist
similarity index 97%
rename from Lister/Swift/ListerKit/Info.plist
rename to Lister/ListerKit/Info.plist
index eb39cacc..d8857800 100644
--- a/Lister/Swift/ListerKit/Info.plist
+++ b/Lister/ListerKit/Info.plist
@@ -17,7 +17,7 @@
CFBundlePackageTypeFMWKCFBundleShortVersionString
- 2.0
+ 3.1CFBundleSignature????CFBundleVersion
diff --git a/Lister/Swift/ListerKit/ListCoordinator.swift b/Lister/ListerKit/ListCoordinator.swift
similarity index 96%
rename from Lister/Swift/ListerKit/ListCoordinator.swift
rename to Lister/ListerKit/ListCoordinator.swift
index 15d296c5..b1d466c2 100644
--- a/Lister/Swift/ListerKit/ListCoordinator.swift
+++ b/Lister/ListerKit/ListCoordinator.swift
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2015 Apple Inc. All Rights Reserved.
+ Copyright (C) 2016 Apple Inc. All Rights Reserved.
See LICENSE.txt for this sample’s licensing information
Abstract:
@@ -28,7 +28,7 @@ import Foundation
make its delegate aware by calling one of the appropriate error methods defined in the
`ListCoordinatorDelegate` protocol.
*/
-@objc public protocol ListCoordinator {
+public protocol ListCoordinator: class {
// MARK: Properties
/**
@@ -37,6 +37,9 @@ import Foundation
*/
weak var delegate: ListCoordinatorDelegate? { get set }
+ /// A URL for the directory containing documents within the application's container.
+ var documentsDirectory: NSURL { get }
+
// MARK: Methods
/**
@@ -116,7 +119,7 @@ import Foundation
tracked `NSURL` instances. The `ListCoordinatorDelegate` also allows a `ListCoordinator` to notify
its delegate of any errors that occured when removing or creating a list for a given URL.
*/
-@objc public protocol ListCoordinatorDelegate {
+public protocol ListCoordinatorDelegate: class {
/**
Notifies the `ListCoordinatorDelegate` instance of any changes to the tracked URLs of the
`ListCoordinator`. For more information about when this method should be called, see the
diff --git a/Lister/Swift/ListerKit/ListDocument.swift b/Lister/ListerKit/ListDocument.swift
similarity index 84%
rename from Lister/Swift/ListerKit/ListDocument.swift
rename to Lister/ListerKit/ListDocument.swift
index 93b867d8..927395ba 100644
--- a/Lister/Swift/ListerKit/ListDocument.swift
+++ b/Lister/ListerKit/ListDocument.swift
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2015 Apple Inc. All Rights Reserved.
+ Copyright (C) 2016 Apple Inc. All Rights Reserved.
See LICENSE.txt for this sample’s licensing information
Abstract:
@@ -69,8 +69,22 @@ public class ListDocument: UIDocument {
override public func saveToURL(url: NSURL, forSaveOperation saveOperation: UIDocumentSaveOperation, completionHandler: ((Bool) -> Void)?) {
super.saveToURL(url, forSaveOperation: saveOperation) { success in
+ // If `WCSession` isn't supported there is nothing else required.
+ guard WCSession.isSupported() else {
+ completionHandler?(success)
+ return
+ }
+
+ let session = WCSession.defaultSession()
+
+ // Do not proceed if `session` is not currently `.Activated` or the watch app is not installed.
+ guard session.activationState == .Activated && session.watchAppInstalled else {
+ completionHandler?(success)
+ return
+ }
+
// On a successful save, transfer the file to the paired watch if appropriate.
- if WCSession.isSupported() && WCSession.defaultSession().watchAppInstalled && success {
+ if success {
let fileCoordinator = NSFileCoordinator()
let readingIntent = NSFileAccessIntent.readingIntentWithURL(url, options: [])
fileCoordinator.coordinateAccessWithIntents([readingIntent], queue: NSOperationQueue()) { accessError in
@@ -78,7 +92,8 @@ public class ListDocument: UIDocument {
return
}
- let session = WCSession.defaultSession()
+ // Do not proceed if `session` is not currently `.Activated`.
+ guard session.activationState == .Activated else { return }
for transfer in session.outstandingFileTransfers {
if transfer.file.fileURL == readingIntent.URL {
diff --git a/Lister/Swift/ListerKit/ListInfo.swift b/Lister/ListerKit/ListInfo.swift
similarity index 93%
rename from Lister/Swift/ListerKit/ListInfo.swift
rename to Lister/ListerKit/ListInfo.swift
index cc9af00e..1ca2c7c9 100644
--- a/Lister/Swift/ListerKit/ListInfo.swift
+++ b/Lister/ListerKit/ListInfo.swift
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2015 Apple Inc. All Rights Reserved.
+ Copyright (C) 2016 Apple Inc. All Rights Reserved.
See LICENSE.txt for this sample’s licensing information
Abstract:
@@ -18,7 +18,7 @@ public class ListInfo: NSObject {
public var name: String {
let displayName = NSFileManager.defaultManager().displayNameAtPath(URL.path!)
- return displayName.stringByDeletingPathExtension
+ return (displayName as NSString).stringByDeletingPathExtension
}
private let fetchQueue = dispatch_queue_create("com.example.apple-samplecode.listinfo", DISPATCH_QUEUE_SERIAL)
diff --git a/Lister/Swift/ListerKit/ListUtilities.swift b/Lister/ListerKit/ListUtilities.swift
similarity index 99%
rename from Lister/Swift/ListerKit/ListUtilities.swift
rename to Lister/ListerKit/ListUtilities.swift
index a6a3cac8..f05babab 100644
--- a/Lister/Swift/ListerKit/ListUtilities.swift
+++ b/Lister/ListerKit/ListUtilities.swift
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2015 Apple Inc. All Rights Reserved.
+ Copyright (C) 2016 Apple Inc. All Rights Reserved.
See LICENSE.txt for this sample’s licensing information
Abstract:
diff --git a/Lister/Swift/ListerKit/ListsController.swift b/Lister/ListerKit/ListsController.swift
similarity index 98%
rename from Lister/Swift/ListerKit/ListsController.swift
rename to Lister/ListerKit/ListsController.swift
index 1db8da2c..50c67491 100644
--- a/Lister/Swift/ListerKit/ListsController.swift
+++ b/Lister/ListerKit/ListsController.swift
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2015 Apple Inc. All Rights Reserved.
+ Copyright (C) 2016 Apple Inc. All Rights Reserved.
See LICENSE.txt for this sample’s licensing information
Abstract:
@@ -144,6 +144,11 @@ final public class ListsController: NSObject, ListCoordinatorDelegate {
self.listCoordinator.startQuery()
}
}
+
+ /// A URL for the directory containing documents within the application's container.
+ public var documentsDirectory: NSURL {
+ return listCoordinator.documentsDirectory
+ }
/**
The `ListInfo` objects that are cached by the `ListsController` to allow for users of the
diff --git a/Lister/Swift/ListerKit/LocalListCoordinator.swift b/Lister/ListerKit/LocalListCoordinator.swift
similarity index 95%
rename from Lister/Swift/ListerKit/LocalListCoordinator.swift
rename to Lister/ListerKit/LocalListCoordinator.swift
index 576a300e..9cb623fe 100644
--- a/Lister/Swift/ListerKit/LocalListCoordinator.swift
+++ b/Lister/ListerKit/LocalListCoordinator.swift
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2015 Apple Inc. All Rights Reserved.
+ Copyright (C) 2016 Apple Inc. All Rights Reserved.
See LICENSE.txt for this sample’s licensing information
Abstract:
@@ -28,7 +28,7 @@ import Foundation
it must make its delegate aware by calling one of the appropriate error methods defined in the
`ListCoordinatorDelegate` protocol.
*/
-@objc public class LocalListCoordinator: ListCoordinator, DirectoryMonitorDelegate {
+public class LocalListCoordinator: ListCoordinator, DirectoryMonitorDelegate {
// MARK: Properties
public weak var delegate: ListCoordinatorDelegate?
@@ -46,7 +46,11 @@ import Foundation
private let predicate: NSPredicate
- private var currentLocalContents: [NSURL] = []
+ private var currentLocalContents = [NSURL]()
+
+ public var documentsDirectory: NSURL {
+ return ListUtilities.localDocumentsDirectory
+ }
// MARK: Initializers
@@ -182,7 +186,7 @@ import Foundation
}
private func documentURLForName(name: String) -> NSURL {
- let documentURLWithoutExtension = ListUtilities.localDocumentsDirectory.URLByAppendingPathComponent(name)
+ let documentURLWithoutExtension = documentsDirectory.URLByAppendingPathComponent(name)
return documentURLWithoutExtension.URLByAppendingPathExtension(AppConfiguration.listerFileExtension)
}
diff --git a/Lister/Swift/ListerKitOSX/CheckBox.swift b/Lister/ListerKitOSX/CheckBox.swift
similarity index 96%
rename from Lister/Swift/ListerKitOSX/CheckBox.swift
rename to Lister/ListerKitOSX/CheckBox.swift
index 37114c58..ad7da799 100644
--- a/Lister/Swift/ListerKitOSX/CheckBox.swift
+++ b/Lister/ListerKitOSX/CheckBox.swift
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2015 Apple Inc. All Rights Reserved.
+ Copyright (C) 2016 Apple Inc. All Rights Reserved.
See LICENSE.txt for this sample’s licensing information
Abstract:
diff --git a/Lister/Swift/ListerKitOSX/Info.plist b/Lister/ListerKitOSX/Info.plist
similarity index 97%
rename from Lister/Swift/ListerKitOSX/Info.plist
rename to Lister/ListerKitOSX/Info.plist
index 71867967..78df68e5 100644
--- a/Lister/Swift/ListerKitOSX/Info.plist
+++ b/Lister/ListerKitOSX/Info.plist
@@ -17,7 +17,7 @@
CFBundlePackageTypeFMWKCFBundleShortVersionString
- 2.0
+ 3.1CFBundleSignature????CFBundleVersion
diff --git a/Lister/Swift/ListerKitOSX/ListDocument.swift b/Lister/ListerKitOSX/ListDocument.swift
similarity index 98%
rename from Lister/Swift/ListerKitOSX/ListDocument.swift
rename to Lister/ListerKitOSX/ListDocument.swift
index cfebbf66..a912e044 100644
--- a/Lister/Swift/ListerKitOSX/ListDocument.swift
+++ b/Lister/ListerKitOSX/ListDocument.swift
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2015 Apple Inc. All Rights Reserved.
+ Copyright (C) 2016 Apple Inc. All Rights Reserved.
See LICENSE.txt for this sample’s licensing information
Abstract:
diff --git a/Lister/Swift/ListerKitOSX/ListFormatting.swift b/Lister/ListerKitOSX/ListFormatting.swift
similarity index 91%
rename from Lister/Swift/ListerKitOSX/ListFormatting.swift
rename to Lister/ListerKitOSX/ListFormatting.swift
index f49db427..db580deb 100644
--- a/Lister/Swift/ListerKitOSX/ListFormatting.swift
+++ b/Lister/ListerKitOSX/ListFormatting.swift
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2015 Apple Inc. All Rights Reserved.
+ Copyright (C) 2016 Apple Inc. All Rights Reserved.
See LICENSE.txt for this sample’s licensing information
Abstract:
@@ -14,7 +14,7 @@ public class ListFormatting {
var listItems = [ListItem]()
let enumerationOptions: NSStringEnumerationOptions = [.BySentences, .ByLines]
- let range = Range(start: string.startIndex, end: string.endIndex)
+ let range = string.startIndex..CFBundlePackageType
APPLCFBundleShortVersionString
- 2.0
+ 3.1CFBundleSignature????CFBundleVersion
diff --git a/Lister/Swift/ListerOSX/ListItemView.swift b/Lister/ListerOSX/ListItemView.swift
similarity index 91%
rename from Lister/Swift/ListerOSX/ListItemView.swift
rename to Lister/ListerOSX/ListItemView.swift
index c143087b..d275e472 100644
--- a/Lister/Swift/ListerOSX/ListItemView.swift
+++ b/Lister/ListerOSX/ListItemView.swift
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2015 Apple Inc. All Rights Reserved.
+ Copyright (C) 2016 Apple Inc. All Rights Reserved.
See LICENSE.txt for this sample’s licensing information
Abstract:
@@ -57,7 +57,7 @@ class ListItemView: NSTableCellView, NSTextFieldDelegate {
// Listen for the NSControlTextDidEndEditingNotification notification to notify the delegate of any
// updates it has to do its underlying model.
- NSNotificationCenter.defaultCenter().addObserver(self, selector: "handleControlTextDidEndEditingNotification:", name: NSControlTextDidEndEditingNotification, object: textField)
+ NSNotificationCenter.defaultCenter().addObserver(self, selector: #selector(ListItemView.handleControlTextDidEndEditingNotification(_:)), name: NSControlTextDidEndEditingNotification, object: textField)
}
// MARK: Lifetime
diff --git a/Lister/Swift/ListerOSX/ListTableView.swift b/Lister/ListerOSX/ListTableView.swift
similarity index 90%
rename from Lister/Swift/ListerOSX/ListTableView.swift
rename to Lister/ListerOSX/ListTableView.swift
index 6227bc3b..8bbe3aef 100644
--- a/Lister/Swift/ListerOSX/ListTableView.swift
+++ b/Lister/ListerOSX/ListTableView.swift
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2015 Apple Inc. All Rights Reserved.
+ Copyright (C) 2016 Apple Inc. All Rights Reserved.
See LICENSE.txt for this sample’s licensing information
Abstract:
diff --git a/Lister/Swift/ListerOSX/ListViewController.swift b/Lister/ListerOSX/ListViewController.swift
similarity index 99%
rename from Lister/Swift/ListerOSX/ListViewController.swift
rename to Lister/ListerOSX/ListViewController.swift
index 3799c5e1..d4b04ad5 100644
--- a/Lister/Swift/ListerOSX/ListViewController.swift
+++ b/Lister/ListerOSX/ListViewController.swift
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2015 Apple Inc. All Rights Reserved.
+ Copyright (C) 2016 Apple Inc. All Rights Reserved.
See LICENSE.txt for this sample’s licensing information
Abstract:
@@ -133,7 +133,7 @@ class ListViewController: NSViewController, ColorPaletteViewDelegate, ListItemVi
var normalizedToIndex = row
if fromIndex < row {
- normalizedToIndex--
+ normalizedToIndex -= 1
}
listPresenter!.moveListItem(listItem, toIndex: normalizedToIndex)
diff --git a/Lister/Swift/ListerOSX/ListWindowController.swift b/Lister/ListerOSX/ListWindowController.swift
similarity index 97%
rename from Lister/Swift/ListerOSX/ListWindowController.swift
rename to Lister/ListerOSX/ListWindowController.swift
index b2a2ccb0..1c998541 100644
--- a/Lister/Swift/ListerOSX/ListWindowController.swift
+++ b/Lister/ListerOSX/ListWindowController.swift
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2015 Apple Inc. All Rights Reserved.
+ Copyright (C) 2016 Apple Inc. All Rights Reserved.
See LICENSE.txt for this sample’s licensing information
Abstract:
diff --git a/Lister/Objective-C/ListerOSX/ListerOSX.entitlements b/Lister/ListerOSX/ListerOSX.entitlements
similarity index 100%
rename from Lister/Objective-C/ListerOSX/ListerOSX.entitlements
rename to Lister/ListerOSX/ListerOSX.entitlements
diff --git a/Lister/Swift/ListerOSX/Main.storyboard b/Lister/ListerOSX/Main.storyboard
similarity index 100%
rename from Lister/Swift/ListerOSX/Main.storyboard
rename to Lister/ListerOSX/Main.storyboard
diff --git a/Lister/Swift/ListerOSX/NSColor+AppSpecific.swift b/Lister/ListerOSX/NSColor+AppSpecific.swift
similarity index 91%
rename from Lister/Swift/ListerOSX/NSColor+AppSpecific.swift
rename to Lister/ListerOSX/NSColor+AppSpecific.swift
index e548b471..eeefafb9 100644
--- a/Lister/Swift/ListerOSX/NSColor+AppSpecific.swift
+++ b/Lister/ListerOSX/NSColor+AppSpecific.swift
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2015 Apple Inc. All Rights Reserved.
+ Copyright (C) 2016 Apple Inc. All Rights Reserved.
See LICENSE.txt for this sample’s licensing information
Abstract:
diff --git a/Lister/Swift/ListerOSX/ResizingTextField.swift b/Lister/ListerOSX/ResizingTextField.swift
similarity index 95%
rename from Lister/Swift/ListerOSX/ResizingTextField.swift
rename to Lister/ListerOSX/ResizingTextField.swift
index 9750c737..050dea5d 100644
--- a/Lister/Swift/ListerOSX/ResizingTextField.swift
+++ b/Lister/ListerOSX/ResizingTextField.swift
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2015 Apple Inc. All Rights Reserved.
+ Copyright (C) 2016 Apple Inc. All Rights Reserved.
See LICENSE.txt for this sample’s licensing information
Abstract:
diff --git a/Lister/Swift/ListerOSX/TableRowView.swift b/Lister/ListerOSX/TableRowView.swift
similarity index 93%
rename from Lister/Swift/ListerOSX/TableRowView.swift
rename to Lister/ListerOSX/TableRowView.swift
index b13d7232..568c0dcb 100644
--- a/Lister/Swift/ListerOSX/TableRowView.swift
+++ b/Lister/ListerOSX/TableRowView.swift
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2015 Apple Inc. All Rights Reserved.
+ Copyright (C) 2016 Apple Inc. All Rights Reserved.
See LICENSE.txt for this sample’s licensing information
Abstract:
diff --git a/Lister/Swift/ListerToday/CheckBoxCell.swift b/Lister/ListerToday/CheckBoxCell.swift
similarity index 85%
rename from Lister/Swift/ListerToday/CheckBoxCell.swift
rename to Lister/ListerToday/CheckBoxCell.swift
index cc639df4..51613b5e 100644
--- a/Lister/Swift/ListerToday/CheckBoxCell.swift
+++ b/Lister/ListerToday/CheckBoxCell.swift
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2015 Apple Inc. All Rights Reserved.
+ Copyright (C) 2016 Apple Inc. All Rights Reserved.
See LICENSE.txt for this sample’s licensing information
Abstract:
diff --git a/Lister/Swift/ListerToday/Info.plist b/Lister/ListerToday/Info.plist
similarity index 97%
rename from Lister/Swift/ListerToday/Info.plist
rename to Lister/ListerToday/Info.plist
index 29275581..24b9d7e8 100644
--- a/Lister/Swift/ListerToday/Info.plist
+++ b/Lister/ListerToday/Info.plist
@@ -19,7 +19,7 @@
CFBundlePackageTypeXPC!CFBundleShortVersionString
- 2.0
+ 3.1CFBundleSignature????CFBundleVersion
diff --git a/Lister/Objective-C/ListerToday/ListerToday.entitlements b/Lister/ListerToday/ListerToday.entitlements
similarity index 100%
rename from Lister/Objective-C/ListerToday/ListerToday.entitlements
rename to Lister/ListerToday/ListerToday.entitlements
diff --git a/Lister/Swift/ListerToday/Today.storyboard b/Lister/ListerToday/Today.storyboard
similarity index 100%
rename from Lister/Swift/ListerToday/Today.storyboard
rename to Lister/ListerToday/Today.storyboard
diff --git a/Lister/Swift/ListerToday/TodayViewController.swift b/Lister/ListerToday/TodayViewController.swift
similarity index 99%
rename from Lister/Swift/ListerToday/TodayViewController.swift
rename to Lister/ListerToday/TodayViewController.swift
index bc47f170..04dc4ff1 100644
--- a/Lister/Swift/ListerToday/TodayViewController.swift
+++ b/Lister/ListerToday/TodayViewController.swift
@@ -1,6 +1,6 @@
/*
- Copyright (C) 2015 Apple Inc. All Rights Reserved.
+ Copyright (C) 2016 Apple Inc. All Rights Reserved.
See LICENSE.txt for this sample’s licensing information
Abstract:
diff --git a/Lister/Swift/ListerTodayOSX/Info.plist b/Lister/ListerTodayOSX/Info.plist
similarity index 98%
rename from Lister/Swift/ListerTodayOSX/Info.plist
rename to Lister/ListerTodayOSX/Info.plist
index a1c36798..93c05a9d 100644
--- a/Lister/Swift/ListerTodayOSX/Info.plist
+++ b/Lister/ListerTodayOSX/Info.plist
@@ -19,7 +19,7 @@
CFBundlePackageTypeXPC!CFBundleShortVersionString
- 2.0
+ 3.1CFBundleSignature????CFBundleVersion
diff --git a/Lister/Swift/ListerTodayOSX/ListRowRepresentedObject.swift b/Lister/ListerTodayOSX/ListRowRepresentedObject.swift
similarity index 91%
rename from Lister/Swift/ListerTodayOSX/ListRowRepresentedObject.swift
rename to Lister/ListerTodayOSX/ListRowRepresentedObject.swift
index ffcb4e2e..7cd27892 100644
--- a/Lister/Swift/ListerTodayOSX/ListRowRepresentedObject.swift
+++ b/Lister/ListerTodayOSX/ListRowRepresentedObject.swift
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2015 Apple Inc. All Rights Reserved.
+ Copyright (C) 2016 Apple Inc. All Rights Reserved.
See LICENSE.txt for this sample’s licensing information
Abstract:
diff --git a/Lister/Swift/ListerTodayOSX/ListRowViewController.swift b/Lister/ListerTodayOSX/ListRowViewController.swift
similarity index 96%
rename from Lister/Swift/ListerTodayOSX/ListRowViewController.swift
rename to Lister/ListerTodayOSX/ListRowViewController.swift
index ada8ce47..c9df439d 100644
--- a/Lister/Swift/ListerTodayOSX/ListRowViewController.swift
+++ b/Lister/ListerTodayOSX/ListRowViewController.swift
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2015 Apple Inc. All Rights Reserved.
+ Copyright (C) 2016 Apple Inc. All Rights Reserved.
See LICENSE.txt for this sample’s licensing information
Abstract:
diff --git a/Lister/Swift/ListerTodayOSX/ListRowViewController.xib b/Lister/ListerTodayOSX/ListRowViewController.xib
similarity index 100%
rename from Lister/Swift/ListerTodayOSX/ListRowViewController.xib
rename to Lister/ListerTodayOSX/ListRowViewController.xib
diff --git a/Lister/Objective-C/ListerTodayOSX/ListerTodayOSX.entitlements b/Lister/ListerTodayOSX/ListerTodayOSX.entitlements
similarity index 100%
rename from Lister/Objective-C/ListerTodayOSX/ListerTodayOSX.entitlements
rename to Lister/ListerTodayOSX/ListerTodayOSX.entitlements
diff --git a/Lister/Swift/ListerTodayOSX/NoItemsRowViewController.swift b/Lister/ListerTodayOSX/NoItemsRowViewController.swift
similarity index 87%
rename from Lister/Swift/ListerTodayOSX/NoItemsRowViewController.swift
rename to Lister/ListerTodayOSX/NoItemsRowViewController.swift
index 659f5f73..e0043dec 100644
--- a/Lister/Swift/ListerTodayOSX/NoItemsRowViewController.swift
+++ b/Lister/ListerTodayOSX/NoItemsRowViewController.swift
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2015 Apple Inc. All Rights Reserved.
+ Copyright (C) 2016 Apple Inc. All Rights Reserved.
See LICENSE.txt for this sample’s licensing information
Abstract:
diff --git a/Lister/Swift/ListerTodayOSX/NoItemsRowViewController.xib b/Lister/ListerTodayOSX/NoItemsRowViewController.xib
similarity index 100%
rename from Lister/Swift/ListerTodayOSX/NoItemsRowViewController.xib
rename to Lister/ListerTodayOSX/NoItemsRowViewController.xib
diff --git a/Lister/Swift/ListerTodayOSX/OpenListerRowViewController.swift b/Lister/ListerTodayOSX/OpenListerRowViewController.swift
similarity index 94%
rename from Lister/Swift/ListerTodayOSX/OpenListerRowViewController.swift
rename to Lister/ListerTodayOSX/OpenListerRowViewController.swift
index a094cb53..32399505 100644
--- a/Lister/Swift/ListerTodayOSX/OpenListerRowViewController.swift
+++ b/Lister/ListerTodayOSX/OpenListerRowViewController.swift
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2015 Apple Inc. All Rights Reserved.
+ Copyright (C) 2016 Apple Inc. All Rights Reserved.
See LICENSE.txt for this sample’s licensing information
Abstract:
diff --git a/Lister/Swift/ListerTodayOSX/OpenListerRowViewController.xib b/Lister/ListerTodayOSX/OpenListerRowViewController.xib
similarity index 100%
rename from Lister/Swift/ListerTodayOSX/OpenListerRowViewController.xib
rename to Lister/ListerTodayOSX/OpenListerRowViewController.xib
diff --git a/Lister/Swift/ListerTodayOSX/TodayViewController.swift b/Lister/ListerTodayOSX/TodayViewController.swift
similarity index 99%
rename from Lister/Swift/ListerTodayOSX/TodayViewController.swift
rename to Lister/ListerTodayOSX/TodayViewController.swift
index 0349dcaa..d5ee2326 100644
--- a/Lister/Swift/ListerTodayOSX/TodayViewController.swift
+++ b/Lister/ListerTodayOSX/TodayViewController.swift
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2015 Apple Inc. All Rights Reserved.
+ Copyright (C) 2016 Apple Inc. All Rights Reserved.
See LICENSE.txt for this sample’s licensing information
Abstract:
diff --git a/Lister/Swift/ListerTodayOSX/TodayViewController.xib b/Lister/ListerTodayOSX/TodayViewController.xib
similarity index 100%
rename from Lister/Swift/ListerTodayOSX/TodayViewController.xib
rename to Lister/ListerTodayOSX/TodayViewController.xib
diff --git a/Lister/Swift/ListerTodayOSX/TodayWidgetRequiresCloudViewController.swift b/Lister/ListerTodayOSX/TodayWidgetRequiresCloudViewController.swift
similarity index 89%
rename from Lister/Swift/ListerTodayOSX/TodayWidgetRequiresCloudViewController.swift
rename to Lister/ListerTodayOSX/TodayWidgetRequiresCloudViewController.swift
index f7195c90..ab3a0e29 100644
--- a/Lister/Swift/ListerTodayOSX/TodayWidgetRequiresCloudViewController.swift
+++ b/Lister/ListerTodayOSX/TodayWidgetRequiresCloudViewController.swift
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2015 Apple Inc. All Rights Reserved.
+ Copyright (C) 2016 Apple Inc. All Rights Reserved.
See LICENSE.txt for this sample’s licensing information
Abstract:
diff --git a/Lister/Swift/ListerTodayOSX/TodayWidgetRequiresCloudViewController.xib b/Lister/ListerTodayOSX/TodayWidgetRequiresCloudViewController.xib
similarity index 100%
rename from Lister/Swift/ListerTodayOSX/TodayWidgetRequiresCloudViewController.xib
rename to Lister/ListerTodayOSX/TodayWidgetRequiresCloudViewController.xib
diff --git a/Lister/Swift/ListerTodayOSX/TodayWidgetRowPurpose.swift b/Lister/ListerTodayOSX/TodayWidgetRowPurpose.swift
similarity index 95%
rename from Lister/Swift/ListerTodayOSX/TodayWidgetRowPurpose.swift
rename to Lister/ListerTodayOSX/TodayWidgetRowPurpose.swift
index 1111623f..1316d4a7 100644
--- a/Lister/Swift/ListerTodayOSX/TodayWidgetRowPurpose.swift
+++ b/Lister/ListerTodayOSX/TodayWidgetRowPurpose.swift
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2015 Apple Inc. All Rights Reserved.
+ Copyright (C) 2016 Apple Inc. All Rights Reserved.
See LICENSE.txt for this sample’s licensing information
Abstract:
diff --git a/Lister/Objective-C/ListerTodayOSX/en.lproj/InfoPlist.strings b/Lister/ListerTodayOSX/en.lproj/InfoPlist.strings
similarity index 100%
rename from Lister/Objective-C/ListerTodayOSX/en.lproj/InfoPlist.strings
rename to Lister/ListerTodayOSX/en.lproj/InfoPlist.strings
diff --git a/Lister/Mac Quick Start.pdf b/Lister/Mac Quick Start.pdf
index 4d00d347..86a26d50 100644
Binary files a/Lister/Mac Quick Start.pdf and b/Lister/Mac Quick Start.pdf differ
diff --git a/Lister/Objective-C/Common/AAPLAllListItemsPresenter.h b/Lister/Objective-C/Common/AAPLAllListItemsPresenter.h
deleted file mode 100644
index c24a7af3..00000000
--- a/Lister/Objective-C/Common/AAPLAllListItemsPresenter.h
+++ /dev/null
@@ -1,161 +0,0 @@
-/*
- Copyright (C) 2015 Apple Inc. All Rights Reserved.
- See LICENSE.txt for this sample’s licensing information
-
- Abstract:
- The implementation for the \c AAPLAllListItemsPresenter type. This class is responsible for managing how a list is presented in the iOS and OS X apps.
-*/
-
-#import "AAPLListPresenting.h"
-
-@class AAPLListItem;
-
-/*!
- The \c AAPLAllListItemsPresenter list presenter class is responsible for managing how a list is displayed
- in both the iOS and OS X apps. The \c AAPLAllListItemsPresenter class conforms to \c AAPLListPresenting so
- consumers of this class can work with the presenter with a common interface.
-
- When a list is presented with an \c AAPLAllListItemsPresenter, all of the list items with a list are
- presented as the name suggests!). When the list items are displayed to a user, the incomplete list items
- are ordered before the complete list items. This order is determined when \c -setList: is called on the \c
- AAPLAllListItemsPresenter instance. The presenter then reorders the list items accordingly, calling the
- delegate methods with any relevant changes.
-
- An \c AAPLAllListItemsPresenter can be interacted with in a few ways. It can insert, remove, toggle, move,
- and update list items. It can also change the color of the presented list. All of these changes get
- funnelled through callbacks to the delegate (an \c AAPLListPresenterDelegate). For more information about
- how the delegate pattern for the \c AAPLListPresenting instance is architected, see the \c
- AAPLListPresenting definition. What's unique about the \c AAPLAllListItemsPresenter with respect to the
- delegate methods is that the \c AAPLAllListItemsPresenter has an undo manager. Whenever the presentation of
- the list is manipulated (as described above), the presenter pushes an undo operation that reverses the
- manipulation onto the undo stack. For example, if a list item is inserted, the \c
- AAPLAllListItemsPresenter instance registers an undo operation to remove the list item. When a user
- performs an undo in either the iOS or OS X app, the list item that was inserted is removed. The remove
- operation gets funnelled into the same delegate that inserted the list item. By abstracting these
- operations away into a presenter and delegate architecture, we're not only able to easily test the code
- that manipulates the list, but we're also able to test the undo registration code.
-
- One thing to note is that when a list item is toggled in the \c AAPLAllListItemsPresenter, it is moved from
- an index in its current completion state to an index opposite of the list items completion state. For
- example, if a list item that is complete is toggled, it will move to an incomplete index (e.g. index 0).
- For the \c AAPLAllListItemsPresenter, a toggle represents both the list item moving as well as the list
- item being updated.
- */
-@interface AAPLAllListItemsPresenter : NSObject
-
-/*!
- The undo manager to register undo events with when the \c AAPLAllListItemsPresenter instance is manipulated.
- */
-@property NSUndoManager *undoManager;
-
-/*!
- Inserts \c listItem into the list. If the list item is incomplete, \c listItem is inserted at index 0.
- Otherwise, it is inserted at the end of the list. Inserting a list item calls the delegate's \c
- -listPresenter:didInsertListItem:atIndex: method. Calling this method registers an undo event to remove the
- list item.
-
- \param listItem
- The \c AAPLListItem instance to insert.
- */
-- (void)insertListItem:(AAPLListItem *)listItem;
-
-/*!
- Inserts \c listItems into the list. The net effect of this is calling \c -insertListItem: for each \c
- AAPLListItem instance in \c listItems. Inserting list items calls the delegate's \c
- -listPresenter:didInsertListItem:atIndex: method for each inserted list item after an individual list item
- has been inserted. Calling this method registers an undo event to remove each list item.
-
- \param listItems
- The \c AAPLListItem instances to insert.
- */
-- (void)insertListItems:(NSArray *)listItems;
-
-/*!
- Removes \c listItem from the list. Removing the list item calls the delegate's \c
- -listPresenter:didRemoveListItem:atIndex: method for the removed list item after it has been removed.
- Calling this method registers an undo event to insert the list item at its previous index.
-
- \param listItem
- The \c AAPLListItem instance to remove.
- */
-- (void)removeListItem:(AAPLListItem *)listItem;
-
-/*!
- Removes \c listItems from the list. Removing list items calls the delegate's \c
- -listPresenter:didRemoveListItem:atIndex: method for each of the removed list items after an individual
- list item has been removed. Calling this method registers an undo event to insert the list items that were
- removed at their previous indexes.
-
- \param listItems
- The \c AAPLListItem instances to remove.
- */
-- (void)removeListItems:(NSArray *)listItems;
-
-/*!
- Updates the \c text property of \c listItem with \c newText. Updating the text property of the list item
- calls the delegate's \c -listPresenter:didUpdateListItem:atIndex: method for the list item that was
- updated. Calling this method registers an undo event to revert the text change back to the text before the
- method was invoked.
-
- \param listItem
- The \c AAPLListItem instance whose text needs to be updated.
-
- \param newText
- The new text for \c listItem.
- */
-- (void)updateListItem:(AAPLListItem *)listItem withText:(NSString *)newText;
-
-/*!
- Tests whether \c listItem is in the list and can be moved from its current index in the list (if it's
- already in the list) to \c toIndex.
-
- \param listItem
- The item to test for insertion.
-
- \param toIndex
- The index to use to determine if \c listItem can be inserted into the list.
-
- \returns
- Whether or not \c listItem and be moved to \c toIndex.
- */
-- (BOOL)canMoveListItem:(AAPLListItem *)listItem toIndex:(NSInteger)toIndex;
-
-/*!
- Moves \c listItem to \c toIndex. Moving the \c listItem to a new index calls the delegate's \c
- -listPresenter:didMoveListItem:fromIndex:toIndex method with the moved list item. Calling this method
- registers an undo event that moves the list item from its new index back to its old index.
-
- \param listItem
- The list item to move.
-
- \param toIndex
- The index to move \c listItem to.
- */
-- (void)moveListItem:(AAPLListItem *)listItem toIndex:(NSInteger)toIndex;
-
-/*!
- Toggles \c listItem within the list. This method moves a complete list item to an incomplete index at the
- beginning of the list, or it moves an incomplete list item to a complete index at the last index of the
- list. The list item is also updated in place since the completion state is flipped. Toggling a list item
- calls the delegate's \c -listPresenter:didMoveListItem:fromIndex:toIndex: method followed by the delegate's
- \c -listPresenter:didUpdateListItem:atIndex: method. Calling this method registers an undo event that
- toggles the list item back to its original location and completion state.
-
- \param listItem
- The list item to toggle.
- */
-- (void)toggleListItem:(AAPLListItem *)listItem;
-
-/*!
- Set all of the presented list item's completion states to \c completionState. This method does not move the
- list items around whatsoever. Changing the completion state on all of the list items calls the delegate's
- \c -listPresenter:didUpdateListItem:atIndex: method for each list item that has been updated. Calling this
- method registers an undo event that sets the completion states for all of the list items back to the
- original state before the method was invoked.
-
- \param completionState
- The value that all presented list item instances should have as their \c isComplete property.
- */
-- (void)updatePresentedListItemsToCompletionState:(BOOL)completionState;
-
-@end
diff --git a/Lister/Objective-C/Common/AAPLAllListItemsPresenter.m b/Lister/Objective-C/Common/AAPLAllListItemsPresenter.m
deleted file mode 100644
index da0e9cb8..00000000
--- a/Lister/Objective-C/Common/AAPLAllListItemsPresenter.m
+++ /dev/null
@@ -1,511 +0,0 @@
-/*
- Copyright (C) 2015 Apple Inc. All Rights Reserved.
- See LICENSE.txt for this sample’s licensing information
-
- Abstract:
- The implementation for the \c AAPLAllListItemsPresenter type. This class is responsible for managing how a list is presented in the iOS and OS X apps.
-*/
-
-#import "AAPLAllListItemsPresenter.h"
-#import "AAPLListPresenterDelegate.h"
-#import "AAPLList.h"
-#import "AAPLListItem.h"
-#import "AAPLListPresenterAlgorithms.h"
-#import "AAPLListPresenterUtilities.h"
-
-@interface AAPLAllListItemsPresenter ()
-
-/// The internal storage for the list that we're presenting. By default, it's an empty list.
-@property (readwrite, nonatomic) AAPLList *list;
-
-/// Flag to see whether or not the first \c -setList: call should trigger a batch reload.
-@property (getter=isInitialList) BOOL initialList;
-
-/// The index of the first complete item within the list's items.
-@property (readonly) NSInteger indexOfFirstCompleteItem;
-
-@end
-
-@implementation AAPLAllListItemsPresenter
-@synthesize delegate = _delegate;
-@dynamic color;
-
-#pragma mark - Initialization
-
-- (instancetype)init {
- self = [super init];
-
- if (self) {
- // Use a default, empty list.
- _list = [[AAPLList alloc] initWithColor:AAPLListColorGray items:@[]];
- _initialList = YES;
- }
-
- return self;
-}
-
-#pragma mark - AAPLListItemPresenter
-
-- (void)setColor:(AAPLListColor)color {
- AAPLListColor oldColor = self.color;
-
- BOOL different = AAPLUpdateListColorForListPresenterIfDifferent(self, self.list, color, AAPLListColorUpdateActionSendDelegateChangeLayoutCallsForNonInitialLayout);
-
- // Register the undo color operation with the old color if the list's color was changed.
- if (different) {
- [[self.undoManager prepareWithInvocationTarget:self] setColor:oldColor];
-
- NSString *undoActionName = NSLocalizedString(@"Change Color", nil);
- [self.undoManager setActionName:undoActionName];
- }
-}
-
-- (AAPLListColor)color {
- return self.list.color;
-}
-
-- (AAPLList *)archiveableList {
- return self.list;
-}
-
-- (NSArray *)presentedListItems {
- return [self.list items];
-}
-
-/*!
- Sets the list that should be presented. Calling \c -setList: on an
- \c AAPLAllListItemsPresenter does not trigger any undo registrations. Calling
- \c -setList: also removes all of the undo actions from the undo manager.
- */
-- (void)setList:(AAPLList *)newList {
- /*
- If this is the initial list that's being presented, just tell the delegate
- to reload all of the data.
- */
- if (self.isInitialList) {
- self.initialList = NO;
-
- _list = newList;
- newList.items = [self reorderedListItemsFromListItems:newList.items];
-
- [self.delegate listPresenterDidRefreshCompleteLayout:self];
-
- return;
- }
-
- /**
- Perform more granular changes (if we can). To do this, we'll group the changes into the different
- types of possible changes. If we know that a group of similar changes occured, we'll batch them
- together (e.g. four updates to list items). If multiple changes occur that we can't correctly resolve
- (an implementation detail), we'll refresh the complete layout. An example of this is if more than one
- list item is inserted or toggled. Since this algorithm doesn't track the indexes that list items
- are inserted at, we will just refresh the complete layout to make sure that the list items are presented
- correctly. This applies for multiple groups of changes (e.g. one insert and one toggle), and also for
- any unique group of toggles / inserts where there's more than a single update.
- */
- AAPLList *oldList = self.list;
-
- NSArray *newRemovedListItems = AAPLFindRemovedListItemsFromInitialListItemsToChangedListItems(oldList.items, newList.items);
- NSArray *newInsertedListItems = AAPLFindInsertedListItemsFromInitialListItemsToChangedListItems(oldList.items, newList.items, nil);
- NSArray *newToggledListItems = AAPLFindToggledListItemsFromInitialListItemsToChangedListItems(oldList.items, newList.items);
- NSArray *newListItemsWithUpdatedText = AAPLFindListItemsWithUpdatedTextFromInitialListItemsToChangedListItems(oldList.items, newList.items);
-
- /**
- Determine if there was a unique group of batch changes we can make. Otherwise, we'll
- refresh all the data in the list.
- */
- AAPLListItemsBatchChangeKind listItemsBatchChangeKind = AAPLListItemsBatchChangeKindForChanges(newRemovedListItems, newInsertedListItems, newToggledListItems, newListItemsWithUpdatedText);
-
- if (listItemsBatchChangeKind == AAPLListItemsBatchChangeKindNone) {
- if (oldList.color != newList.color) {
- [self.undoManager removeAllActionsWithTarget:self];
-
- AAPLUpdateListColorForListPresenterIfDifferent(self, self.list, newList.color, AAPLListColorUpdateActionSendDelegateChangeLayoutCallsForInitialLayout);
- }
-
- return;
- }
-
- /**
- Check to see if there was more than one kind of unique group of changes, or if there were multiple toggled /
- inserted list items that we don't handle.
- */
- if (listItemsBatchChangeKind == AAPLListItemsBatchChangeKindMultiple || newToggledListItems.count > 1 || newInsertedListItems.count > 1) {
- [self.undoManager removeAllActionsWithTarget:self];
-
- _list = newList;
- newList.items = [self reorderedListItemsFromListItems:newList.items];
-
- [self.delegate listPresenterDidRefreshCompleteLayout:self];
-
- return;
- }
-
- /**
- At this point we know that we have changes that are uniquely identifiable: e.g. one inserted list item,
- one toggled list item, multiple removed list items, or multiple list items whose text has been updated.
- */
- [self.undoManager removeAllActionsWithTarget:self];
-
- [self.delegate listPresenterWillChangeListLayout:self isInitialLayout:YES];
-
- // Make the changes based on the unique change kind.
-
- switch (listItemsBatchChangeKind) {
- case AAPLListItemsBatchChangeKindRemoved: {
- NSMutableArray *oldListItemsMutableProxy = [self.list mutableArrayValueForKey:@"items"];
-
- AAPLRemoveListItemsFromListItemsWithListPresenter(self, oldListItemsMutableProxy, newRemovedListItems);
-
- break;
- }
- case AAPLListItemsBatchChangeKindInserted: {
- [self unsafeInsertListItem:newInsertedListItems.firstObject];
-
- break;
- }
- case AAPLListItemsBatchChangeKindToggled: {
- // We want to toggle the *old* list item, not the one that's in newList.
- NSInteger indexOfToggledListItemInOldListItems = [oldList.items indexOfObject:newToggledListItems.firstObject];
-
- AAPLListItem *listItemToToggle = oldList.items[indexOfToggledListItemInOldListItems];
-
- [self unsafeToggleListItem:listItemToToggle];
-
- break;
- }
- case AAPLListItemsBatchChangeKindUpdatedText: {
- NSMutableArray *oldListItemsMutableProxy = [self.list mutableArrayValueForKey:@"items"];
-
- AAPLUpdateListItemsWithListItemsForListPresenter(self, oldListItemsMutableProxy, newListItemsWithUpdatedText);
-
- break;
- }
-
- default: abort();
- }
-
- AAPLUpdateListColorForListPresenterIfDifferent(self, self.list, newList.color, AAPLListColorUpdateActionDontSendDelegateChangeLayoutCalls);
-
- [self.delegate listPresenterDidChangeListLayout:self isInitialLayout:YES];
-}
-
-- (NSInteger)count {
- return self.presentedListItems.count;
-}
-
-- (BOOL)isEmpty {
- return self.presentedListItems.count == 0;
-}
-
-#pragma mark - Public Methods
-
-- (void)insertListItem:(AAPLListItem *)listItem {
- [self.delegate listPresenterWillChangeListLayout:self isInitialLayout:NO];
-
- [self unsafeInsertListItem:listItem];
-
- [self.delegate listPresenterDidChangeListLayout:self isInitialLayout:NO];
-
- // Undo
- [[self.undoManager prepareWithInvocationTarget:self] removeListItem:listItem];
-
- NSString *undoActionName = NSLocalizedString(@"Remove", nil);
- [self.undoManager setActionName:undoActionName];
-}
-
-- (void)insertListItems:(NSArray *)listItems {
- if (listItems.count == 0) {
- return;
- }
-
- [self.delegate listPresenterWillChangeListLayout:self isInitialLayout:NO];
-
- for (AAPLListItem *listItem in listItems) {
- [self unsafeInsertListItem:listItem];
- }
-
- [self.delegate listPresenterDidChangeListLayout:self isInitialLayout:NO];
-
- // Undo
- [[self.undoManager prepareWithInvocationTarget:self] removeListItems:listItems];
-
- NSString *undoActionName = NSLocalizedString(@"Remove", nil);
- [self.undoManager setActionName:undoActionName];
-}
-
-- (void)removeListItem:(AAPLListItem *)listItem {
- NSInteger listItemIndex = [self.presentedListItems indexOfObject:listItem];
-
- NSAssert(listItemIndex != NSNotFound, @"To remove a list item, it must already be in the list.");
-
- [self.delegate listPresenterWillChangeListLayout:self isInitialLayout:NO];
-
- [[self.list mutableArrayValueForKey:@"items"] removeObjectAtIndex:listItemIndex];
-
- [self.delegate listPresenter:self didRemoveListItem:listItem atIndex:listItemIndex];
-
- [self.delegate listPresenterDidChangeListLayout:self isInitialLayout:NO];
-
- // Undo
- [[self.undoManager prepareWithInvocationTarget:self] insertListItemsForUndo:@[listItem] atIndexes:@[@(listItemIndex)]];
-
- NSString *undoActionName = NSLocalizedString(@"Remove", nil);
- [self.undoManager setActionName:undoActionName];
-}
-
-- (void)removeListItems:(NSArray *)listItemsToRemove {
- if (listItemsToRemove.count == 0) {
- return;
- }
-
- NSMutableArray *listItems = [self.list mutableArrayValueForKey:@"items"];
-
- /**
- We're going to store the indexes of the list items that will be removed in an array.
- We do that so that when we insert the same list items back in for undo, we don't need
- to worry about insertion order (since it will just be the opposite of insertion order).
- */
- NSMutableArray *removedIndexes = [NSMutableArray array];
-
- for (AAPLListItem *listItem in listItemsToRemove) {
- NSInteger listItemIndex = [self.presentedListItems indexOfObject:listItem];
-
- NSAssert(listItemIndex != NSNotFound, @"List items to remove must already be in the list.");
-
- [listItems removeObjectAtIndex:listItemIndex];
-
- [self.delegate listPresenter:self didRemoveListItem:listItem atIndex:listItemIndex];
-
- [removedIndexes addObject:@(listItemIndex)];
- }
-
- [self.delegate listPresenterDidChangeListLayout:self isInitialLayout:NO];
-
- // Undo
- NSArray *reverseListItemsToRemove = [[listItemsToRemove reverseObjectEnumerator] allObjects];
- NSArray *reverseRemovedIndexes = [[removedIndexes reverseObjectEnumerator] allObjects];
- [[self.undoManager prepareWithInvocationTarget:self] insertListItemsForUndo:reverseListItemsToRemove atIndexes:reverseRemovedIndexes];
-
- NSString *undoActionName = NSLocalizedString(@"Remove", nil);
- [self.undoManager setActionName:undoActionName];
-}
-
-- (void)updateListItem:(AAPLListItem *)listItem withText:(NSString *)newText {
- NSInteger listItemIndex = [self.presentedListItems indexOfObject:listItem];
-
- NSAssert(listItemIndex != NSNotFound, @"A list item can only be updated if it already exists in the list.");
-
- // If the text is the same, it's a no op.
- if ([listItem.text isEqualToString:newText]) {
- return;
- }
-
- NSString *oldText = listItem.text;
-
- [self.delegate listPresenterWillChangeListLayout:self isInitialLayout:NO];
-
- listItem.text = newText;
-
- [self.delegate listPresenter:self didUpdateListItem:listItem atIndex:listItemIndex];
-
- [self.delegate listPresenterDidChangeListLayout:self isInitialLayout:NO];
-
- // Undo
- [[self.undoManager prepareWithInvocationTarget:self] updateListItem:listItem withText:oldText];
-
- NSString *undoActionName = NSLocalizedString(@"Text Change", nil);
- [self.undoManager setActionName:undoActionName];
-}
-
-- (BOOL)canMoveListItem:(AAPLListItem *)listItem toIndex:(NSInteger)toIndex {
- if (![self.presentedListItems containsObject:listItem]) {
- return NO;
- }
-
- NSInteger indexOfFirstCompleteItem = self.indexOfFirstCompleteItem;
-
- if (indexOfFirstCompleteItem != NSNotFound) {
- if (listItem.isComplete) {
- return toIndex >= indexOfFirstCompleteItem && toIndex <= self.count;
- }
- else {
- return toIndex >= 0 && toIndex < indexOfFirstCompleteItem;
- }
- }
-
- return !listItem.isComplete && toIndex >= 0 && toIndex <= self.count;
-}
-
-- (void)moveListItem:(AAPLListItem *)listItem toIndex:(NSInteger)toIndex {
- NSAssert([self canMoveListItem:listItem toIndex:toIndex], @"An item can only be moved if it passed a \"can move\" test.");
-
- [self.delegate listPresenterWillChangeListLayout:self isInitialLayout:NO];
-
- NSInteger fromIndex = [self unsafeMoveListItem:listItem toIndex:toIndex];
-
- [self.delegate listPresenterDidChangeListLayout:self isInitialLayout:NO];
-
- // Undo
- [[self.undoManager prepareWithInvocationTarget:self] moveListItem:listItem toIndex:fromIndex];
-
- NSString *undoActionName = NSLocalizedString(@"Move", nil);
- [self.undoManager setActionName:undoActionName];
-}
-
-- (void)toggleListItem:(AAPLListItem *)listItem {
- [self.delegate listPresenterWillChangeListLayout:self isInitialLayout:NO];
-
- NSInteger fromIndex = [self unsafeToggleListItem:listItem];
-
- [self.delegate listPresenterDidChangeListLayout:self isInitialLayout:NO];
-
- // Undo
- [[self.undoManager prepareWithInvocationTarget:self] toggleListItemForUndo:listItem toPreviousIndex:fromIndex];
-
- NSString *undoActionName = NSLocalizedString(@"Toggle", nil);
- [self.undoManager setActionName:undoActionName];
-}
-
-- (void)updatePresentedListItemsToCompletionState:(BOOL)completionState {
- NSPredicate *filterPredicate = [NSPredicate predicateWithFormat:@"isComplete != %@", @(completionState)];
-
- NSArray *presentedListItemsNotMatchingCompletionState = [self.presentedListItems filteredArrayUsingPredicate:filterPredicate];
-
- // If there are no list items that match the completion state, it's a no op.
- if (presentedListItemsNotMatchingCompletionState.count == 0) {
- return;
- }
-
- NSString *undoActionName = completionState ? NSLocalizedString(@"Complete All", nil) : NSLocalizedString(@"Incomplete All", nil);
- [self toggleListItemsWithoutMoving:presentedListItemsNotMatchingCompletionState undoActionName:undoActionName];
-}
-
-#pragma mark - Undo Helper Methods
-
-- (void)toggleListItemForUndo:(AAPLListItem *)listItem toPreviousIndex:(NSInteger)previousIndex {
- NSAssert([self.presentedListItems containsObject:listItem], @"The list item should already be in the list if it's going to be toggled.");
-
- [self.delegate listPresenterWillChangeListLayout:self isInitialLayout:NO];
-
- // Move the list item.
- NSInteger fromIndex = [self unsafeMoveListItem:listItem toIndex:previousIndex];
-
- // Update the list item's state.
- listItem.complete = !listItem.isComplete;
-
- [self.delegate listPresenter:self didUpdateListItem:listItem atIndex:previousIndex];
-
- [self.delegate listPresenterDidChangeListLayout:self isInitialLayout:NO];
-
- // Undo
- [[self.undoManager prepareWithInvocationTarget:self] toggleListItemForUndo:listItem toPreviousIndex:fromIndex];
-
- NSString *undoActionName = NSLocalizedString(@"Toggle", nil);
- [self.undoManager setActionName:undoActionName];
-}
-
-- (void)insertListItemsForUndo:(NSArray *)listItemsToInsert atIndexes:(NSArray *)indexes {
- NSAssert(listItemsToInsert.count == indexes.count, @"`listItems` must have as many elements as `indexes`.");
-
- [self.delegate listPresenterWillChangeListLayout:self isInitialLayout:NO];
-
- NSMutableArray *listItems = [self.list mutableArrayValueForKey:@"items"];
-
- [listItemsToInsert enumerateObjectsUsingBlock:^(AAPLListItem *listItemToInsert, NSUInteger idx, BOOL *stop) {
- // Get the index that we need to insert `listItem` into.
- NSInteger insertionIndex = [indexes[idx] integerValue];
-
- [listItems insertObject:listItemToInsert atIndex:insertionIndex];
-
- [self.delegate listPresenter:self didInsertListItem:listItemToInsert atIndex:insertionIndex];
- }];
-
- [self.delegate listPresenterDidChangeListLayout:self isInitialLayout:NO];
-
- // Undo
- [[self.undoManager prepareWithInvocationTarget:self] removeListItems:listItemsToInsert];
-
- NSString *undoActionName = NSLocalizedString(@"Remove", nil);
- [self.undoManager setActionName:undoActionName];
-}
-
-- (void)toggleListItemsWithoutMoving:(NSArray *)listItems undoActionName:(NSString *)undoActionName {
- [self.delegate listPresenterWillChangeListLayout:self isInitialLayout:NO];
-
- for (AAPLListItem *listItem in listItems) {
- listItem.complete = !listItem.isComplete;
-
- NSInteger updatedIndex = [self.presentedListItems indexOfObject:listItem];
-
- [self.delegate listPresenter:self didUpdateListItem:listItem atIndex:updatedIndex];
- }
-
- [self.delegate listPresenterDidChangeListLayout:self isInitialLayout:NO];
-
- // Undo
- [[self.undoManager prepareWithInvocationTarget:self] toggleListItemsWithoutMoving:listItems undoActionName:undoActionName];
-
- [self.undoManager setActionName:undoActionName];
-}
-
-#pragma mark - Unsafe Updating Methods
-
-- (void)unsafeInsertListItem:(AAPLListItem *)listItem {
- NSAssert(![self.presentedListItems containsObject:listItem], @"A list item was requested to be added that is already in the list.");
-
- NSInteger indexToInsertListItem = listItem.isComplete ? self.count : 0;
-
- [[self.list mutableArrayValueForKey:@"items"] insertObject:listItem atIndex:indexToInsertListItem];
-
- [self.delegate listPresenter:self didInsertListItem:listItem atIndex:indexToInsertListItem];
-}
-
-- (NSInteger)unsafeMoveListItem:(AAPLListItem *)listItem toIndex:(NSInteger)toIndex {
- NSInteger fromIndex = [self.presentedListItems indexOfObject:listItem];
-
- NSAssert(fromIndex != NSNotFound, @"A list item can only be moved if it already exists in the presented list items.");
-
- NSMutableArray *listItems = [self.list mutableArrayValueForKey:@"items"];
-
- [listItems removeObjectAtIndex:fromIndex];
- [listItems insertObject:listItem atIndex:toIndex];
-
- [self.delegate listPresenter:self didMoveListItem:listItem fromIndex:fromIndex toIndex:toIndex];
-
- return fromIndex;
-}
-
-- (NSInteger)unsafeToggleListItem:(AAPLListItem *)listItem {
- NSAssert([self.presentedListItems containsObject:listItem], @"A list item can only be toggled if it already exists in the list.");
-
- // Move the list item.
- NSInteger targetIndex = listItem.isComplete ? 0 : self.count - 1;
- NSInteger fromIndex = [self unsafeMoveListItem:listItem toIndex:targetIndex];
-
- // Update the list item's state.
- listItem.complete = !listItem.isComplete;
- [self.delegate listPresenter:self didUpdateListItem:listItem atIndex:targetIndex];
-
- return fromIndex;
-}
-
-#pragma mark - Private Convenience Methods
-
-- (NSInteger)indexOfFirstCompleteItem {
- return [self.presentedListItems indexOfObjectPassingTest:^BOOL(AAPLListItem *listItem, NSUInteger idx, BOOL *stop) {
- return listItem.isComplete;
- }];
-}
-
-- (NSArray *)reorderedListItemsFromListItems:(NSArray *)listItems {
- NSPredicate *incompleteListItemsPredicate = [NSPredicate predicateWithFormat:@"isComplete = NO"];
- NSPredicate *completeListItemsPredicate = [NSPredicate predicateWithFormat:@"isComplete = YES"];
-
- NSArray *incompleteListItems = [listItems filteredArrayUsingPredicate:incompleteListItemsPredicate];
- NSArray *completeListItems = [listItems filteredArrayUsingPredicate:completeListItemsPredicate];
-
- return [incompleteListItems arrayByAddingObjectsFromArray:completeListItems];
-}
-
-@end
diff --git a/Lister/Objective-C/Common/AAPLAppConfiguration.h b/Lister/Objective-C/Common/AAPLAppConfiguration.h
deleted file mode 100644
index 1119026b..00000000
--- a/Lister/Objective-C/Common/AAPLAppConfiguration.h
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- Copyright (C) 2015 Apple Inc. All Rights Reserved.
- See LICENSE.txt for this sample’s licensing information
-
- Abstract:
- Handles application configuration logic and information.
-*/
-
-@import Foundation;
-
-typedef NS_ENUM(NSInteger, AAPLAppStorage) {
- AAPLAppStorageNotSet = 0,
- AAPLAppStorageCloud,
- AAPLAppStorageLocal
-};
-
-typedef struct AAPLAppStorageState {
- AAPLAppStorage storageOption;
- BOOL accountDidChange;
- BOOL cloudAvailable;
-} AAPLAppStorageState;
-
-// User activity type names used by the Lister app.
-extern NSString *const AAPLAppConfigurationUserActivityTypeEditing;
-extern NSString *const AAPLAppConfigurationUserActivityTypeWatch;
-
-// Keys used to store relevant list data in the userInfo dictionary of an NSUserActivity for continuation.
-extern NSString *const AAPLAppConfigurationUserActivityListURLPathUserInfoKey;
-extern NSString *const AAPLAppConfigurationUserActivityListColorUserInfoKey;
-
-// Keys used to store information in a WCSession context.
-extern NSString *const AAPLApplicationActivityContextCurrentListsKey;
-extern NSString *const AAPLApplicationActivityContextListNameKey;
-extern NSString *const AAPLApplicationActivityContextListColorKey;
-
-// Constants used in assembling and handling the custom lister:// URL scheme.
-extern NSString *const AAPLAppConfigurationListerSchemeName;
-extern NSString *const AAPLAppConfigurationListerColorQueryKey;
-
-// The identifier for the primary shared application group used for document and defaults storage.
-extern NSString *const AAPLAppConfigurationApplicationGroupsPrimary;
-
-// Constants used when indentifying the file types supported by Lister.
-extern NSString *const AAPLAppConfigurationListerFileUTI;
-extern NSString *const AAPLAppConfigurationListerFileExtension;
-
-// The bundle identifier for the Today widget. Used in communication from the app to the widget.
-extern NSString *const AAPLAppConfigurationWidgetBundleIdentifier;
-
-#if TARGET_OS_MAC
-extern NSString *const AAPLAppConfigurationListerOSXBundleIdentifier;
-#endif
-
-#if TARGET_OS_IOS
-@protocol AAPLListCoordinator;
-@class AAPLListsController;
-#endif
-
-@interface AAPLAppConfiguration : NSObject
-
-+ (AAPLAppConfiguration *)sharedAppConfiguration;
-
-- (void)runHandlerOnFirstLaunch:(void (^)(void))firstLaunchHandler;
-
-@property (nonatomic, readonly, copy) NSString *localizedTodayDocumentName;
-@property (nonatomic, readonly, copy) NSString *localizedTodayDocumentNameAndExtension;
-
-@property (nonatomic, readonly, getter=isCloudAvailable) BOOL cloudAvailable;
-
-@property (nonatomic, readonly, copy) NSString *defaultListerDraftName;
-
-@property (nonatomic, readonly) AAPLAppStorageState storageState;
-
-@property (nonatomic) AAPLAppStorage storageOption;
-
-@property (nonatomic, readonly, getter=isFirstLaunch) BOOL firstLaunch;
-
-#if TARGET_OS_IOS
-
-/*!
- Returns an \c AAPLListCoordinator based on the current configuration that queries based on \c pathExtension.
- For example, if the user has chosen local storage, a local \c AAPLListCoordinator object will be returned.
- */
-- (id)listsCoordinatorForCurrentConfigurationWithPathExtension:(NSString *)pathExtension firstQueryHandler:(void (^)(void))firstQueryHandler;
-
-/*!
- Returns an \c AAPLListCoordinator based on the current configuration that queries based on \c lastPathComponent.
- For example, if the user has chosen local storage, a local \c AAPLListCoordinator object will be returned.
- */
-- (id)listsCoordinatorForCurrentConfigurationWithLastPathComponent:(NSString *)lastPathComponent firstQueryHandler:(void (^)(void))firstQueryHandler;
-
-/*!
- Returns an \c AAPLListsController instance based on the current configuration. For example, if the user has
- chosen local storage, an \c AAPLListsController object will be returned that uses a local list coordinator.
- \c pathExtension is passed down to the list coordinator to filter results.
- */
-- (AAPLListsController *)listsControllerForCurrentConfigurationWithPathExtension:(NSString *)pathExtension firstQueryHandler:(void (^)(void))firstQueryHandler;
-
-/*!
- Returns an \c AAPLListsController instance based on the current configuration. For example, if the user has
- chosen local storage, an \c AAPLListsController object will be returned that uses a local list coordinator.
- \c lastPathComponent is passed down to the list coordinator to filter results.
- */
-- (AAPLListsController *)listsControllerForCurrentConfigurationWithLastPathComponent:(NSString *)lastPathComponent firstQueryHandler:(void (^)(void))firstQueryHandler;
-
-#endif
-
-@end
diff --git a/Lister/Objective-C/Common/AAPLAppConfiguration.m b/Lister/Objective-C/Common/AAPLAppConfiguration.m
deleted file mode 100644
index 6b72de55..00000000
--- a/Lister/Objective-C/Common/AAPLAppConfiguration.m
+++ /dev/null
@@ -1,237 +0,0 @@
-/*
- Copyright (C) 2015 Apple Inc. All Rights Reserved.
- See LICENSE.txt for this sample’s licensing information
-
- Abstract:
- Handles application configuration logic and information.
-*/
-
-#import "AAPLAppConfiguration.h"
-
-#if TARGET_OS_IOS
-#import "AAPLListsController.h"
-#import "AAPLListInfo.h"
-#import "AAPLLocalListCoordinator.h"
-#import "AAPLCloudListCoordinator.h"
-#endif
-
-NSString *const AAPLAppConfigurationFirstLaunchUserDefaultsKey = @"AAPLAppConfigurationFirstLaunchUserDefaultsKey";
-NSString *const AAPLAppConfigurationStorageOptionUserDefaultsKey = @"AAPLAppConfigurationStorageOptionUserDefaultsKey";
-NSString *const AAPLAppConfigurationStoredUbiquityIdentityTokenKey = @"com.example.apple-samplecode.Lister.UbiquityIdentityToken";
-
-NSString *const AAPLAppConfigurationUserActivityTypeEditing = @"com.example.apple-samplecode.Lister.editing";
-NSString *const AAPLAppConfigurationUserActivityTypeWatch = @"com.example.apple-samplecode.Lister.watch";
-
-NSString *const AAPLAppConfigurationUserActivityListURLPathUserInfoKey = @"listURLUserInfoKey";
-NSString *const AAPLAppConfigurationUserActivityListColorUserInfoKey = @"listColorUserInfoKey";
-
-NSString *const AAPLApplicationActivityContextCurrentListsKey = @"ListerCurrentLists";
-NSString *const AAPLApplicationActivityContextListNameKey = @"name";
-NSString *const AAPLApplicationActivityContextListColorKey = @"color";
-
-NSString *const AAPLAppConfigurationListerSchemeName = @"lister";
-NSString *const AAPLAppConfigurationListerColorQueryKey = @"color";
-
-/*!
- The \c LISTER_BUNDLE_PREFIX_STRING preprocessor macro is used below to concatenate the value of the
- \c LISTER_BUNDLE_PREFIX user-defined build setting with other strings. This avoids the need for developers
- to edit both LISTER_BUNDLE_PREFIX and the code below. \c LISTER_BUNDLE_PREFIX_STRING is equal to
- \c @"LISTER_BUNDLE_PREFIX", i.e. an \c NSString literal for the value of \c LISTER_BUNDLE_PREFIX. (Multiple
- \c NSString literals can be concatenated at compile-time to create a new string literal.)
-*/
-NSString *const AAPLAppConfigurationApplicationGroupsPrimary = @"group."LISTER_BUNDLE_PREFIX_STRING@".Lister.Documents";
-
-NSString *const AAPLAppConfigurationListerFileUTI = @"com.example.apple-samplecode.Lister";
-NSString *const AAPLAppConfigurationListerFileExtension = @"list";
-
-#if TARGET_OS_IOS
-NSString *const AAPLAppConfigurationWidgetBundleIdentifier = LISTER_BUNDLE_PREFIX_STRING@".Lister.ListerToday";
-#elif TARGET_OS_MAC
-NSString *const AAPLAppConfigurationWidgetBundleIdentifier = LISTER_BUNDLE_PREFIX_STRING@".ListerOSX.ListerTodayOSX";
-
-NSString *const AAPLAppConfigurationListerOSXBundleIdentifier = LISTER_BUNDLE_PREFIX_STRING@".ListerOSX";
-#endif
-
-@interface AAPLAppConfiguration ()
-
-@property (nonatomic, readonly) NSUserDefaults *applicationUserDefaults;
-
-@property (nonatomic, readwrite, getter=isFirstLaunch) BOOL firstLaunch;
-
-@end
-
-@implementation AAPLAppConfiguration
-
-+ (AAPLAppConfiguration *)sharedAppConfiguration {
- static AAPLAppConfiguration *sharedAppConfiguration;
-
- static dispatch_once_t onceToken;
- dispatch_once(&onceToken, ^{
- sharedAppConfiguration = [[AAPLAppConfiguration alloc] init];
- });
-
- return sharedAppConfiguration;
-}
-
-- (NSString *)localizedTodayDocumentName {
- return NSLocalizedString(@"Today", @"");
-}
-
-- (NSString *)localizedTodayDocumentNameAndExtension {
- return [NSString stringWithFormat:@"%@.%@", self.localizedTodayDocumentName, AAPLAppConfigurationListerFileExtension];
-}
-
-- (NSUserDefaults *)applicationUserDefaults {
- return [[NSUserDefaults alloc] initWithSuiteName:AAPLAppConfigurationApplicationGroupsPrimary];
-}
-
-- (NSString *)defaultListerDraftName {
- return NSLocalizedString(@"List", @"");
-}
-
-#pragma mark - Property Overrides
-
-- (AAPLAppStorage)storageOption {
- NSInteger value = [self.applicationUserDefaults integerForKey:AAPLAppConfigurationStorageOptionUserDefaultsKey];
-
- return (AAPLAppStorage)value;
-}
-
-- (void)setStorageOption:(AAPLAppStorage)storageOption {
- [self.applicationUserDefaults setInteger:storageOption forKey:AAPLAppConfigurationStorageOptionUserDefaultsKey];
-}
-
-- (BOOL)isCloudAvailable {
- return [[NSFileManager defaultManager] ubiquityIdentityToken] != nil;
-}
-
-- (AAPLAppStorageState)storageState {
- return (AAPLAppStorageState) {
- .storageOption = self.storageOption,
- .accountDidChange = [self hasUbiquityIdentityChanged],
- .cloudAvailable = self.isCloudAvailable
- };
-}
-
-- (BOOL)isFirstLaunch {
- [self registerDefaults];
-
- return [self.applicationUserDefaults boolForKey:AAPLAppConfigurationFirstLaunchUserDefaultsKey];
-}
-
-- (void)setFirstLaunch:(BOOL)firstLaunch {
- [self.applicationUserDefaults setBool:firstLaunch forKey:AAPLAppConfigurationFirstLaunchUserDefaultsKey];
-}
-
-- (void)registerDefaults {
- NSUserDefaults *defaults = self.applicationUserDefaults;
-
- [defaults registerDefaults:@{
- AAPLAppConfigurationFirstLaunchUserDefaultsKey: @YES,
-#if TARGET_OS_IOS
- AAPLAppConfigurationStorageOptionUserDefaultsKey: @(AAPLAppStorageNotSet)
-#endif
- }];
-}
-
-- (void)runHandlerOnFirstLaunch:(void (^)(void))firstLaunchHandler {
- if (self.isFirstLaunch) {
- self.firstLaunch = NO;
-
- firstLaunchHandler();
- }
-}
-
-#pragma mark - Ubiquity Identity Token Handling (Account Change Info)
-
-- (BOOL)hasUbiquityIdentityChanged {
- BOOL hasChanged = NO;
-
- id currentToken = [NSFileManager defaultManager].ubiquityIdentityToken;
- id storedToken = [self storedUbiquityIdentityToken];
-
- BOOL currentTokenNilStoredNonNil = !currentToken && storedToken;
- BOOL storedTokenNilCurrentNonNil = !storedToken && currentToken;
- BOOL currentNotEqualStored = currentToken && storedToken && ![currentToken isEqual:storedToken];
-
- if (currentTokenNilStoredNonNil || storedTokenNilCurrentNonNil || currentNotEqualStored) {
- [self persistAccount];
-
- hasChanged = YES;
- }
-
- return hasChanged;
-}
-
-- (void)persistAccount {
- NSUserDefaults *defaults = self.applicationUserDefaults;
- id token = [NSFileManager defaultManager].ubiquityIdentityToken;
-
- if (token) {
- // The account has changed.
- NSData *ubiquityIdentityTokenArchive = [NSKeyedArchiver archivedDataWithRootObject:token];
-
- [defaults setObject:ubiquityIdentityTokenArchive forKey:AAPLAppConfigurationStoredUbiquityIdentityTokenKey];
- }
- else {
- // There is no signed-in account.
- [defaults removeObjectForKey:AAPLAppConfigurationStoredUbiquityIdentityTokenKey];
- }
-}
-
-- (id)storedUbiquityIdentityToken {
- id storedToken = nil;
-
- // Determine if the iCloud account associated with this device has changed since the last time the user launched the app.
- NSData *ubiquityIdentityTokenArchive = [self.applicationUserDefaults objectForKey:AAPLAppConfigurationStoredUbiquityIdentityTokenKey];
-
- if (ubiquityIdentityTokenArchive) {
- storedToken = [NSKeyedUnarchiver unarchiveObjectWithData:ubiquityIdentityTokenArchive];
- }
-
- return storedToken;
-}
-
-#pragma mark - Conveience Methods
-
-#if TARGET_OS_IOS
-
-- (id)listsCoordinatorForCurrentConfigurationWithPathExtension:(NSString *)pathExtension firstQueryHandler:(void (^)(void))firstQueryHandler; {
- if ([AAPLAppConfiguration sharedAppConfiguration].storageOption != AAPLAppStorageCloud) {
- // This will be called if the storage option is either `AAPLAppStorageLocal` or `AAPLAppStorageNotSet`.
- return [[AAPLLocalListCoordinator alloc] initWithPathExtension:pathExtension firstQueryUpdateHandler:firstQueryHandler];
- }
- else {
- return [[AAPLCloudListCoordinator alloc] initWithPathExtension:pathExtension firstQueryUpdateHandler:firstQueryHandler];
- }
-}
-
-- (id)listsCoordinatorForCurrentConfigurationWithLastPathComponent:(NSString *)lastPathComponent firstQueryHandler:(void (^)(void))firstQueryHandler {
- if ([AAPLAppConfiguration sharedAppConfiguration].storageOption != AAPLAppStorageCloud) {
- // This will be called if the storage option is either `AAPLAppStorageLocal` or `AAPLAppStorageNotSet`.
- return [[AAPLLocalListCoordinator alloc] initWithLastPathComponent:lastPathComponent firstQueryUpdateHandler:firstQueryHandler];
- }
- else {
- return [[AAPLCloudListCoordinator alloc] initWithLastPathComponent:lastPathComponent firstQueryUpdateHandler:firstQueryHandler];
- }
-}
-
-- (AAPLListsController *)listsControllerForCurrentConfigurationWithPathExtension:(NSString *)pathExtension firstQueryHandler:(void (^)(void))firstQueryHandler {
- id listCoordinator = [self listsCoordinatorForCurrentConfigurationWithPathExtension:pathExtension firstQueryHandler:firstQueryHandler];
-
- return [[AAPLListsController alloc] initWithListCoordinator:listCoordinator delegateQueue:[NSOperationQueue mainQueue] sortComparator:^NSComparisonResult(AAPLListInfo *lhs, AAPLListInfo *rhs) {
- return [lhs.name localizedCaseInsensitiveCompare:rhs.name];
- }];
-}
-
-- (AAPLListsController *)listsControllerForCurrentConfigurationWithLastPathComponent:(NSString *)lastPathComponent firstQueryHandler:(void (^)(void))firstQueryHandler {
- id listCoordinator = [self listsCoordinatorForCurrentConfigurationWithLastPathComponent:lastPathComponent firstQueryHandler:firstQueryHandler];
-
- return [[AAPLListsController alloc] initWithListCoordinator:listCoordinator delegateQueue:[NSOperationQueue mainQueue] sortComparator:^NSComparisonResult(AAPLListInfo *lhs, AAPLListInfo *rhs) {
- return [lhs.name localizedCaseInsensitiveCompare:rhs.name];
- }];
-}
-
-#endif
-
-@end
diff --git a/Lister/Objective-C/Common/AAPLCheckBoxLayer.h b/Lister/Objective-C/Common/AAPLCheckBoxLayer.h
deleted file mode 100644
index b8cc0b4d..00000000
--- a/Lister/Objective-C/Common/AAPLCheckBoxLayer.h
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- Copyright (C) 2015 Apple Inc. All Rights Reserved.
- See LICENSE.txt for this sample’s licensing information
-
- Abstract:
- A \c CALayer subclass that draws a check box within its layer. This is shared between ListerKit on iOS and OS X to draw their respective \c AAPLCheckBox controls.
-*/
-
-@import QuartzCore;
-
-@interface AAPLCheckBoxLayer : CALayer
-
-@property CGColorRef tintColor;
-
-@property (getter=isChecked) BOOL checked;
-
-@property CGFloat strokeFactor;
-@property CGFloat insetFactor;
-@property CGFloat markInsetFactor;
-
-@end
diff --git a/Lister/Objective-C/Common/AAPLCheckBoxLayer.m b/Lister/Objective-C/Common/AAPLCheckBoxLayer.m
deleted file mode 100644
index c42b1127..00000000
--- a/Lister/Objective-C/Common/AAPLCheckBoxLayer.m
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- Copyright (C) 2015 Apple Inc. All Rights Reserved.
- See LICENSE.txt for this sample’s licensing information
-
- Abstract:
- A \c CALayer subclass that draws a check box within its layer. This is shared between ListerKit on iOS and OS X to draw their respective \c AAPLCheckBox controls.
-*/
-
-#import "AAPLCheckBoxLayer.h"
-
-@implementation AAPLCheckBoxLayer
-@synthesize tintColor = _tintColor;
-@synthesize checked = _checked;
-
-+ (BOOL)needsDisplayForKey:(NSString *)key {
- if ([@[@"tintColor", @"checked", @"strokeFactor", @"insetFactor", @"markInsetFactor"] containsObject:key]) {
- return YES;
- }
-
- return [super needsDisplayForKey:key];
-}
-
-- (instancetype)init {
-
- self = [super init];
-
- if (self) {
- CGFloat components[] = {0.5, 0.5, 0.5};
- _tintColor = CGColorCreate(CGColorSpaceCreateDeviceRGB(), components);
-
- _strokeFactor = 0.07;
- _insetFactor = 0.17;
- _markInsetFactor = 0.34;
- }
-
- return self;
-}
-
-- (void)drawInContext:(CGContextRef)context {
- [super drawInContext:context];
-
- const CGFloat size = MIN(self.bounds.size.width, self.bounds.size.height);
-
- CGAffineTransform transform = self.affineTransform;
-
- CGFloat xTranslate = 0;
- CGFloat yTranslate = 0;
-
- if (self.bounds.size.width < self.bounds.size.height) {
- yTranslate = (self.bounds.size.height - size)/2.f;
- }
- else {
- xTranslate = (self.bounds.size.width - size)/2.f;
- }
- transform = CGAffineTransformTranslate(transform, xTranslate, yTranslate);
-
- const CGFloat strokeWidth = self.strokeFactor * size;
- const CGFloat checkBoxInset = self.insetFactor * size;
-
- // Create the outer border for the check box.
- CGFloat outerDimension = size - 2.0 * checkBoxInset;
- CGRect checkBoxRect = CGRectMake(checkBoxInset, checkBoxInset, outerDimension, outerDimension);
- checkBoxRect = CGRectApplyAffineTransform(checkBoxRect, transform);
-
- // Make the desired width of the outer box.
- CGContextSetLineWidth(context, strokeWidth);
-
- // Set the tint color of the outer box.
- CGContextSetStrokeColorWithColor(context, self.tintColor);
-
- // Draw the outer box.
- CGContextStrokeRect(context, checkBoxRect);
-
- // Draw the inner box if it's checked.
- if (self.isChecked) {
- const CGFloat markInset = self.markInsetFactor * size;
-
- const CGFloat markDimension = size - 2.0 * markInset;
- CGRect markRect = CGRectMake(markInset, markInset, markDimension, markDimension);
- markRect = CGRectApplyAffineTransform(markRect, transform);
-
- CGContextSetFillColorWithColor(context, self.tintColor);
- CGContextFillRect(context, markRect);
- }
-}
-
-- (void)setTintColor:(CGColorRef)tintColor {
- if (!CGColorEqualToColor(_tintColor, tintColor)) {
- _tintColor = tintColor;
-
- [self setNeedsDisplay];
- }
-}
-
-- (CGColorRef)tintColor {
- return _tintColor;
-}
-
-- (void)setChecked:(BOOL)checked {
- if (_checked != checked) {
- _checked = checked;
-
- [self setNeedsDisplay];
- }
-}
-
-- (BOOL)isChecked {
- return _checked;
-}
-
-@end
diff --git a/Lister/Objective-C/Common/AAPLIncompleteListItemsPresenter.h b/Lister/Objective-C/Common/AAPLIncompleteListItemsPresenter.h
deleted file mode 100644
index 06ab3e7f..00000000
--- a/Lister/Objective-C/Common/AAPLIncompleteListItemsPresenter.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- Copyright (C) 2015 Apple Inc. All Rights Reserved.
- See LICENSE.txt for this sample’s licensing information
-
- Abstract:
- The implementation for the \c AAPLIncompleteListItemsPresenter type. This class is responsible for managing how a list is presented in the iOS and OS X app Today widgets, as well as the Lister WatchKit application.
-*/
-
-#import "AAPLListPresenting.h"
-
-@class AAPLListItem;
-
-/*!
- The \c AAPLIncompleteListItemsPresenter list presenter is responsible for managing the how a list's
- incomplete list items are displayed in the iOS and OS X Today widgets as well as the Lister WatchKit app.
- The \c AAPLIncompleteListItemsPresenter class conforms to \c AAPLListPresenting so consumers of this class
- can work with the presenter using a common interface.
-
- When a list is initially presented with an \c AAPLIncompleteListItemsPresenter, only the incomplete list
- items are presented. That can change, however, if a user toggles list items (changing the list item's
- completion state). An \c AAPLIncompleteListItemsPresenter always shows the list items that are initially
- presented (unless they are removed from the list from another device). If an \c
- AAPLIncompleteListItemsPresenter stops presenting a list that has some presented list items that are complete
- (after toggling them) and another \c AAPLIncompleteListItemsPresenter presents the same list, the presenter
- displays *only* the incomplete list items.
-
- The \c AAPLIncompleteListItemsPresenter can be interacted with in a two ways. \c AAPLListItem instances can
- be toggled individually, or using a batch update, and the color of the list presenter can be changed. All
- of these methods trigger calls to the delegate to be notified about inserted list items, removed list
- items, updated list items, etc.
- */
-@interface AAPLIncompleteListItemsPresenter : NSObject
-
-/*!
- Toggles \c listItem within the list. This method keeps the list item in the same place, but it toggles the
- completion state of the list item. Toggling a list item will call the delegate's \c
- -listPresenter:didUpdateListItem:atIndex: method.
-
- \param listItem
- The list item to toggle.
- */
-- (void)toggleListItem:(AAPLListItem *)listItem;
-
-/*!
- Sets all of the presented list item's completion states to \c completionState. This method does not move the
- list items around whatsoever. Changing the completion state on all of the list items will call the
- delegate's \c -listPresenter:didUpdateListItem:atIndex: method for each list item that has been updated.
-
- \param completionState
- The value that all presented list item instances should have as their \c isComplete property.
- */
-- (void)updatePresentedListItemsToCompletionState:(BOOL)completionState;
-
-@end
diff --git a/Lister/Objective-C/Common/AAPLIncompleteListItemsPresenter.m b/Lister/Objective-C/Common/AAPLIncompleteListItemsPresenter.m
deleted file mode 100644
index f5f70c31..00000000
--- a/Lister/Objective-C/Common/AAPLIncompleteListItemsPresenter.m
+++ /dev/null
@@ -1,224 +0,0 @@
-/*
- Copyright (C) 2015 Apple Inc. All Rights Reserved.
- See LICENSE.txt for this sample’s licensing information
-
- Abstract:
- The implementation for the \c AAPLIncompleteListItemsPresenter type. This class is responsible for managing how a list is presented in the iOS and OS X app Today widgets, as well as the Lister WatchKit application.
-*/
-
-#import "AAPLIncompleteListItemsPresenter.h"
-#import "AAPLListPresenterDelegate.h"
-#import "AAPLListPresenterUtilities.h"
-#import "AAPLListPresenterAlgorithms.h"
-#import "AAPLListItem.h"
-
-@interface AAPLIncompleteListItemsPresenter ()
-
-/// The internal storage for the list that we're presenting. By default, it's an empty list.
-@property (nonatomic, readwrite) AAPLList *list;
-
-/// Flag to see whether or not the first \c -setList: call should trigger a batch reload.
-@property (getter=isInitialList) BOOL initialList;
-
-/*!
- A cached array of the list items that should be presented. When the presenter initially has its underlying \c list
- set, the \c presentedListItems is set to all of the incomplete list items. As list items are toggled, \c presentedListItems
- may not only contain incomplete list items. Note that we've named the property \c presentedListItems since
- there's already a readonly \c presentedListItems property (which returns the value of \c presentedListItems).
- */
-@property (readwrite, copy) NSArray *presentedListItems;
-
-@end
-
-@implementation AAPLIncompleteListItemsPresenter
-@synthesize delegate = _delegate;
-@dynamic color;
-
-#pragma mark - AAPLListItemPresenter
-
-- (instancetype)init {
- self = [super init];
-
- if (self) {
- // Use a default, empty list.
- _list = [[AAPLList alloc] initWithColor:AAPLListColorGray items:@[]];
- _initialList = YES;
-
- _presentedListItems = [NSArray array];
- }
-
- return self;
-}
-
-- (void)setColor:(AAPLListColor)color {
- AAPLUpdateListColorForListPresenterIfDifferent(self, self.list, color, AAPLListColorUpdateActionSendDelegateChangeLayoutCallsForNonInitialLayout);
-}
-
-- (AAPLListColor)color {
- return self.list.color;
-}
-
-- (AAPLList *)archiveableList {
- return self.list;
-}
-
-/*!
- This methods determines the diff betwen the current list and the new list provided and notifies the delegate
- accordingly. The delegate will be notified of all changes except for reordering list items (an implementation
- detail). If the list is the initial list to be presented, we just reload all of the data.
- */
-- (void)setList:(AAPLList *)newList {
- // If this is the initial list that's being presented, just tell the delegate to reload all of the data.
- if (self.isInitialList) {
- self.initialList = NO;
-
- _list = newList;
-
- NSPredicate *incompleteListItemsFilterPredicate = [NSPredicate predicateWithFormat:@"isComplete == NO"];
- self.presentedListItems = [newList.items filteredArrayUsingPredicate:incompleteListItemsFilterPredicate];
-
- [self.delegate listPresenterDidRefreshCompleteLayout:self];
-
- return;
- }
-
- /**
- First find all the differences between the lists that we want to reflect in the presentation
- of the list: removed list items that were incomplete, inserted list items that are incomplete, presented list items
- that are toggled, and presented list items whose text has changed. Note that although we'll gradually
- update presentedListItems to reflect the changes we find, we also want to save the latest state of
- the list (i.e. the `newList` parameter) as the underlying storage of the list. Since we'll be presenting
- the same list either way, it's better not to change the underlying list representation unless we need
- to. Keep in mind, however, that all of the list items in presentedListItems should also be in `list.items`.
- In short, once we modify `presentedListItems` with all of the changes, we need to also update `list.items`
- to contain all of the list items that were unchanged (this can be done by replacing the new list item
- representation by the old representation of the list item). Once that happens, all of the presentation
- logic carries on as normal.
- */
- AAPLList *oldList = self.list;
-
- NSArray *newRemovedPresentedListItems = AAPLFindRemovedListItemsFromInitialListItemsToChangedListItems(self.presentedListItems, newList.items);
- NSArray *newInsertedIncompleteListItems = AAPLFindInsertedListItemsFromInitialListItemsToChangedListItems(self.presentedListItems, newList.items, ^BOOL(AAPLListItem *listItem) {
- return !listItem.isComplete;
- });
- NSArray *newPresentedToggledListItems = AAPLFindToggledListItemsFromInitialListItemsToChangedListItems(self.presentedListItems, newList.items);
- NSArray *newPresentedListItemsWithUpdatedText = AAPLFindListItemsWithUpdatedTextFromInitialListItemsToChangedListItems(self.presentedListItems, newList.items);
-
- AAPLListItemsBatchChangeKind listItemsBatchChangeKind = AAPLListItemsBatchChangeKindForChanges(newRemovedPresentedListItems, newInsertedIncompleteListItems, newPresentedToggledListItems, newPresentedListItemsWithUpdatedText);
-
- // If no changes occured we'll ignore the update.
- if (listItemsBatchChangeKind == AAPLListItemsBatchChangeKindNone && oldList.color == newList.color) {
- return;
- }
-
- // Start performing changes to the presentation of the list.
- [self.delegate listPresenterWillChangeListLayout:self isInitialLayout:YES];
-
- NSMutableArray *presentedListItemsProxy = [self mutableArrayValueForKey:@"presentedListItems"];
-
- // Remove the list items from the presented list items that were removed somewhere else.
- if (newRemovedPresentedListItems.count > 0) {
- AAPLRemoveListItemsFromListItemsWithListPresenter(self, presentedListItemsProxy, newRemovedPresentedListItems);
- }
-
- // Insert the incomplete list items into the presented list items that were inserted elsewhere.
- if (newInsertedIncompleteListItems.count > 0) {
- AAPLInsertListItemsIntoListItemsWithListPresenter(self, presentedListItemsProxy, newInsertedIncompleteListItems);
- }
-
- /**
- For all of the list items whose content has changed elsewhere, we need to update the list items in place.
- Since the `AAPLIncompleteListItemsPresenter` keeps toggled list items in place, we only need to perform one
- update for list items that have a different completion state and text. We'll batch both of these changes
- into a single update.
- */
- if (newPresentedToggledListItems.count > 0 || newPresentedListItemsWithUpdatedText.count > 0) {
- // Find the unique list of list items that are updated.
- NSMutableSet *uniqueUpdatedListItemsSet = [NSMutableSet setWithArray:newPresentedToggledListItems];
- [uniqueUpdatedListItemsSet addObjectsFromArray:newPresentedListItemsWithUpdatedText];
-
- AAPLUpdateListItemsWithListItemsForListPresenter(self, presentedListItemsProxy, uniqueUpdatedListItemsSet.allObjects);
- }
-
- /**
- At this point the presented list items have been updated. As mentioned before, to ensure that we're
- consistent about how we persist the updated list, we'll just use new the new list as the underlying
- model. To do that we'll need to update the new list's unchanged list items with the list items that
- are stored in the visual list items. i.e. We need to make sure that any references to list items in
- `presentedListItems` are reflected in the new list's items.
- */
- _list = newList;
-
- // Obtain the presented list items that were unchanged. We need to update the new list to reference the old list items.
- NSPredicate *unboundFindUnchangedPresentedListItemsPredicate = [NSPredicate predicateWithFormat:@"!(self in $newRemovedPresentedListItems) && !(self in $newInsertedIncompleteListItems) && !(self in $newPresentedToggledListItems) && !(self in $newPresentedListItemsWithUpdatedText)"];
-
- NSPredicate *findUnchangedPresentedListItemsPredicate = [unboundFindUnchangedPresentedListItemsPredicate predicateWithSubstitutionVariables:@{
- @"newRemovedPresentedListItems": newRemovedPresentedListItems,
- @"newInsertedIncompleteListItems": newInsertedIncompleteListItems,
- @"newPresentedToggledListItems": newPresentedToggledListItems,
- @"newPresentedListItemsWithUpdatedText": newPresentedListItemsWithUpdatedText
- }];
-
- NSArray *unchangedPresentedListItems = [self.presentedListItems filteredArrayUsingPredicate:findUnchangedPresentedListItemsPredicate];
-
- NSMutableArray *listItemsProxy = [self.list mutableArrayValueForKey:@"items"];
-
- AAPLReplaceAnyEqualUnchangedNewListItemsWithPreviousUnchangedListItems(listItemsProxy, unchangedPresentedListItems);
-
- /**
- Even though the old list's color will change if there's a difference between the old list's color and
- the new list's color, the delegate only cares about this change in reference to what it already knows.
- Because the delegate hasn't seen a color change yet, the update (if it happens) is ok.
- */
- AAPLUpdateListColorForListPresenterIfDifferent(self, oldList, newList.color, AAPLListColorUpdateActionDontSendDelegateChangeLayoutCalls);
-
- [self.delegate listPresenterDidChangeListLayout:self isInitialLayout:YES];
-}
-
-- (NSInteger)count {
- return self.presentedListItems.count;
-}
-
-- (BOOL)isEmpty {
- return self.presentedListItems.count == 0;
-}
-
-#pragma mark - Public Methods
-
-- (void)toggleListItem:(AAPLListItem *)listItem {
- NSAssert([self.presentedListItems containsObject:listItem], @"The list item must already be in the presented list items.");
-
- [self.delegate listPresenterWillChangeListLayout:self isInitialLayout:NO];
-
- listItem.complete = !listItem.isComplete;
-
- NSInteger currentIndex = [self.presentedListItems indexOfObject:listItem];
-
- [self.delegate listPresenter:self didUpdateListItem:listItem atIndex:currentIndex];
-
- [self.delegate listPresenterDidChangeListLayout:self isInitialLayout:NO];
-}
-
-- (void)updatePresentedListItemsToCompletionState:(BOOL)completionState {
- NSPredicate *filterPredicate = [NSPredicate predicateWithFormat:@"isComplete != %@", @(completionState)];
- NSArray *presentedListItemsNotMatchingCompletionState = [self.presentedListItems filteredArrayUsingPredicate:filterPredicate];
-
- // If there are no list items that match the completion state, it's a no op.
- if (presentedListItemsNotMatchingCompletionState.count == 0) {
- return;
- }
-
- [self.delegate listPresenterWillChangeListLayout:self isInitialLayout:NO];
-
- for (AAPLListItem *listItem in presentedListItemsNotMatchingCompletionState) {
- listItem.complete = !listItem.isComplete;
-
- NSInteger indexOfListItem = [self.presentedListItems indexOfObject:listItem];
-
- [self.delegate listPresenter:self didUpdateListItem:listItem atIndex:indexOfListItem];
- }
-
- [self.delegate listPresenterDidChangeListLayout:self isInitialLayout:NO];
-}
-
-@end
diff --git a/Lister/Objective-C/Common/AAPLList.h b/Lister/Objective-C/Common/AAPLList.h
deleted file mode 100644
index a4209570..00000000
--- a/Lister/Objective-C/Common/AAPLList.h
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- Copyright (C) 2015 Apple Inc. All Rights Reserved.
- See LICENSE.txt for this sample’s licensing information
-
- Abstract:
- The \c AAPLList class manages a list of items and the color of the list.
-*/
-
-@import Foundation;
-
-@class AAPLListItem;
-
-/*!
- The possible colors a list can have.
- */
-typedef NS_ENUM(NSInteger, AAPLListColor) {
- AAPLListColorGray = 0,
- AAPLListColorBlue,
- AAPLListColorGreen,
- AAPLListColorYellow,
- AAPLListColorOrange,
- AAPLListColorRed
-};
-
-/*!
- Returns the name of \c listColor in a human readable form. As an example, \c AAPLNameFromListColor(AAPLListColorRed)
- returns the string \c @"Red".
-
- \param listColor
- The list color to determine the name of.
-
- \returns
- The human readable representation of the color as a string.
- */
-NSString *AAPLNameFromListColor(AAPLListColor listColor);
-
-/*!
- The \c AAPLList class manages the color of a list and each \c AAPLListItem, including the order of
- the list. Incomplete items are located at the start of the items array, followed by complete list
- items. There are many convenience methods on the \c AAPLList class to query whether an item can be
- moved or inserted at a certain index, to perform those move and insert operations, to toggle an
- item between a complete and incomplete state, and to fetch list items by index. Note that in order
- to be able to archive and unarchive \c AAPLList objects in both the Objective-C and Swift versions
- of the app, the Swift version of the app ensures that the runtime name of its \c List object is
- also \c AAPLList.
- */
-@interface AAPLList : NSObject
-
-/*!
- Initializes an \c AAPLList instance with the designated color and items.
-
- \param color
- The intended color of the list.
-
- \param items
- The items that represent the underlying list. The \c AAPLList class copies the items in
- initialization.
- */
-- (instancetype)initWithColor:(AAPLListColor)color items:(NSArray *)items;
-
-/*!
- The list's color. This property is stored when it is archived and read when it is unarchived.
- */
-@property AAPLListColor color;
-
-/*!
- \returns
- A copy of the list items. The underlying items are stored when the list is archived and read when
- they are unarchived.
- */
-@property (copy) NSArray *items;
-
-/*!
- Determines whether or not a list is equal to another list. This is a specialization of \c -isEqual:
- that is specific for instances of \c AAPLList.
-
- \param
- list Any list.
-
- \returns
- \c YES if the list has the same color and items as the receiving instance. \c NO otherwise.
- */
-- (BOOL)isEqualToList:(AAPLList *)list;
-
-@end
diff --git a/Lister/Objective-C/Common/AAPLList.m b/Lister/Objective-C/Common/AAPLList.m
deleted file mode 100644
index 859f925d..00000000
--- a/Lister/Objective-C/Common/AAPLList.m
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- Copyright (C) 2015 Apple Inc. All Rights Reserved.
- See LICENSE.txt for this sample’s licensing information
-
- Abstract:
- The \c AAPLList class manages a list of items and the color of the list.
-*/
-
-#import "AAPLList.h"
-#import "AAPLListItem.h"
-
-NSString *AAPLNameFromListColor(AAPLListColor listColor) {
- switch (listColor) {
- case AAPLListColorGray: return @"Gray";
- case AAPLListColorBlue: return @"Blue";
- case AAPLListColorGreen: return @"Green";
- case AAPLListColorYellow: return @"Yellow";
- case AAPLListColorOrange: return @"Orange";
- case AAPLListColorRed: return @"Red";
- }
-}
-
-/*!
- String constants that are used to archive the stored properties of an \c AAPLListItem.
- These constants are used to help implement \c NSCoding.
-*/
-NSString *const AAPLListEncodingItemsKey = @"items";
-NSString *const AAPLListEncodingColorKey = @"color";
-
-@implementation AAPLList
-
-#pragma mark - Initialization
-
-- (instancetype)initWithColor:(AAPLListColor)color items:(NSArray *)items {
- self = [super init];
-
- if (self) {
- _items = [[NSArray alloc] initWithArray:items copyItems:YES];
- _color = color;
- }
-
- return self;
-}
-
-#pragma mark - NSCoding
-
-- (id)initWithCoder:(NSCoder *)aDecoder {
- self = [super init];
-
- if (self) {
- _items = [[aDecoder decodeObjectForKey:AAPLListEncodingItemsKey] copy];
-
- _color = (AAPLListColor)[aDecoder decodeIntegerForKey:AAPLListEncodingColorKey];
- }
-
- return self;
-}
-
-- (void)encodeWithCoder:(NSCoder *)aCoder {
- [aCoder encodeObject:self.items forKey:AAPLListEncodingItemsKey];
- [aCoder encodeInteger:self.color forKey:AAPLListEncodingColorKey];
-}
-
-#pragma mark - NSCopying
-
-- (id)copyWithZone:(NSZone *)zone {
- return [[AAPLList alloc] initWithColor:self.color items:self.items];
-}
-
-#pragma mark - Equality
-
-- (BOOL)isEqual:(id)object {
- if ([object isKindOfClass:[AAPLList class]]) {
- return [self isEqualToList:object];
- }
-
- return NO;
-}
-
-- (BOOL)isEqualToList:(AAPLList *)list {
- if (self.color != list.color) {
- return NO;
- }
-
- return [self.items isEqualToArray:list.items];
-}
-
-#pragma mark - Debugging
-
-- (NSString *)debugDescription {
- return [NSString stringWithFormat:@"{color: %@, items: %@}", AAPLNameFromListColor(self.color), self.items];
-}
-
-@end
diff --git a/Lister/Objective-C/Common/AAPLListColor+UI.h b/Lister/Objective-C/Common/AAPLListColor+UI.h
deleted file mode 100644
index 860f39e5..00000000
--- a/Lister/Objective-C/Common/AAPLListColor+UI.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- Copyright (C) 2015 Apple Inc. All Rights Reserved.
- See LICENSE.txt for this sample’s licensing information
-
- Abstract:
- Enhancements for the \c AAPLListColor enumeration that add the ability to obtain a platform-specific color object from the enumeration value.
-*/
-
-@import Foundation;
-#import "AAPLList.h"
-
-#if TARGET_OS_IOS || TARGET_OS_WATCH
-
-@import UIKit;
-#define AAPLAppColor UIColor
-
-#elif TARGET_OS_MAC
-
-@import Cocoa;
-#define AAPLAppColor NSColor
-
-#endif
-
-/// Returns the platform-specific color that is reprsented by \c listColor.
-AAPLAppColor *AAPLColorFromListColor(AAPLListColor listColor);
-
-/// Returns the platform-specific color that is reprsented by \c listColor for use in Notifcation Center.
-AAPLAppColor *AAPLColorFromListColorForNotificationCenter(AAPLListColor listColor);
-
-#undef AAPLAppColor
\ No newline at end of file
diff --git a/Lister/Objective-C/Common/AAPLListColor+UI.m b/Lister/Objective-C/Common/AAPLListColor+UI.m
deleted file mode 100644
index 5566b699..00000000
--- a/Lister/Objective-C/Common/AAPLListColor+UI.m
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- Copyright (C) 2015 Apple Inc. All Rights Reserved.
- See LICENSE.txt for this sample’s licensing information
-
- Abstract:
- Enhancements for the \c AAPLListColor enumeration that add the ability to obtain a platform-specific color object from the enumeration value.
-*/
-
-#import "AAPLListColor+UI.h"
-
-#if TARGET_OS_IOS || TARGET_OS_WATCH
-#define AAPLAppColor UIColor
-#elif TARGET_OS_MAC
-#define AAPLAppColor NSColor
-#endif
-
-AAPLAppColor *AAPLColorFromListColor(AAPLListColor listColor) {
- static AAPLAppColor *_grayColor = nil;
- static AAPLAppColor *_blueColor = nil;
- static AAPLAppColor *_greenColor = nil;
- static AAPLAppColor *_yellowColor = nil;
- static AAPLAppColor *_orangeColor = nil;
- static AAPLAppColor *_redColor = nil;
-
- static dispatch_once_t onceToken;
- dispatch_once(&onceToken, ^{
- _grayColor = [AAPLAppColor darkGrayColor];
- _blueColor = [AAPLAppColor colorWithRed:0.42 green:0.70 blue:0.88 alpha:1];
- _greenColor = [AAPLAppColor colorWithRed:0.71 green:0.84 blue:0.31 alpha:1];
- _yellowColor = [AAPLAppColor colorWithRed:0.95 green:0.88 blue:0.15 alpha:1];
- _orangeColor = [AAPLAppColor colorWithRed:0.96 green:0.63 blue:0.20 alpha:1];
- _redColor = [AAPLAppColor colorWithRed:0.96 green:0.42 blue:0.42 alpha:1];
- });
-
- switch (listColor) {
- case AAPLListColorGray: return _grayColor;
- case AAPLListColorBlue: return _blueColor;
- case AAPLListColorGreen: return _greenColor;
- case AAPLListColorYellow: return _yellowColor;
- case AAPLListColorOrange: return _orangeColor;
- case AAPLListColorRed: return _redColor;
- }
-
- return nil;
-}
-
-AAPLAppColor *AAPLColorFromListColorForNotificationCenter(AAPLListColor listColor) {
- static AAPLAppColor *_grayColor = nil;
- static AAPLAppColor *_blueColor = nil;
- static AAPLAppColor *_greenColor = nil;
- static AAPLAppColor *_yellowColor = nil;
- static AAPLAppColor *_orangeColor = nil;
- static AAPLAppColor *_redColor = nil;
-
- static dispatch_once_t onceToken;
- dispatch_once(&onceToken, ^{
- _grayColor = [AAPLAppColor lightGrayColor];
- _blueColor = [AAPLAppColor colorWithRed:0.42 green:0.70 blue:0.88 alpha:1];
- _greenColor = [AAPLAppColor colorWithRed:0.71 green:0.84 blue:0.31 alpha:1];
- _yellowColor = [AAPLAppColor colorWithRed:0.95 green:0.88 blue:0.15 alpha:1];
- _orangeColor = [AAPLAppColor colorWithRed:0.96 green:0.63 blue:0.20 alpha:1];
- _redColor = [AAPLAppColor colorWithRed:0.96 green:0.42 blue:0.42 alpha:1];
- });
-
- switch (listColor) {
- case AAPLListColorGray: return _grayColor;
- case AAPLListColorBlue: return _blueColor;
- case AAPLListColorGreen: return _greenColor;
- case AAPLListColorYellow: return _yellowColor;
- case AAPLListColorOrange: return _orangeColor;
- case AAPLListColorRed: return _redColor;
- }
-
- return nil;
-}
-
-#undef AAPLAppColor
\ No newline at end of file
diff --git a/Lister/Objective-C/Common/AAPLListItem.h b/Lister/Objective-C/Common/AAPLListItem.h
deleted file mode 100644
index 7ad988ef..00000000
--- a/Lister/Objective-C/Common/AAPLListItem.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- Copyright (C) 2015 Apple Inc. All Rights Reserved.
- See LICENSE.txt for this sample’s licensing information
-
- Abstract:
- The \c AAPLListItem class represents the text and completion state of a single item in the list.
-*/
-
-@import Foundation;
-
-/*!
- An \c AAPLListItem object is composed of a text property, a completion status, and an underlying
- opaque identity that distinguishes one \c AAPLListItem object from another. Note that in order to
- be able to archive and unarchive \c AAPLListItem objects in both the Objective-C and Swift versions
- of the app, the Swift version of the app ensures that the runtime name of its \c AAPLListItem object
- is also \c AAPLListItem.
- */
-@interface AAPLListItem : NSObject
-
-/*!
- Initializes an \c AAPLListItem instance with the designated text and completion state.
-
- \param text
- The intended text content of the list item.
-
- \param complete
- The item's initial completion state.
- */
-- (instancetype)initWithText:(NSString *)text complete:(BOOL)complete;
-
-/*!
- Initializes an \c AAPLListItem instance with the designated text and a default value for \c complete.
- The default value for \c complete is \c NO.
-
- \param text
- The intended text content of the list item.
- */
-- (instancetype)initWithText:(NSString *)text;
-
-/*!
- The text content for an \c AAPLListItem.
- */
-@property (copy) NSString *text;
-
-/*!
- Whether or not this \c AAPLListItem is complete.
- */
-@property (getter=isComplete) BOOL complete;
-
-/*!
- Resets the underlying identity of the \c AAPLListItem. If a copy of this item is made, and a call
- to \c -refreshIdentity is made afterward, the items will no longer be equal.
- */
-- (void)refreshIdentity;
-
-/*!
- Determines whether or not a list item is equal to another list item. This is a specialization of \c -isEqual: that is specific for \c AAPLListItem instances.
-
- \param listItem
- Any list item.
-
- \returns
- \c YES if the object is an \c AAPLListItem and it has the same underlying identity as the receiving
- instance. \c NO otherwise.
- */
-- (BOOL)isEqualToListItem:(AAPLListItem *)listItem;
-
-@end
diff --git a/Lister/Objective-C/Common/AAPLListItem.m b/Lister/Objective-C/Common/AAPLListItem.m
deleted file mode 100644
index 0d693e4a..00000000
--- a/Lister/Objective-C/Common/AAPLListItem.m
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- Copyright (C) 2015 Apple Inc. All Rights Reserved.
- See LICENSE.txt for this sample’s licensing information
-
- Abstract:
- The \c AAPLListItem class represents the text and completion state of a single item in the list.
-*/
-
-#import "AAPLListItem.h"
-
-@interface AAPLListItem ()
-
-@property NSUUID *UUID;
-
-@end
-
-NSString *const AAPLListItemEncodingTextKey = @"text";
-NSString *const AAPLListItemEncodingCompleteKey = @"completed";
-NSString *const AAPLListItemEncodingUUIDKey = @"uuid";
-
-@implementation AAPLListItem
-
-#pragma mark - Initialization
-
-- (instancetype)initWithText:(NSString *)text complete:(BOOL)complete UUID:(NSUUID *)UUID {
- self = [super init];
-
- if (self) {
- _text = [text copy];
- _complete = complete;
- _UUID = UUID;
- }
-
- return self;
-}
-
-- (instancetype)initWithText:(NSString *)text complete:(BOOL)complete {
- return [self initWithText:text complete:complete UUID:[NSUUID UUID]];
-}
-
-- (instancetype)initWithText:(NSString *)text {
- return [self initWithText:text complete:NO];
-}
-
-#pragma mark - NSCopying
-
-- (instancetype)copyWithZone:(NSZone *)zone {
- return [[AAPLListItem alloc] initWithText:self.text complete:self.isComplete UUID:self.UUID];
-}
-
-#pragma mark - NSCoding
-
-- (instancetype)initWithCoder:(NSCoder *)aDecoder {
- self = [super init];
-
- if (self) {
- _text = [aDecoder decodeObjectForKey:AAPLListItemEncodingTextKey];
- _UUID = [aDecoder decodeObjectForKey:AAPLListItemEncodingUUIDKey];
- _complete = [aDecoder decodeBoolForKey:AAPLListItemEncodingCompleteKey];
- }
-
- return self;
-}
-
-- (void)encodeWithCoder:(NSCoder *)aCoder {
- [aCoder encodeObject:self.text forKey:AAPLListItemEncodingTextKey];
- [aCoder encodeObject:self.UUID forKey:AAPLListItemEncodingUUIDKey];
- [aCoder encodeBool:self.isComplete forKey:AAPLListItemEncodingCompleteKey];
-}
-
-- (void)refreshIdentity {
- self.UUID = [NSUUID UUID];
-}
-
-#pragma mark - Equality
-
-- (BOOL)isEqualToListItem:(AAPLListItem *)item {
- return [self.UUID isEqual:item.UUID];
-}
-
-- (BOOL)isEqual:(id)object {
- if ([object isKindOfClass:[AAPLListItem class]]) {
- return [self isEqualToListItem:object];
- }
-
- return NO;
-}
-
-#pragma mark - Debugging
-
-- (NSString *)debugDescription {
- return [NSString stringWithFormat:@"\"%@\"", self.text];
-}
-
-@end
diff --git a/Lister/Objective-C/Common/AAPLListPresenterAlgorithms.h b/Lister/Objective-C/Common/AAPLListPresenterAlgorithms.h
deleted file mode 100644
index 042fe597..00000000
--- a/Lister/Objective-C/Common/AAPLListPresenterAlgorithms.h
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- Copyright (C) 2015 Apple Inc. All Rights Reserved.
- See LICENSE.txt for this sample’s licensing information
-
- Abstract:
- Simple internal helper functions to share across \c AAPLIncompleteListItemsPresenter and \c AAPLAllListItemsPresenter. These functions help diff two arrays of \c AAPLListItem objects.
-*/
-
-@import Foundation;
-
-@class AAPLListItem;
-
-/// An enum to keep track of the different kinds of changes that may take place within a list.
-typedef NS_ENUM(NSInteger, AAPLListItemsBatchChangeKind) {
- AAPLListItemsBatchChangeKindNone,
- AAPLListItemsBatchChangeKindRemoved,
- AAPLListItemsBatchChangeKindInserted,
- AAPLListItemsBatchChangeKindToggled,
- AAPLListItemsBatchChangeKindUpdatedText,
- AAPLListItemsBatchChangeKindMultiple
-};
-
-/// Returns an array of \c AAPLListItem objects in \c initialListItems that don't exist in \c changedListItems.
-NSArray *AAPLFindRemovedListItemsFromInitialListItemsToChangedListItems(NSArray *initialListItems, NSArray *changedListItems);
-
-/// Returns an array of \c AAPLListItem objects in \c changedListItems that don't exist in \c initialListItems.
-NSArray *AAPLFindInsertedListItemsFromInitialListItemsToChangedListItems(NSArray *initialListItems, NSArray *changedListItems, BOOL (^filterHandlerOrNil)(AAPLListItem *listItem));
-
-/*!
- Returns an array of \c AAPLListItem objects in \c changedListItems whose completion state changed from \c initialListItems
- relative to `changedListItems`.
- */
-NSArray *AAPLFindToggledListItemsFromInitialListItemsToChangedListItems(NSArray *initialListItems, NSArray *changedListItems);
-
-/*!
- Returns an array of \c AAPLListItem objects in \c changedListItems whose text changed from \c initialListItems
- relative to \c changedListItems.
- */
-NSArray *AAPLFindListItemsWithUpdatedTextFromInitialListItemsToChangedListItems(NSArray *initialListItems, NSArray *changedListItems);
-
-/*!
- Update \c replaceableNewListItems in place with all of the list items that are equal in \c previousUnchangedListItems.
- For example, if \c replaceableNewListItems has list items of UUID "1", "2", and "3" and \c previousUnchangedListItems
- has list items of UUID "2" and "3", the \c replaceableNewListItems array will have it's list items with UUID
- "2" and "3" replaced with the list items whose UUID is "2" and "3" in \c previousUnchangedListItems. This is
- used to ensure that the list items in multiple arrays are referencing the same objects in memory as what the
- presented list items are presenting.
- */
-void AAPLReplaceAnyEqualUnchangedNewListItemsWithPreviousUnchangedListItems(NSMutableArray *replaceableNewListItems, NSArray *previousUnchangedListItems);
-
-/*!
- Returns the type of \c AAPLListItemsBatchChangeKind based on the different types of changes. The parameters
- for this function should be based on the result of the functions above. If there were no changes whatsoever,
- \c nil is returned.
- */
-AAPLListItemsBatchChangeKind AAPLListItemsBatchChangeKindForChanges(NSArray *removedListItems, NSArray *insertedListItems, NSArray *toggledListItems, NSArray *listItemsWithUpdatedText);
\ No newline at end of file
diff --git a/Lister/Objective-C/Common/AAPLListPresenterAlgorithms.m b/Lister/Objective-C/Common/AAPLListPresenterAlgorithms.m
deleted file mode 100644
index 61e9a172..00000000
--- a/Lister/Objective-C/Common/AAPLListPresenterAlgorithms.m
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
- Copyright (C) 2015 Apple Inc. All Rights Reserved.
- See LICENSE.txt for this sample’s licensing information
-
- Abstract:
- Simple internal helper functions to share across \c AAPLIncompleteListItemsPresenter and \c AAPLAllListItemsPresenter. These functions help diff two arrays of \c AAPLListItem objects.
-*/
-
-#import "AAPLListPresenterAlgorithms.h"
-#import "AAPLListItem.h"
-
-NSArray *AAPLFindRemovedListItemsFromInitialListItemsToChangedListItems(NSArray *initialListItems, NSArray *changedListItems) {
- NSPredicate *filterPredicate = [NSPredicate predicateWithFormat:@"!(self in %@)", changedListItems];
-
- return [initialListItems filteredArrayUsingPredicate:filterPredicate];
-}
-
-NSArray *AAPLFindInsertedListItemsFromInitialListItemsToChangedListItems(NSArray *initialListItems, NSArray *changedListItems, BOOL (^filterHandlerOrNil)(AAPLListItem *listItem)) {
- NSPredicate *containmentPredicate = [NSPredicate predicateWithFormat:@"!(self in %@)", initialListItems];
-
- NSMutableArray *predicates = [NSMutableArray arrayWithObject:containmentPredicate];
-
- if (filterHandlerOrNil) {
- NSPredicate *filterHandlerPredicate = [NSPredicate predicateWithBlock:^BOOL(AAPLListItem *listItem, NSDictionary *bindings) {
- return filterHandlerOrNil(listItem);
- }];
-
- [predicates addObject:filterHandlerPredicate];
- }
-
- NSCompoundPredicate *filterPredicate = [[NSCompoundPredicate alloc] initWithType:NSAndPredicateType subpredicates:predicates];
-
- return [changedListItems filteredArrayUsingPredicate:filterPredicate];
-}
-
-NSArray *AAPLFindToggledListItemsFromInitialListItemsToChangedListItems(NSArray *initialListItems, NSArray *changedListItems) {
- NSPredicate *filterPredicate = [NSPredicate predicateWithBlock:^BOOL(AAPLListItem *changedListItem, NSDictionary *bindings) {
- NSInteger indexOfChangedListItemInInitialListItems = [initialListItems indexOfObject:changedListItem];
-
- if (indexOfChangedListItemInInitialListItems == NSNotFound) {
- return NO;
- }
-
- AAPLListItem *initialListItem = initialListItems[indexOfChangedListItemInInitialListItems];
-
- return initialListItem.isComplete != changedListItem.isComplete;
- }];
-
- return [changedListItems filteredArrayUsingPredicate:filterPredicate];
-}
-
-NSArray *AAPLFindListItemsWithUpdatedTextFromInitialListItemsToChangedListItems(NSArray *initialListItems, NSArray *changedListItems) {
- NSPredicate *filterPredicate = [NSPredicate predicateWithBlock:^BOOL(AAPLListItem *changedListItem, NSDictionary *bindings) {
- NSInteger indexOfChangedListItemInInitialListItems = [initialListItems indexOfObject:changedListItem];
-
- if (indexOfChangedListItemInInitialListItems == NSNotFound) {
- return NO;
- }
-
- AAPLListItem *initialListItem = initialListItems[indexOfChangedListItemInInitialListItems];
-
- return ![initialListItem.text isEqualToString:changedListItem.text];
- }];
-
- return [changedListItems filteredArrayUsingPredicate:filterPredicate];
-}
-
-void AAPLReplaceAnyEqualUnchangedNewListItemsWithPreviousUnchangedListItems(NSMutableArray *replaceableNewListItems, NSArray *previousUnchangedListItems) {
- NSArray *replaceableNewListItemsCopy = [replaceableNewListItems copy];
-
- [replaceableNewListItemsCopy enumerateObjectsUsingBlock:^(AAPLListItem *replaceableNewListItem, NSUInteger idx, BOOL *stop) {
- NSInteger indexOfUnchangedListItem = [previousUnchangedListItems indexOfObject:replaceableNewListItem];
-
- if (indexOfUnchangedListItem != NSNotFound) {
- replaceableNewListItems[idx] = previousUnchangedListItems[indexOfUnchangedListItem];
- }
- }];
-}
-
-AAPLListItemsBatchChangeKind AAPLListItemsBatchChangeKindForChanges(NSArray *removedListItems, NSArray *insertedListItems, NSArray *toggledListItems, NSArray *listItemsWithUpdatedText) {
- __block AAPLListItemsBatchChangeKind listItemsBatchChangeKind = AAPLListItemsBatchChangeKindNone;
-
- /*
- A simple helper block that takes in the new change kind. If there has already been a change kind set
- to a value other than AAPLListItemsBatchChangeKindMultiple, the block updates listItemsBatchChangeKind
- to be AAPLListItemsBatchChangeKindMultiple instead of newChangeKind.
- */
- void (^setListItemsBatchChangeKind)(AAPLListItemsBatchChangeKind) = ^(AAPLListItemsBatchChangeKind newChangeKind) {
- if (listItemsBatchChangeKind != AAPLListItemsBatchChangeKindNone) {
- listItemsBatchChangeKind = AAPLListItemsBatchChangeKindMultiple;
- }
- else {
- listItemsBatchChangeKind = newChangeKind;
- }
- };
-
- if (removedListItems.count > 0) {
- setListItemsBatchChangeKind(AAPLListItemsBatchChangeKindRemoved);
- }
-
- if (insertedListItems.count > 0) {
- setListItemsBatchChangeKind(AAPLListItemsBatchChangeKindInserted);
- }
-
- if (toggledListItems.count > 0) {
- setListItemsBatchChangeKind(AAPLListItemsBatchChangeKindToggled);
- }
-
- if (listItemsWithUpdatedText.count > 0) {
- setListItemsBatchChangeKind(AAPLListItemsBatchChangeKindUpdatedText);
- }
-
- return listItemsBatchChangeKind;
-}
\ No newline at end of file
diff --git a/Lister/Objective-C/Common/AAPLListPresenterDelegate.h b/Lister/Objective-C/Common/AAPLListPresenterDelegate.h
deleted file mode 100644
index 11c3a7bb..00000000
--- a/Lister/Objective-C/Common/AAPLListPresenterDelegate.h
+++ /dev/null
@@ -1,145 +0,0 @@
-/*
- Copyright (C) 2015 Apple Inc. All Rights Reserved.
- See LICENSE.txt for this sample’s licensing information
-
- Abstract:
- The definition for the \c AAPLListPresenterDelegate type. This protocol defines the contract between the \c AAPLListPresenting interactions and receivers of those events (the type that conforms to the \c AAPLListPresenterDelegate protocol).
-*/
-
-@protocol AAPLListPresenting;
-
-/*!
- The \c AAPLListPresenterDelegate type is used to receive events from an \c AAPLListPresenting instance
- about updates to the presenter's layout. This happens, for example, if an \c AAPLListItem object is
- inserted into the list or removed from the list. For any change that occurs to the list, a delegate message
- can be called, but you may decide not to take any action if the method doesn’t apply to your use case. For
- an implementation of \c AAPLListPresenterDelegate, see the \c AAPLAllListItemsPresenter or \c
- AAPLIncompleteListItemsPresenter types.
- */
-@protocol AAPLListPresenterDelegate
-
-/*!
- An \c AAPLListPresenting instance invokes this method on its delegate when a large change to the underlying
- list changed, but the presenter couldn't resolve the granular changes. A full layout change includes
- changing anything on the underlying list: list item toggling, text updates, color changes, etc. This is
- invoked, for example, when the list is initially loaded, because there could be many changes that happened
- relative to an empty list--the delegate should just reload everything immediately. This method is not
- wrapped in \c -listPresenterWillChangeListLayout:isInitialLayout: and \c
- -listPresenterDidChangeListLayout:isInitialLayout: method invocations.
-
- \param listPresenter
- The list presenter whose full layout has changed.
- */
-- (void)listPresenterDidRefreshCompleteLayout:(id)listPresenter;
-
-/*!
- An \c AAPLListPresenting instance invokes this method on its delegate before a set of layout changes
- occur. This could involve list item insertions, removals, updates, toggles, etc. This can also include
- changes to the color of the \c AAPLListPresenting instance. If \c isInitialLayout is \c YES, it means that
- the new list is being presented for the first time--for example, if \c -setList: is called on the \c AAPLListPresenting
- instance, the delegate will receive a \c -listPresenterWillChangeListLayout:isInitialLayout: call where
- \c isInitialLayout is \c YES.
-
- \param listPresenter
- The list presenter whose presentation will change.
-
- \param isInitialLayout
- Whether or not the presenter is presenting the most recent list for the first time.
- */
-- (void)listPresenterWillChangeListLayout:(id)listPresenter isInitialLayout:(BOOL)isInitialLayout;
-
-/*!
- A \c AAPLListPresenting invokes this method on its delegate when an item was inserted into the list. This
- method is called only if the invocation is wrapped in a call to \c
- -listPresenterWillChangeListLayout:isInitialLayout: and \c -listPresenterDidChangeListLayout:isInitialLayout:.
-
- \param listPresenter
- The list presenter whose presentation has changed.
-
- \param listItem
- The list item that has been inserted.
-
- \param index
- The index that \c listItem was inserted into.
- */
-- (void)listPresenter:(id)listPresenter didInsertListItem:(AAPLListItem *)listItem atIndex:(NSInteger)index;
-
-/*!
- An \c AAPLListPresenting invokes this method on its delegate when an item was removed from the list. This
- method is called only if the invocation is wrapped in a call to \c
- -listPresenterWillChangeListLayout:isInitialLayout: and \c -listPresenterDidChangeListLayout:isInitialLayout:.
-
- \param listPresenter
- The list presenter whose presentation has changed.
-
- \param listItem
- The list item that has been removed.
-
- \param index
- The index that \c listItem was removed from.
- */
-- (void)listPresenter:(id)listPresenter didRemoveListItem:(AAPLListItem *)listItem atIndex:(NSInteger)index;
-
-/*!
- An \c AAPLListPresenting invokes this method on its delegate when an item is updated in place. This could
- happen, for example, if the text of an \c AAPLListItem instance changes. This method is called only if the
- invocation is wrapped in a call to \c -listPresenterWillChangeListLayout:isInitialLayout: and \c
- -listPresenterDidChangeListLayout:isInitialLayout:.
-
- \param listPresenter
- The list presenter whose presentation has changed.
-
- \param listItem
- The list item that has been updated.
-
- \param index
- The index that \c listItem was updated at in place.
- */
-- (void)listPresenter:(id)listPresenter didUpdateListItem:(AAPLListItem *)listItem atIndex:(NSInteger)index;
-
-/*!
- An \c AAPLListPresenting invokes this method on its delegate when an item moved \c fromIndex to \c toIndex.
- This could happen, for example, if the list presenter toggles an \c AAPLListItem instance and it needs to
- be moved from one index to another. This method is called only if the invocation is wrapped in a call to \c
- -listPresenterWillChangeListLayout:isInitialLayout: and \c -listPresenterDidChangeListLayout:isInitialLayout:.
-
- \param listPresenter
- The list presenter whose presentation has changed.
-
- \param listItem
- The list item that has been moved.
-
- \param fromIndex
- The original index that \c listItem was located at before the move.
-
- \param toIndex
- The index that \c listItem was moved to.
- */
-- (void)listPresenter:(id)listPresenter didMoveListItem:(AAPLListItem *)listItem fromIndex:(NSInteger)fromIndex toIndex:(NSInteger)toIndex;
-
-/*!
- An \c AAPLListPresenting invokes this method on its delegate when the color of the \c AAPLListPresenting
- instance's changes. This method is called only if the invocation is wrapped in a call to \c
- -listPresenterWillChangeListLayout:isInitialLayout: and \c -listPresenterDidChangeListLayout:isInitialLayout:.
-
- \param listPresenter
- The list presenter whose presentation has changed.
-
- \param color
- The new color of the presented list.
- */
-- (void)listPresenter:(id)listPresenter didUpdateListColorWithColor:(AAPLListColor)color;
-
-/*!
- An \c AAPLListPresenting invokes this method on its delegate after a set of layout changes occur. See \c
- -listPresenterWillChangeListLayout:isInitialLayout: for examples of when this would be called.
-
- \param listPresenter
- The list presenter whose presentation has changed.
-
- \param isInitialLayout
- Whether or not the presenter is presenting the most recent list for the first time.
- */
-- (void)listPresenterDidChangeListLayout:(id)listPresenter isInitialLayout:(BOOL)isInitialLayout;
-
-@end
diff --git a/Lister/Objective-C/Common/AAPLListPresenterUtilities.h b/Lister/Objective-C/Common/AAPLListPresenterUtilities.h
deleted file mode 100644
index 1f36bcdd..00000000
--- a/Lister/Objective-C/Common/AAPLListPresenterUtilities.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- Copyright (C) 2015 Apple Inc. All Rights Reserved.
- See LICENSE.txt for this sample’s licensing information
-
- Abstract:
- Helper functions to perform common operations in \c AAPLIncompleteListItemsPresenter and \c AAPLAllListItemsPresenter.
-*/
-
-@import Foundation;
-#import "AAPLList.h"
-
-@protocol AAPLListPresenting;
-
-/*!
- Removes each list item found in \c listItemsToRemove from the \c initialListItems array. For each removal,
- the function notifies the \c listPresenter's delegate of the change.
- */
-void AAPLRemoveListItemsFromListItemsWithListPresenter(id listPresenter, NSMutableArray *initialListItems, NSArray *listItemsToRemove);
-
-/*!
- Inserts each list item in \c listItemsToInsert into \c initialListItems. For each insertion, the function
- notifies the \c listPresenter's delegate of the change.
- */
-void AAPLInsertListItemsIntoListItemsWithListPresenter(id listPresenter, NSMutableArray *initialListItems, NSArray *listItemsToInsert);
-
-/*!
- Replaces the stale list items in \c presentedListItems with the new ones found in \c newUpdatedListItems. For
- each update, the function notifies the \c listPresenter's delegate of the update.
- */
-void AAPLUpdateListItemsWithListItemsForListPresenter(id listPresenter, NSMutableArray *presentedListItems, NSArray *newUpdatedListItems);
-
-/*!
- An enum to determine that determines how the \c AAPLUpdateListColorForListPresenterIfDifferent function handles
- calling list presenter delegate methods (and with what parameters).
- */
-typedef NS_ENUM(NSInteger, AAPLListColorUpdateAction) {
- AAPLListColorUpdateActionDontSendDelegateChangeLayoutCalls,
- AAPLListColorUpdateActionSendDelegateChangeLayoutCallsForInitialLayout,
- AAPLListColorUpdateActionSendDelegateChangeLayoutCallsForNonInitialLayout
-};
-
-/*!
- Replaces the presented list's \c color with \c newColor if the colors are different. If the colors are different,
- the function notifies the delegate of the updated color change if the the \c listColorUpdateAction parameter
- is either \c AAPLListColorUpdateActionSendDelegateChangeLayoutCallsForInitialLayout or
- \c AAPLListColorUpdateActionSendDelegateChangeLayoutCallsForNonInitialLayout. Based on which one of those
- values are provided, the function will pass \c YES or \c NO to \c -listPresenterWillChangeListLayout:isInitialLayout:
- and \c -listPresenterDidChangeListLayout:isInitialLayout: for the \c isInitialLayout parameter. The function
- returns whether or not the list's color was updated.
- */
-BOOL AAPLUpdateListColorForListPresenterIfDifferent(id listPresenter, AAPLList *presentedList, AAPLListColor newColor, AAPLListColorUpdateAction listColorUpdateAction);
diff --git a/Lister/Objective-C/Common/AAPLListPresenterUtilities.m b/Lister/Objective-C/Common/AAPLListPresenterUtilities.m
deleted file mode 100644
index c59bbae2..00000000
--- a/Lister/Objective-C/Common/AAPLListPresenterUtilities.m
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- Copyright (C) 2015 Apple Inc. All Rights Reserved.
- See LICENSE.txt for this sample’s licensing information
-
- Abstract:
- Helper functions to perform common operations in \c AAPLIncompleteListItemsPresenter and \c AAPLAllListItemsPresenter.
-*/
-
-#import "AAPLListPresenterUtilities.h"
-#import "AAPLListPresenterDelegate.h"
-#import "AAPLListPresenting.h"
-#import "AAPLList.h"
-
-void AAPLRemoveListItemsFromListItemsWithListPresenter(id listPresenter, NSMutableArray *initialListItems, NSArray *listItemsToRemove) {
- NSArray *sortedListItemsToRemove = [listItemsToRemove sortedArrayUsingComparator:^NSComparisonResult(AAPLListItem *lhs, AAPLListItem *rhs) {
- return [initialListItems indexOfObject:lhs] > [initialListItems indexOfObject:rhs];
- }];
-
- for (AAPLListItem *listItemToRemove in sortedListItemsToRemove) {
- // Use the index of the list item to remove in the current list's list items.
- NSInteger indexOfListItemToRemoveInOldList = [initialListItems indexOfObject:listItemToRemove];
-
- [initialListItems removeObjectAtIndex:indexOfListItemToRemoveInOldList];
-
- [listPresenter.delegate listPresenter:listPresenter didRemoveListItem:listItemToRemove atIndex:indexOfListItemToRemoveInOldList];
- }
-}
-
-void AAPLInsertListItemsIntoListItemsWithListPresenter(id listPresenter, NSMutableArray *initialListItems, NSArray *listItemsToInsert) {
- [listItemsToInsert enumerateObjectsUsingBlock:^(AAPLListItem *insertedIncompleteListItem, NSUInteger idx, BOOL *stop) {
- [initialListItems insertObject:insertedIncompleteListItem atIndex:idx];
-
- [listPresenter.delegate listPresenter:listPresenter didInsertListItem:insertedIncompleteListItem atIndex:idx];
- }];
-}
-
-void AAPLUpdateListItemsWithListItemsForListPresenter(id listPresenter, NSMutableArray *presentedListItems, NSArray *newUpdatedListItems) {
- for (AAPLListItem *newlyUpdatedListItem in newUpdatedListItems) {
- NSInteger indexOfListItem = [presentedListItems indexOfObject:newlyUpdatedListItem];
-
- presentedListItems[indexOfListItem] = newlyUpdatedListItem;
-
- [listPresenter.delegate listPresenter:listPresenter didUpdateListItem:newlyUpdatedListItem atIndex:indexOfListItem];
- }
-}
-
-BOOL AAPLUpdateListColorForListPresenterIfDifferent(id listPresenter, AAPLList *presentedList, AAPLListColor newColor, AAPLListColorUpdateAction listColorUpdateAction) {
- // Don't trigger any updates if the new color is the same as the current color.
- if (presentedList.color == newColor) {
- return NO;
- }
-
- if (listColorUpdateAction == AAPLListColorUpdateActionSendDelegateChangeLayoutCallsForInitialLayout) {
- [listPresenter.delegate listPresenterWillChangeListLayout:listPresenter isInitialLayout:YES];
- }
- else if (listColorUpdateAction == AAPLListColorUpdateActionSendDelegateChangeLayoutCallsForNonInitialLayout) {
- [listPresenter.delegate listPresenterWillChangeListLayout:listPresenter isInitialLayout:NO];
- }
-
- presentedList.color = newColor;
-
- [listPresenter.delegate listPresenter:listPresenter didUpdateListColorWithColor:newColor];
-
- if (listColorUpdateAction == AAPLListColorUpdateActionSendDelegateChangeLayoutCallsForInitialLayout) {
- [listPresenter.delegate listPresenterDidChangeListLayout:listPresenter isInitialLayout:YES];
- }
- else if (listColorUpdateAction == AAPLListColorUpdateActionSendDelegateChangeLayoutCallsForNonInitialLayout) {
- [listPresenter.delegate listPresenterDidChangeListLayout:listPresenter isInitialLayout:NO];
- }
-
- return YES;
-}
\ No newline at end of file
diff --git a/Lister/Objective-C/Common/AAPLListPresenting.h b/Lister/Objective-C/Common/AAPLListPresenting.h
deleted file mode 100644
index cf7c8074..00000000
--- a/Lister/Objective-C/Common/AAPLListPresenting.h
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- Copyright (C) 2015 Apple Inc. All Rights Reserved.
- See LICENSE.txt for this sample’s licensing information
-
- Abstract:
- The definition for the \c AAPLListPresenting type. This protocol defines the contract between list presenters and how their lists are presented / archived.
-*/
-
-@import Foundation;
-#import "AAPLList.h"
-
-@protocol AAPLListPresenterDelegate;
-
-/*!
- The \c AAPLListPresenting protocol defines the building blocks required for an object to be used as a list
- presenter. List presenters are meant to be used where an \c AAPLList object is displayed; in essence, a list
- presenter "fronts" an \c AAPLList object. With iOS / OS X apps, iOS / OS X widgets, and WatchKit extensions,
- we can classify these interaction models into list presenters. All of the logic can then be abstracted away
- so that the interaction is testable, reusable, and scalable. By defining the core requirements of a list
- presenter through the \c AAPLListPresenting, consumers of \c AAPLListPresenting instances can share a common
- interaction interface to a list.
-
- Types that conform to \c AAPLListPresenting will have other methods to manipulate a list. For example, a
- presenter can allow for inserting list items into the list, it can allow moving a list item from one index
- to another, etc. All of these updates require that the \c AAPLListPresenting notify its delegate (an
- \c AAPLListPresenterDelegate) of these changes through the common delegate methods. Each of these methods
- should be surrounded by \c -listPresenterWillChangeListLayout: and \c -listPresenterDidChangeListLayout:
- invocations. For more information about the expectations of how an \c AAPLListPresenterDelegate interacts
- with an \c AAPLListPresenting, see the \c AAPLListPresenterDelegate protocol comments.
-
- The underlying implementation of the \c AAPLListPresenting may use an \c AAPLList object to store certain properties
- as a convenience, but there's no need to do that directly. You query an instance of an \c AAPLListPresenting
- instance for its \c archiveableList representation; that is, a representation of the currently presented list
- that can be archiveable. This may happen, for example, when a document needs to save the currently presented
- list in an archiveable form. Note that list presenters should be used on the main queue only.
- */
-@protocol AAPLListPresenting
-
-/*!
- The delegate that will receive callbacks from the \c AAPLListPresenting instance when the presentation
- of the list changes.
- */
-@property (nonatomic, weak) id delegate;
-
-/*!
- Resets the presented list to a new list. This can be called, for example, when a new list is unarchived and
- needs to be presented. Calls to this method should wrap the entire sequence of changes in a single
- \c -listPresenterWillChangeListLayout:isInitialLayout: and \c -listPresenterDidChangeListLayout:isInitialLayout:
- invocation. In more complicated implementations of this method, you can find the intersection / difference
- between the new list's presented list items and the old list's presented list items. You can then call into the
- remove / update / move delegate methods to inform the delegate of the re-organization. Delegates should
- receive updates if the text of a \c AAPLListItem instance has changed. Delegates should also receive a
- callback if the new color is different from the old list's color.
-
- \param list
- The new list that the \c AAPLListPresenting instance should present.
- */
-- (void)setList:(AAPLList *)list;
-
-/*!
- The color of the presented list. If the new color is different from the old color, the delegate should be
- notified through the \c -listPresenter:didUpdateListColorWithColor: method.
- */
-@property AAPLListColor color;
-
-/*!
- An archiveable presentation of the list that that presenter is presenting. This commonly returns the underlying
- list being manipulated. However, this can be computed based on the current state of the presenter (color, list
- items, etc.). If a presenter has changes that are not yet applied to the list, the list returned here should
- have those changes applied.
- */
-@property (readonly, copy) AAPLList *archiveableList;
-
-/*!
- The presented list items that should be displayed in order. Adopters of the \c AAPLListPresenting protocol can
- decide not to show all of the list items within a list.
- */
-@property (readonly, copy) NSArray *presentedListItems;
-
-/*!
- A convenience property that should return the equivalent of \c self.presentedListItems.count.
- */
-@property (readonly) NSInteger count;
-
-/*!
- A convenience property that should return whether or not there are any presented list items.
- */
-@property (readonly, getter=isEmpty) BOOL empty;
-
-@end
\ No newline at end of file
diff --git a/Lister/Objective-C/Common/ListerKit.h b/Lister/Objective-C/Common/ListerKit.h
deleted file mode 100644
index 8a5a0451..00000000
--- a/Lister/Objective-C/Common/ListerKit.h
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- Copyright (C) 2015 Apple Inc. All Rights Reserved.
- See LICENSE.txt for this sample’s licensing information
-
- Abstract:
- Umbrella header for the ListerKit framework.
-*/
-
-@import Foundation;
-
-// Models
-#import
-#import
-
-
-// Documents - UI/NSDocument architecture is unavailable on the watch platform.
-#if !TARGET_OS_WATCH
-#import
-#endif
-
-// Configuration
-#import
-
-// List Presentation
-#import
-#import
-#import
-#import
-
-// UI
-#import
-
-// Custom View Drawing - CoreGraphics and other custom drawing APIs are not available on the watch platform.
-#if !TARGET_OS_WATCH
-#import
-#import
-#endif
-
-#if TARGET_OS_IOS || TARGET_OS_WATCH
-#import
-#import
-#endif
-
-#if TARGET_OS_IOS
-#import
-#import
-#import
-#import
-#endif
-
-#if TARGET_OS_WATCH
-#import
-#endif
-
-#if TARGET_OS_MAC && !(TARGET_OS_EMBEDDED || TARGET_OS_IOS || TARGET_OS_WATCH)
-#import
-#import
-#endif
diff --git a/Lister/Objective-C/Lister Tests/AAPLAppLaunchContextTests.m b/Lister/Objective-C/Lister Tests/AAPLAppLaunchContextTests.m
deleted file mode 100644
index 8bd945e8..00000000
--- a/Lister/Objective-C/Lister Tests/AAPLAppLaunchContextTests.m
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- Copyright (C) 2015 Apple Inc. All Rights Reserved.
- See LICENSE.txt for this sample’s licensing information
-
- Abstract:
- The test case class for the `AAPLAppLaunchContext` class.
-*/
-
-#import "AAPLAppLaunchContext.h"
-@import ListerKit;
-@import UIKit;
-@import XCTest;
-
-NSString *const AAPLAppLaunchContextTestsUserActivityType = @"com.example.apple-samplecode.Lister.testing";
-
-@interface AAPLAppLaunchContextTests : XCTestCase
-
-@property (nonatomic, copy) NSArray *listURLs;
-@property (nonatomic) AAPLListColor color;
-
-@end
-
-@implementation AAPLAppLaunchContextTests
-
-- (void)setUp {
- [super setUp];
-
- self.color = AAPLListColorBlue;
-
- self.listURLs = [[NSBundle mainBundle] URLsForResourcesWithExtension:AAPLAppConfigurationListerFileExtension subdirectory:@""];
-}
-
-- (void)testUserActivityInitializerWithNSUserActivityDocumentURLKey {
- NSUserActivity *userActivity = [[NSUserActivity alloc] initWithActivityType:AAPLAppLaunchContextTestsUserActivityType];
-
- [userActivity addUserInfoEntriesFromDictionary:@{
- NSUserActivityDocumentURLKey: self.listURLs.firstObject,
- AAPLAppConfigurationUserActivityListColorUserInfoKey: @(self.color)
- }];
-
- AAPLAppLaunchContext *launchContext = [[AAPLAppLaunchContext alloc] initWithUserActivity:userActivity];
-
- XCTAssertEqualObjects(launchContext.listURL.absoluteURL, ((NSURL *)self.listURLs.firstObject).absoluteURL);
- XCTAssertEqual(launchContext.listColor, self.color);
-}
-
-- (void)testUserActivityInitializerWithAppConfigurationUserActivityListURLUserInfoKey {
- NSUserActivity *userActivity = [[NSUserActivity alloc] initWithActivityType:AAPLAppLaunchContextTestsUserActivityType];
-
- [userActivity addUserInfoEntriesFromDictionary:@{
- AAPLAppConfigurationUserActivityListURLPathUserInfoKey: ((NSURL *)self.listURLs.firstObject).path,
- AAPLAppConfigurationUserActivityListColorUserInfoKey: @(self.color)
- }];
-
- AAPLAppLaunchContext *launchContext = [[AAPLAppLaunchContext alloc] initWithUserActivity:userActivity];
-
- XCTAssertEqualObjects(launchContext.listURL.absoluteURL, ((NSURL *)self.listURLs.firstObject).absoluteURL);
- XCTAssertEqual(launchContext.listColor, self.color);
-}
-
-- (void)testUserActivityInitializerPrefersNSUserActivityDocumentURLKey {
- NSUserActivity *userActivity = [[NSUserActivity alloc] initWithActivityType:AAPLAppLaunchContextTestsUserActivityType];
-
- [userActivity addUserInfoEntriesFromDictionary:@{
- NSUserActivityDocumentURLKey: self.listURLs.firstObject,
- AAPLAppConfigurationUserActivityListURLPathUserInfoKey: self.listURLs.lastObject,
- AAPLAppConfigurationUserActivityListColorUserInfoKey: @(self.color)
- }];
-
- AAPLAppLaunchContext *launchContext = [[AAPLAppLaunchContext alloc] initWithUserActivity:userActivity];
-
- XCTAssertEqualObjects(launchContext.listURL.absoluteURL, ((NSURL *)self.listURLs.firstObject).absoluteURL);
- XCTAssertEqual(launchContext.listColor, self.color);
-}
-
-- (void)testListerURLSchemeInitializer {
- // Construct a URL with the lister scheme and the file path of the document.
- NSURLComponents *urlComponents = [[NSURLComponents alloc] init];
- urlComponents.scheme = AAPLAppConfigurationListerSchemeName;
- urlComponents.path = ((NSURL *)self.listURLs.firstObject).path;
-
- // Add a query item to encode the color associated with the list.
- NSString *colorQueryValue = [NSString stringWithFormat:@"%ld", (long)self.color];
- NSURLQueryItem *colorQueryItem = [NSURLQueryItem queryItemWithName:AAPLAppConfigurationListerColorQueryKey value:colorQueryValue];
- urlComponents.queryItems = @[colorQueryItem];
-
- AAPLAppLaunchContext *launchContext = [[AAPLAppLaunchContext alloc] initWithListerURL:urlComponents.URL];
-
- XCTAssertEqualObjects(launchContext.listURL.absoluteURL, ((NSURL *)self.listURLs.firstObject).absoluteURL);
- XCTAssertEqual(launchContext.listColor, self.color);
-}
-
-@end
diff --git a/Lister/Objective-C/Lister Watch App/Base.lproj/Interface.storyboard b/Lister/Objective-C/Lister Watch App/Base.lproj/Interface.storyboard
deleted file mode 100644
index 738aadce..00000000
--- a/Lister/Objective-C/Lister Watch App/Base.lproj/Interface.storyboard
+++ /dev/null
@@ -1,133 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-