This commit is contained in:
Liu Lantao 2016-05-15 17:20:34 +08:00
parent c1c46ae740
commit df4e0b9742
609 changed files with 618 additions and 19813 deletions

Binary file not shown.

View File

@ -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 samples licensing information
Abstract:

View File

@ -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 samples licensing information
Abstract:

View File

@ -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 samples licensing information
Abstract:

View File

@ -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 samples licensing information
Abstract:

View File

@ -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 samples 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
/**

View File

@ -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 samples licensing information
Abstract:

View File

@ -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 samples 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" : " ")]"
}
}

View File

@ -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 samples licensing information
Abstract:

View File

@ -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 samples licensing information
Abstract:

View File

@ -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 samples licensing information
Abstract:

View File

@ -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 samples licensing information
Abstract:

View File

@ -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.

View File

@ -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 samples 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)

View File

Before

Width:  |  Height:  |  Size: 6.6 KiB

After

Width:  |  Height:  |  Size: 6.6 KiB

View File

Before

Width:  |  Height:  |  Size: 7.3 KiB

After

Width:  |  Height:  |  Size: 7.3 KiB

View File

Before

Width:  |  Height:  |  Size: 7.2 KiB

After

Width:  |  Height:  |  Size: 7.2 KiB

View File

Before

Width:  |  Height:  |  Size: 7.3 KiB

After

Width:  |  Height:  |  Size: 7.3 KiB

View File

Before

Width:  |  Height:  |  Size: 7.3 KiB

After

Width:  |  Height:  |  Size: 7.3 KiB

View File

Before

Width:  |  Height:  |  Size: 7.4 KiB

After

Width:  |  Height:  |  Size: 7.4 KiB

View File

Before

Width:  |  Height:  |  Size: 7.5 KiB

After

Width:  |  Height:  |  Size: 7.5 KiB

View File

Before

Width:  |  Height:  |  Size: 7.5 KiB

After

Width:  |  Height:  |  Size: 7.5 KiB

View File

Before

Width:  |  Height:  |  Size: 7.6 KiB

After

Width:  |  Height:  |  Size: 7.6 KiB

View File

Before

Width:  |  Height:  |  Size: 7.6 KiB

After

Width:  |  Height:  |  Size: 7.6 KiB

View File

Before

Width:  |  Height:  |  Size: 7.7 KiB

After

Width:  |  Height:  |  Size: 7.7 KiB

View File

Before

Width:  |  Height:  |  Size: 6.8 KiB

After

Width:  |  Height:  |  Size: 6.8 KiB

View File

Before

Width:  |  Height:  |  Size: 7.7 KiB

After

Width:  |  Height:  |  Size: 7.7 KiB

View File

Before

Width:  |  Height:  |  Size: 7.7 KiB

After

Width:  |  Height:  |  Size: 7.7 KiB

View File

Before

Width:  |  Height:  |  Size: 7.6 KiB

After

Width:  |  Height:  |  Size: 7.6 KiB

View File

Before

Width:  |  Height:  |  Size: 7.6 KiB

After

Width:  |  Height:  |  Size: 7.6 KiB

View File

Before

Width:  |  Height:  |  Size: 7.7 KiB

After

Width:  |  Height:  |  Size: 7.7 KiB

View File

Before

Width:  |  Height:  |  Size: 7.7 KiB

After

Width:  |  Height:  |  Size: 7.7 KiB

View File

Before

Width:  |  Height:  |  Size: 7.7 KiB

After

Width:  |  Height:  |  Size: 7.7 KiB

View File

Before

Width:  |  Height:  |  Size: 7.8 KiB

After

Width:  |  Height:  |  Size: 7.8 KiB

View File

Before

Width:  |  Height:  |  Size: 7.8 KiB

After

Width:  |  Height:  |  Size: 7.8 KiB

View File

Before

Width:  |  Height:  |  Size: 7.8 KiB

After

Width:  |  Height:  |  Size: 7.8 KiB

View File

Before

Width:  |  Height:  |  Size: 6.9 KiB

After

Width:  |  Height:  |  Size: 6.9 KiB

View File

Before

Width:  |  Height:  |  Size: 7.8 KiB

After

Width:  |  Height:  |  Size: 7.8 KiB

View File

Before

Width:  |  Height:  |  Size: 7.8 KiB

After

Width:  |  Height:  |  Size: 7.8 KiB

View File

Before

Width:  |  Height:  |  Size: 7.8 KiB

After

Width:  |  Height:  |  Size: 7.8 KiB

View File

Before

Width:  |  Height:  |  Size: 7.3 KiB

After

Width:  |  Height:  |  Size: 7.3 KiB

View File

Before

Width:  |  Height:  |  Size: 7.3 KiB

After

Width:  |  Height:  |  Size: 7.3 KiB

View File

Before

Width:  |  Height:  |  Size: 7.3 KiB

After

Width:  |  Height:  |  Size: 7.3 KiB

View File

Before

Width:  |  Height:  |  Size: 7.4 KiB

After

Width:  |  Height:  |  Size: 7.4 KiB

View File

Before

Width:  |  Height:  |  Size: 7.4 KiB

After

Width:  |  Height:  |  Size: 7.4 KiB

View File

Before

Width:  |  Height:  |  Size: 7.4 KiB

After

Width:  |  Height:  |  Size: 7.4 KiB

View File

Before

Width:  |  Height:  |  Size: 7.5 KiB

After

Width:  |  Height:  |  Size: 7.5 KiB

View File

Before

Width:  |  Height:  |  Size: 6.9 KiB

After

Width:  |  Height:  |  Size: 6.9 KiB

View File

Before

Width:  |  Height:  |  Size: 7.6 KiB

After

Width:  |  Height:  |  Size: 7.6 KiB

View File

Before

Width:  |  Height:  |  Size: 7.5 KiB

After

Width:  |  Height:  |  Size: 7.5 KiB

View File

Before

Width:  |  Height:  |  Size: 7.4 KiB

After

Width:  |  Height:  |  Size: 7.4 KiB

View File

Before

Width:  |  Height:  |  Size: 7.5 KiB

After

Width:  |  Height:  |  Size: 7.5 KiB

View File

Before

Width:  |  Height:  |  Size: 6.8 KiB

After

Width:  |  Height:  |  Size: 6.8 KiB

View File

Before

Width:  |  Height:  |  Size: 7.0 KiB

After

Width:  |  Height:  |  Size: 7.0 KiB

View File

Before

Width:  |  Height:  |  Size: 7.0 KiB

After

Width:  |  Height:  |  Size: 7.0 KiB

View File

Before

Width:  |  Height:  |  Size: 7.1 KiB

After

Width:  |  Height:  |  Size: 7.1 KiB

View File

Before

Width:  |  Height:  |  Size: 7.1 KiB

After

Width:  |  Height:  |  Size: 7.1 KiB

View File

Before

Width:  |  Height:  |  Size: 7.1 KiB

After

Width:  |  Height:  |  Size: 7.1 KiB

View File

Before

Width:  |  Height:  |  Size: 7.2 KiB

After

Width:  |  Height:  |  Size: 7.2 KiB

View File

Before

Width:  |  Height:  |  Size: 688 B

After

Width:  |  Height:  |  Size: 688 B

View File

Before

Width:  |  Height:  |  Size: 623 B

After

Width:  |  Height:  |  Size: 623 B

View File

@ -17,7 +17,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>2.0</string>
<string>3.1</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>

View File

@ -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 samples licensing information
Abstract:

View File

@ -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 samples licensing information
Abstract:
@ -7,7 +7,7 @@
*/
import WatchKit
import ListerKit
import ListerWatchKit
class GlanceInterfaceController: WKInterfaceController, ConnectivityListsControllerDelegate, ListPresenterDelegate, NSFilePresenter {
// MARK: Properties

View File

@ -19,7 +19,7 @@
<key>CFBundlePackageType</key>
<string>XPC!</string>
<key>CFBundleShortVersionString</key>
<string>2.0</string>
<string>3.1</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
@ -29,7 +29,7 @@
<key>NSExtensionAttributes</key>
<dict>
<key>WKAppBundleIdentifier</key>
<string>${LISTER_BUNDLE_PREFIX}.Lister.nativewatchkitapp</string>
<string>${LISTER_BUNDLE_PREFIX}.Lister.watchkitapp</string>
</dict>
<key>NSExtensionPointIdentifier</key>
<string>com.apple.watchkit</string>

View File

@ -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 samples 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()

View File

@ -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 samples 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`.

View File

Before

Width:  |  Height:  |  Size: 6.6 KiB

After

Width:  |  Height:  |  Size: 6.6 KiB

View File

Before

Width:  |  Height:  |  Size: 7.3 KiB

After

Width:  |  Height:  |  Size: 7.3 KiB

View File

Before

Width:  |  Height:  |  Size: 7.2 KiB

After

Width:  |  Height:  |  Size: 7.2 KiB

View File

Before

Width:  |  Height:  |  Size: 7.3 KiB

After

Width:  |  Height:  |  Size: 7.3 KiB

View File

Before

Width:  |  Height:  |  Size: 7.3 KiB

After

Width:  |  Height:  |  Size: 7.3 KiB

View File

Before

Width:  |  Height:  |  Size: 7.4 KiB

After

Width:  |  Height:  |  Size: 7.4 KiB

View File

Before

Width:  |  Height:  |  Size: 7.5 KiB

After

Width:  |  Height:  |  Size: 7.5 KiB

View File

Before

Width:  |  Height:  |  Size: 7.5 KiB

After

Width:  |  Height:  |  Size: 7.5 KiB

View File

Before

Width:  |  Height:  |  Size: 7.6 KiB

After

Width:  |  Height:  |  Size: 7.6 KiB

View File

Before

Width:  |  Height:  |  Size: 7.6 KiB

After

Width:  |  Height:  |  Size: 7.6 KiB

View File

Before

Width:  |  Height:  |  Size: 7.7 KiB

After

Width:  |  Height:  |  Size: 7.7 KiB

Some files were not shown because too many files have changed in this diff Show More