A package to enable face tracking by using Apple's ARKit.
This package exposes the blendShapes
, lookAtPoint
, lightEstimate
, depthmap
, and distanceToScreen
Starting the face tracking can be done either by using the UIKit/SwiftUI view and run FTKit.shared.start()
or hidden on a host view (most top view controller) by running FTKit.shared.start(hiddenOnView:)
.
NSCameraUsageDescription
needs to be set in the the host app
extension UIApplication {
func topMostViewController() -> UIViewController? {
let keyWindow = UIApplication.shared.windows.filter {$0.isKeyWindow}.first
if var topController = keyWindow?.rootViewController {
while let presentedViewController = topController.presentedViewController {
topController = presentedViewController
}
return topController
}
return nil
}
}