ARKit
1.5 introduces image recognition. In the code you have to create a Set of the reference images like this:
let referenceImages = ARReferenceIma
let documentDirectory = NSSearchPathForDirectoriesInDomains(.documentDirectory, .userDomainMask, true)[0]
let pathToObject = documentDirectory + "/reference.jpg"
let imageUrl = URL(fileURLWithPath: pathToObject)
let imageData: Data = try! Data(contentsOf: imageUrl)
let image = UIImage(data: imageData, scale: UIScreen.main.scale)
let cgImage = image!.cgImage
let referenceImages = ARReferenceImage.init(cgImage!, orientation: .up, physicalWidth: 0.595)
referenceImages.name = "Reference Image"
let configuration = ARImageTrackingConfiguration()
configuration.trackingImages = [referenceImages]
session.run(configuration, options: [.resetTracking, .removeExistingAnchors])