If you want to access Persona without using SharePlay or Group Activity, use AVFoundation.
Get Front Camera Capture Device using AVCaptureDeviceDiscoverySession. Front Camera Capture Device will present Persona. Enterprise API is not required.
Configure AVCaptureSession with Front Camera Capture Device and AVCaptureVideoDataOutput.
Get Sample Buffers from AVCaptureVideoDataOutput. Render it using Metal (CAMetalLayer or Compositor Services), or UIImageView (easy, but not recommended).
Post
Replies
Boosts
Views
Activity
You can use it right now. See the /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ImagePlayground.framework/Versions/A/Modules/ImagePlayground.swiftmodule/arm64e-apple-macos.swiftinterface file.
Here's my sample project for iOS. https://github.com/pookjw/ImagePlaygroundExample
My solution without using UIKit Presentation style: https://gist.github.com/pookjw/093dfbe43714bb0ceec2e4df1d5a9499
Caution: It's super unsafe.
same
func setDisplayModeButtonVisibilityHidden() {
typealias BlockType = @convention(c) (Any, Selector, UISplitViewController.Style) -> Any
let selector: Selector = #selector(UISplitViewController.init(style:))
let method: Method = class_getInstanceMethod(NSClassFromString("SwiftUI.NotifyingMulticolumnSplitViewController"), selector)!
let originalImp: IMP = method_getImplementation(method)
let original: BlockType = unsafeBitCast(originalImp, to: BlockType.self)
let new: @convention(block) (Any, UISplitViewController.Style) -> Any = { (me, arg0) -> Any in
let object: UISplitViewController = original(me, selector, arg0) as! UISplitViewController
object.displayModeButtonVisibility = .never
return object
}
let newImp: IMP = imp_implementationWithBlock(new)
method_setImplementation(method, newImp)
}
... on your @main App,
@main
struct YourApp: App {
init() {
setDisplayModeButtonVisibilityHidden()
}
/ ** /
}
Did you solve this problem?