watchkit

WCSession Failing to Activate

筅森魡賤 提交于 2021-01-27 07:28:49
问题 I am having a problem with the WatchKit Connectivity Session failing to activate when I call the session.activateSession() method. This is the code I am using to set up the session. if (WCSession.isSupported()) { session = WCSession.defaultSession() session.delegate = self // conforms to WCSessionDelegate session.activateSession() print("Session has been activated") } However, I have placed a breakpoint on the print line and when I inspect the session object, it says the sessionActivated

WCSession Failing to Activate

蓝咒 提交于 2021-01-27 07:26:15
问题 I am having a problem with the WatchKit Connectivity Session failing to activate when I call the session.activateSession() method. This is the code I am using to set up the session. if (WCSession.isSupported()) { session = WCSession.defaultSession() session.delegate = self // conforms to WCSessionDelegate session.activateSession() print("Session has been activated") } However, I have placed a breakpoint on the print line and when I inspect the session object, it says the sessionActivated

WCSession Failing to Activate

自古美人都是妖i 提交于 2021-01-27 07:25:45
问题 I am having a problem with the WatchKit Connectivity Session failing to activate when I call the session.activateSession() method. This is the code I am using to set up the session. if (WCSession.isSupported()) { session = WCSession.defaultSession() session.delegate = self // conforms to WCSessionDelegate session.activateSession() print("Session has been activated") } However, I have placed a breakpoint on the print line and when I inspect the session object, it says the sessionActivated

How to determine the Apple Watch model?

ⅰ亾dé卋堺 提交于 2021-01-23 07:02:31
问题 The WKInterfaceDevice.current().model property does not give a model number: For Apple Watch, the value of this string is Apple Watch . How can the exact Apple Watch model be determined from iOS? 回答1: There is no public API to get that exact information. You can however use the following (I'll let you translate into Swift): - (NSString*) modelIdentifier { size_t size = 0; sysctlbyname("hw.machine", NULL, &size, NULL, 0); char* machine = malloc(size); sysctlbyname("hw.machine", machine, &size,

Can't build Watch App to simulator due to App needs to be updated

女生的网名这么多〃 提交于 2021-01-04 05:41:27
问题 I've been stuck on this for a few days. Really appreciate it if anyone can point me the directions. All of a sudden I can't build the Watch App onto the simulator - I can still build to the device tho. It shows an error as below. It looks like target architecture issue but the build settings Architectures is set to $(ARCHS_STANDARD). After the error message was shown, the simulator had the App with unfinished install. Tapping on it triggers another dialog: This app needs to be updated by the

Can't build Watch App to simulator due to App needs to be updated

老子叫甜甜 提交于 2021-01-04 05:39:07
问题 I've been stuck on this for a few days. Really appreciate it if anyone can point me the directions. All of a sudden I can't build the Watch App onto the simulator - I can still build to the device tho. It shows an error as below. It looks like target architecture issue but the build settings Architectures is set to $(ARCHS_STANDARD). After the error message was shown, the simulator had the App with unfinished install. Tapping on it triggers another dialog: This app needs to be updated by the

Core data + CloudKit - sharing between iOS and watchOS companion app

末鹿安然 提交于 2020-12-29 06:54:27
问题 In my app I store data with core data. Recently I discovered the new feature introduced by Apple in WWDC19 which allows core data to work with CloudKit. I just enabled cloudKit for my app and used an NSPersistentCloudKitContainer instead of NSPersistentContainer and all was set up ! All my data is shared between ios devices. That works like NSPersistentContainer but it sends a copy of changes on icloud server, so there is always a local cache of data. Now I'd like to access that data from my

WatchOS3 Complication that launches App

杀马特。学长 韩版系。学妹 提交于 2020-12-24 14:27:53
问题 I would like to create a complication for watchOS 3 that will simply launch my App. I have used XCode to create the ComplicationController: class ComplicationController: NSObject, CLKComplicationDataSource { // MARK: - Timeline Configuration func getSupportedTimeTravelDirections(for complication: CLKComplication, withHandler handler: @escaping (CLKComplicationTimeTravelDirections) -> Void) { handler([.forward, .backward]) } func getTimelineStartDate(for complication: CLKComplication,

WatchOS3 Complication that launches App

拟墨画扇 提交于 2020-12-24 14:27:21
问题 I would like to create a complication for watchOS 3 that will simply launch my App. I have used XCode to create the ComplicationController: class ComplicationController: NSObject, CLKComplicationDataSource { // MARK: - Timeline Configuration func getSupportedTimeTravelDirections(for complication: CLKComplication, withHandler handler: @escaping (CLKComplicationTimeTravelDirections) -> Void) { handler([.forward, .backward]) } func getTimelineStartDate(for complication: CLKComplication,