Camera access

Can my playground access the camera for use with ARKit?

Accepted Reply

Yes! The judges will be using the latest iPad for testing. Although keep in mind that the device will be in Airplane mode so you won't have access to the Internet.

Replies

Yes, you can use ARKit inside playgrounds. There is also a template for that I think.

Also, if we use ARKit, do we need to be concerned about compatibility as the latest Swift Playgrounds can be run on iOS 10.3 and on devices that don’t support ARKit (A7 and A8-based stuff)? In the past, I know Apple has sometimes specified what devices they run submissions on.

The Playgrounds are highly likely to be run on very new devices so don’t worry about that. Expect them have the newest one. What you maybe should worry about is different screen sizes.

>do we need to be concerned about compatibility


Apple touts ARKIt compatibility with Swift Playgrounds, and use of the iPad's camera, here:


https://developer.apple.com/swift-playgrounds/release-notes/


Swift Playgrounds 1.6

September 19, 2017

What’s New

  • New Augmented Reality challenge uses ARKit to show the familiar Learn to Code characters within the real world.
  • You can now access the iPad camera from your code.
  • Errors in your code are more clearly explained.
  • Your code can take advantage of Swift 4 and the iOS 11 SDK.
  • New languages for the app and the Learn to Code 1 lessons include: Spanish (Spain), Italian, Dutch, Chinese (traditional), Korean, Swedish, Thai, Turkish, and Portuguese (Brazil).

Yes! The judges will be using the latest iPad for testing. Although keep in mind that the device will be in Airplane mode so you won't have access to the Internet.