Thursday, September 11, 2025
HomeiOS DevelopmentThe right way to Entry SwiftUI's contactAccessPicker Immediately from UIKit With out...

The right way to Entry SwiftUI’s contactAccessPicker Immediately from UIKit With out Additional View Layer in iOS 18?


I am engaged on integrating a contactAccessPicker in a UIKit mission. In SwiftUI, this operate is an extension of View, so it is usually used like this:

yourView.contactAccessPicker(isPresented: $isPresented) { identifiers in 
// Fetch all contacts the app has entry to.
}

I am having bother accessing contactAccessPicker from UIKit as a result of it is an extension of View, so it might’t be used instantly in UIKit. I attempted utilizing a UIHostingController to current a SwiftUI view that features the picker, however this finally ends up exhibiting two views:

1. The preliminary `yourView`
2. Then `contactAccessPicker` on high of `yourView`

Is there a strategy to current contactAccessPicker instantly with out exhibiting the additional view layer, or a extra environment friendly strategy to obtain this in UIKit?

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments