FrakSharing
Ce contenu n’est pas encore disponible dans votre langue.
@MainActor final class FrakSharingThe Frak sharing sheet for a UIKit app. Build it once per screen, warm() it when a share
affordance becomes visible, then present(_:) on the tap. SwiftUI apps use
View.frakSharingSheet(isPresented:request:); both drive one SharingPresenter.
Hold the instance for as long as the screen lives: releasing it takes the warm web view.
Conforms to Swift.Sendable
Defined in: Sources/FrakSDKUI/FrakSharing.swift:12
Initializers
Section titled “Initializers”init(presentingFrom:configuration:onResult:)
Section titled “init(presentingFrom:configuration:onResult:)”@MainActor init( presentingFrom host: UIViewController, configuration: FrakSharingConfiguration = FrakSharingConfiguration(), onResult: @escaping FrakSharing.ResultHandler = { _ in })- Parameters:
- host: the view controller the sheet is presented from. Held weakly; the sheet stops working once it goes away, which is the same lifetime a screen-scoped instance wants.
- configuration: sheet height and which store surface the install step raises.
- onResult: called once per presentation with the most significant outcome.
Methods
Section titled “Methods”present(_:)
Section titled “present(_:)”@MainActor func present(_ request: SharingRequest)Presents the sheet for request. A second call while a sheet is up is a no-op.
warm()
Section titled “warm()”@MainActor func warm()Starts warming the pooled web view and the identity/config reads. Call when a share
affordance becomes visible; cheap to call repeatedly, and present(_:) implies it.
Other members
Section titled “Other members”FrakSharing.ResultHandler
Section titled “FrakSharing.ResultHandler”typealias ResultHandler = @MainActor @Sendable (SharingResult) -> VoidHow a sharing session ended. Called once per present(_:), on the main actor.