似乎是快速开始 https://www.parse.com/apps/quickstartwatchOS 2 的说明尚未更新。我在 中找不到任何信息公告或者 http://blog.parse.com/announcements/apple-tv-and-apple-watch-sdks-are-here/.
如果您只需要在 WatchKit Extension 目标上使用 Parse,那么一个简单的 Podfile与此类似 https://github.com/neonichu/native-watchOS-example将工作:
# 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 上注册推送通知并与 WatchKit 上的 Parse 进行通信),则事情会稍微复杂一些。
因为CocoaPods 中的“生成重复的 UUID”错误 https://github.com/CocoaPods/CocoaPods/issues/4326, 你会需要解决这个问题 https://medium.com/@mosn/watchos-2-0-pod-install-5236a40ca4bc#.hy3cm839c,首先在终端中运行:
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
,你应该可以走了!