MCPcopy Create free account
hub / github.com/Effect-TS/effect / _EffectUIHostSlot

Class _EffectUIHostSlot

packages/ui/native/apple/EffectUIHost.swift:195–225  ·  view source on GitHub ↗

Internal bridge from Fabric to a registered Swift view.

Source from the content-addressed store, hash-verified

193
194/// Internal bridge from Fabric to a registered Swift view.
195@objc(EffectUIHostSlot)
196@MainActor
197public final class _EffectUIHostSlot: NSObject {
198 private let hosted: any EffectUIHostedView
199
200 // The host's subclass for `name` exists only once `register` added it.
201 @objc public init(
202 name: String,
203 emit: @escaping (String, [String: Any]) -> Void,
204 invalidateSize: @escaping () -> Void
205 ) {
206 hosted = EffectUI.views[name]!(EffectUIContext(emit: emit, invalidateSize: invalidateSize))
207 super.init()
208 }
209
210 @objc public var view: EffectUIPlatformView {
211 hosted
212 }
213
214 @objc public var contentView: EffectUIPlatformView? {
215 hosted.contentView
216 }
217
218 @objc public func update(_ changed: [String: Any]) {
219 hosted.update(changed)
220 }
221
222 @objc(command:args:) public func command(_ name: String, args: [Any]) {
223 hosted.command(name, args)
224 }
225}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected