'iOS Vision framework with only ARKit import
I hope it's not a silly question, but why this iOS Swift code compiles successfully?
import UIKit
import ARKit
class ViewController: UIViewController {
private let sequenceHandler = VNSequenceRequestHandler()
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
}
}
I expect that VNSequenceRequestHandler
would not be found since Vision
is not imported.
Does ARKit
automatically imports Vision
framework? Because if I right click on import ARKit
and click "Jump to definition", in Xcode I see this
I don't know where SwiftUI
come from (this project use UIKit
) and where Vision
come from.
Thank you very much!
Solution 1:[1]
That's because ARKit is an umbrella framework
ARKit has access to all the classes of such important frameworks as UIKit, AVFoundation, SceneKit, SpriteKit, Vision, CoreGraphics, etc. When I develop AR app I import just ARKit module. Consider, there's no access to SwiftUI through ARKit at the moment.
There is some kind of logic in it. SceneKit is needed for importing of models and rendering, CoreMotion and AVFoundation are the basis on which ARSession is built. And finally, how can we do without ML algorithms when recognizing images or classifying objects? For this, all the supporting frameworks are integrated into ARKit.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 |