问题
In the Parse SDK update to 1.11.0 it says it supports watchOS and tvOS. I was wondering how I can add the frameworks to my watchOS app using Cocoapods. The pod file contains pod 'Parse'
and I have run pod update
then pod install
but when I add a bridging header to the watchOS 2 Extension it says file not found.
Do you know what I should be doing?
Thank you
回答1:
It seems like the QuickStart instructions have not been updated for watchOS 2. I couldn't find any information in the announcement either.
If you only need to use Parse on your WatchKit Extension target, then a simple Podfile similar to this will work:
# 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
However, if you need to use Parse in both your iOS target and the WatchKit Extension target (e.g. to register for Push Notifications on iOS and communicate with Parse on WatchKit), things are a bit more complicated.
Due to the "Generated duplicate UUIDs" bug in CocoaPods, you will need to work around the issue, by running this in your terminal first:
export COCOAPODS_DISABLE_DETERMINISTIC_UUIDS=YES
Next, you can create a Podfile such as 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
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
Finally, pod install
, and you should be good to go!
来源:https://stackoverflow.com/questions/34278343/add-parse-com-1-11-0-to-watchos-2