Preprocessor macro for Apple Watch?

前端 未结 4 1929
南旧
南旧 2021-02-19 11:49

I was looking at Apple\'s Lister (for Apple Watch, iOS, and OS X) sample. The sample performs a test for iOS and OS X:

#import 

#if          


        
4条回答
  •  北荒
    北荒 (楼主)
    2021-02-19 12:40

    As of watchOS 2.0, you can run native code on the watch, so this is a more relevant question.

    I'm using the first early beta of watchOS 2, so this may change, but right now, TARGET_OS_WATCH is set to 1 on watchOS.

    (Also, be careful: TARGET_OS_IPHONE is also set to 1 on watchOS, though TARGET_OS_IOS is 0.)

提交回复
热议问题