-
Notifications
You must be signed in to change notification settings - Fork 10.4k
Conversation
I've been trying to get this running in a 2.0 extension. I guess WatchOS 2 doesn't have SystemConfiguration |
I'd love to hear someone has a pull request for this issue. We're looking to update our app to watchOS 2. |
Is there a work around for this guys? , other than of course not using AFNetworking lol |
+1 |
2 similar comments
+1 |
+1 |
Anyone spotted any good examples in other libraries that have a solution for this? Still thinking about how to tackle this. |
I put together a branch here with my first stab at it. Would love to hear if it working well for everyone here. Please test it and let me know. |
Btw this requires |
I guess I could add a pch line to the pod to define |
[WKInterfaceDevice currentDevice] doesn't have model or systemVersion properties. the umbrella header generated by cocoapods included the following files that are not part of the watch target: Thanks for working on watch support! |
Those methods are on //
// WKInterfaceDevice.h
// WatchKit
//
// Copyright (c) 2014-2015 Apple Inc. All rights reserved.
//
#import <CoreGraphics/CoreGraphics.h>
#import <WatchKit/WatchKit.h>
NS_ASSUME_NONNULL_BEGIN
@class UIImage;
typedef NS_ENUM(NSInteger, WKHapticType) {
WKHapticTypeNotification,
WKHapticTypeDirectionUp,
WKHapticTypeDirectionDown,
WKHapticTypeSuccess,
WKHapticTypeFailure,
WKHapticTypeRetry,
WKHapticTypeStart,
WKHapticTypeStop,
WKHapticTypeClick
} WK_AVAILABLE_WATCHOS_ONLY(2.0);
@interface WKInterfaceDevice : NSObject
+ (WKInterfaceDevice *)currentDevice;
- (BOOL)addCachedImage:(UIImage *)image name:(NSString *)name WK_AVAILABLE_IOS_ONLY(8.2);
- (BOOL)addCachedImageWithData:(NSData *)imageData name:(NSString *)name WK_AVAILABLE_IOS_ONLY(8.2);
- (void)removeCachedImageWithName:(NSString *)name WK_AVAILABLE_IOS_ONLY(8.2);
- (void)removeAllCachedImages WK_AVAILABLE_IOS_ONLY(8.2);
@property (nonatomic, readonly) CGRect screenBounds;
@property (nonatomic, readonly) CGFloat screenScale;
@property (nonatomic, readonly, copy) NSString *preferredContentSizeCategory;
@property (nonatomic, readonly, strong) NSDictionary<NSString*, NSNumber*> *cachedImages; // name and size of cached images
@property(nonatomic, readonly, copy) NSString *systemVersion WK_AVAILABLE_WATCHOS_IOS(2.0,9.0); // e.g. @"2.0"
@property(nonatomic, readonly, copy) NSString *name WK_AVAILABLE_WATCHOS_IOS(2.0,9.0); // e.g. "My Watch"
@property(nonatomic, readonly, copy) NSString *model WK_AVAILABLE_WATCHOS_IOS(2.0,9.0); // e.g. @"Apple Watch"
@property(nonatomic, readonly, copy) NSString *localizedModel WK_AVAILABLE_WATCHOS_IOS(2.0,9.0); // localized version of model
@property(nonatomic, readonly, copy) NSString *systemName WK_AVAILABLE_WATCHOS_IOS(2.0,9.0); // e.g. @"watchOS"
- (void)playHaptic:(WKHapticType)type WK_AVAILABLE_WATCHOS_ONLY(2.0);
@end
NS_ASSUME_NONNULL_END |
Also @JARinteractive, if you bring in just the |
@kcharwood oh, It looks like those were added in Beta 4. The NSURLSession subspec builds fine. Looks good. |
@kylef any suggestions on how to best structure the podspec for watchOS support? |
CocoaPods version 0.38 is out with watchOS 2 support: The update allows you to use Pods with watchOS. As a Pod Author, you have to specify the deployment target for watchOS in the Podspec, as seen below:
|
that's good news! |
+1 |
After a day of battling, I have something up and working in the |
Note that iOS 6 support is removed from this podspec. Support has not yet been explicitly removed from the source itself, but that will be removed in a future update. |
@@ -0,0 +1 @@ | |||
Did you know that git does not support storing empty directories? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be committed? Where did this file even come from?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm guessing xcode generated it when I added a watch target.
|
||
@end | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Newline cleanup at the top and bottom.
My only other thing @kcharwood would be whether the project has actually been updated with the new deployment targets in the podspec. It would be a bummer to throw a bunch of compiler warnings for everyone that picks up the new release if there are any new deprecation warnings. Have you had a chance to see if that causes any problems? |
Including AFNetworking in a WatchKit 2 project results in a SystemConfiguration.h file not found error.
I am seeing this in Xcode 7 / WatchOS 2 (beta 3)