0

I am starting to learn how to write watchOS 3 apps.

I have a .swift file on my Xcode project (iPhone+watchapp project), which has both the iOS and watchapp as targets. I have a class on this file that is initialized both when the iOS app loads, as well as when the watchapp loads.

When I start my iPhone app, I get my debug information printed on the console just once. However, when starting my watchapp, it prints twice.

This only happens on hardware - on the simulator, things seem more independent - only one log per app.

This made me think that the watchapp activates the iOS app in the background. Is that true? Why doesn't this happen on the simulator?

If I can't get around this, is that possible to share the object I initialized on the iOS app with the watchapp? I wonder what would be a good method to update the UI on the watch once everything is downloaded on the iOS side...

Thanks!

rmaddy
  • 314,917
  • 42
  • 532
  • 579
francisaugusto
  • 1,077
  • 1
  • 12
  • 29

1 Answers1

0

Apparently it was my fault. I am use the CLLocation framework, but the watchOS wasn't on its target's list. Adding the watchOS app as a target fixed this.

francisaugusto
  • 1,077
  • 1
  • 12
  • 29