I was hoping someone could shed some light on this. I've tried researching but couldn't really find anything...
Is there a way to share a class between the iPhone application and the apple watch extension?
Let's say in the watch extension I have a class myClass
; I am unable to use this class within the phone application. Is there anyway to get around this?
To enjoy every feature on your Apple Watch, you need to turn on Wi-Fi and Bluetooth on your paired iPhone. Open Control Centre on your iPhone, then make sure that Wi-Fi and Bluetooth are turned on. Your Apple Watch uses Wi-Fi and Bluetooth to communicate with your paired iPhone.
Your Apple Watch uses Wi-Fi and Bluetooth to communicate with your paired iPhone. If you have cellular, your watch can also stay connected through a cellular network. Your watch switches between these intelligently to choose the most power-efficient connection.
Touch and hold the bottom of the Apple Watch screen, then swipe up to see Control Center. Scroll to the bottom, then tap Edit. Tap the add button on the Schooltime button , then tap Done.
iPhone application and the apple watch extension are basally different targets in your project. For each file (except the .h file), you can specify which target you want to include it to.
There are at least two ways to do this.
1) From the top menu select View -> Utilities -> File Inspector. The right panel will show up and you should find the Target Membership section with checkboxes next to the available targets for you project. Check the targets you want to include this file to. In this case, the iPhone app and the WatchKit extension.
2) You can also click on the project to go to the project settings. Select the target you want. (i.e. iPhone app or WatchKit extension), click on the Build Phases tab. In the Compile sources, you can click on the "+" icon to add more files to build for the target. (i.e. myClass.m in your case)
Hope this helps!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With