似乎QuickStart 说明尚未针对 watchOS 2 进行更新。我在announcement either 中找不到任何信息。
如果您只需要在 WatchKit 扩展目标上使用 Parse,那么一个简单的 Podfile similar to this 就可以工作:
# Uncomment this line to define a global platform for your project
# platform :ios, '8.0'
# Uncomment this line if you're using Swift
# use_frameworks!
target 'MyApp' do
end
target 'MyApp WatchKit App' do
end
target 'MyApp WatchKit Extension' do
platform :watchos, '2.0'
pod 'Parse', '~> 1.11'
end
但是,如果您需要在 iOS 目标和 WatchKit 扩展目标中使用 Parse(例如,在 iOS 上注册 Push Notifications 并在 WatchKit 上与 Parse 通信),事情就有点复杂了。
由于"Generated duplicate UUIDs" bug in CocoaPods,您将需要to work around the issue,首先在您的终端中运行:
export COCOAPODS_DISABLE_DETERMINISTIC_UUIDS=YES
接下来,你可以像这样创建一个 Podfile:
# Uncomment this line to define a global platform for your project
# platform :ios, '8.0'
# Uncomment this line if you're using Swift
# use_frameworks!
target 'MyApp' do
platform :ios, '8.0'
pod 'Parse', '~> 1.11'
end
target 'MyApp WatchKit App' do
end
target 'MyApp WatchKit Extension' do
platform :watchos, '2.0'
pod 'Parse', '~> 1.11'
end
最后,pod install,你应该很高兴!