I have been working with ARKit 3 (the beta with Xcode beta as well). I understand that the ARKit framework is meant to be used on iOS devices, but what I'm wondering is if I can instantiate any of these classes in a macOS project?
I've archived an ARWorldMap object (from ARKit) on an iOS device and have downloaded the app bundle to inspect it on my MacBook.
I am trying to use NSKeyedUnarchiver to unarchive the data that was archived by NSKeyedArchiver and when I try to import ARKit in the MacBook project, I get the error below.
I understand that certain features shouldn't be expected to work outside of iOS devices, but can I not use the classes that hold specific data when I develop in Xcode for programs targeting a MacBook?
Any help would be appreciated.
Here is the error:
"No such module 'ARKit' "
Unfortunately, the ARKit API is only available on iOS 11 and above. At the time of this post. The API relies on hardware features only available on an iPad or iPhone.
You can see Apple's API support in their documentation. See SDK on the right side of their doc. Here's a link to Apple's ARKit API.
Related
I have a macOS app that I wrote years ago; it has been working well on my Mac. Recently I thought it would be nice to have that same app on my iPhone so I added an iOS target to my Xcode project. I have never built for iOS before so I'm on new ground here.Anyway, when I built for iOS, I got an error message: "Cocoa is not available when building for iOS." In Apple's "Cocoa Fundamentals Guide" there is a prominent statement: "Cocoa is a set of object-oriented frameworks that provides a runtime environment for applications running in OS X and iOS."Does that mean I can run an app that uses Cocoa but not build one? I'm at a loss; I have no idea how to get past this one. Can an iOS app be built without Cocoa? How would I even go about doing that? Any suggestions at all will be welcome. I'm running Xcode 12.5 on macOS Big Sur 11.4. My app's UI is written in Objective-C and its muscle is in plain C. Also, my app is only for my own use, not for publication.
Anyway, when I built for iOS, I got an error message: "Cocoa is not available when building for iOS." In Apple's "Cocoa Fundamentals Guide" there is a prominent statement: "Cocoa is a set of object-oriented frameworks that provides a runtime environment for applications running in OS X and iOS."
That's somewhat confusing wording. iOS uses a variation on the Cocoa theme called Cocoa Touch. More specifically, the user interface framework on macOS is called AppKit while the iOS user interface framework is UIKit. If you're comfortable with AppKit, it's not hard to learn enough UIKit to get things done. Other frameworks (Foundation, Core Graphics, Core Data, etc.) are pretty much the same on both platforms.
Does that mean I can run an app that uses Cocoa but not build one?
No. You're going to have to rewrite at least the user interface parts of your app before it'll run on iOS. iOS devices obviously use a somewhat different user interaction model: there's no hardware keyboard, no mouse, a touch screen that can handle multiple simultaneous touches, a much smaller screen, and a variety of sensors that don't exist on the Mac, so a different approach to interacting with the user is different. If you were careful to separate the business logic (model) from the user interface (views) in your Mac app, you'll likely be able to reuse most of that unchanged.
Try to rewrite your code using Cocoa touch or UIKit. I am not good at iOS coding, by the way as I know Cocoa framework is for Mac OS, the framework for touch devices is Cocoa touch.
I want to use swiftUI to develop an application running on both iOS and Mac OS. After MAC 10.15, I can run iPad app directly on Mac. So, what's the difference between creating a Mac OS project and an IOS project?
The main difference is the library you will use as main! Native app for iOS uses UIKit and for macOS uses AppKit. But Catalyst uses UIKitForMac. That is some sort of porting UIKit to AppKit. For example for mapping touch events to and clicks, or gestures to scroll (and reverse) and etc. But it is very limited comparing to the original MapKit. If you really need to support mac, you will ended up importing AppKit and use it's features alongside with the UIKitForMac. But catalyst will boost your development process and reduce the time it takes for the MVP and early stages of the app.
I am working on an iOS app that integrates with multiple bluetooth devices (e.g. printers and barcode scanners). Each of the devices comes with it's own version of SDK and most of them just have objective-c/swift SDKs but not javascript SDKs.
Would like to find out what is the best way to reduce the app bundle size at the same time supporting multiple devices ?
Based on my investigations,
iOS doesn't allow downloading objective-c/swift code dynamically during runtime, hence the option of downloading the SDKs after the user having installed the app is ruled out.
Would like to get a feedback on the feasibility of the below solution. Also let me know if there is a better solution.
iOS version 8+ support embedded frameworks - Have separate iOS driver
apps for each of the supported devices which just installs the device
SDK as a shared embedded framework so that the parent app can
dynamically link to the shared embedded framework if one that matches
the connected device is available, otherwise force the user to
download the respective driver app.
This question has gone unanswered for a little while, so you may have already figured this out, but no, you cannot make shared embedded frameworks on iOS. Only Apple can do that. All of the frameworks you use must be either provided by Apple or embedded inside your app.
I don't understand how I can start communication session with specific robot or with all connected (available) robots. I have "availableRobots"=2 and array with both robots. What next? In official SDK for iOS I don't see any method similar to "openConnectionWithSpecificRobot".
Currently the iOS SDK only supports communication with one robot. Prior to iOS 6 Apple only allowed communication with one device of any type. This was supposedly fixed in an iOS 6 update, although we have not had the chance to test this yet. If so we hope to release an update at some point in the future that will support communication with multiple robots on iOS.
Does anyone knows if there is a document from Apple that states what iOS SDK version you have to use for building your app to upload it to iTunes Connect?
I often read in blogs "only the latest", but I need this official from Apple because our vendor wants to build against the iOS 4 SDK because of "strange errors with iOS 5".
I'm not sure if this is OK. We want to run the app to run on iOS 4 and 5.
I too had read what you had—that the latest SDK had to be used... Yet, I haven't found an official source for this now I go looking for it.
Using the iOS 5 SDK does not prevent you from having a build target of iOS 4.2 (or similar), which will it to run on both iOS 4.2+ as well as iOS 5. Perhaps a good starting point is educating the client that there is a fundamental difference between the iOS 5 SDK and iOS 5 itself—they may well just be reacting to media coverage of iOS 5 issues like battery life.