Yes. I see the first snippet in obj c and second in swift inspite of selecting obj c.
OK, that’s expected behaviour. The core reference library pages will honour the Objective-C / Swift popup — for example, this works on the documentation page for the
+isHealthDataAvailable
method — but code snippets in
articles, which is the type of page you referenced, generally do not.
Frankly, I encourage Objective-C developers to get a basic reading understanding of Swift and vice versa. You don’t have to become an expert in both languages, but there’s a lot of good stuff out there in the ‘other’ language and it’s as shame to miss out on that.
Share and Enjoy
—
Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware
let myEmail = "eskimo" + "1" + "@apple.com"