init(rootView : Content)
init?(coder: NSCoder)
Availability 有効性
Technology
class NSHostingView<Content> where Content : View
You use NSHosting
objects to integrate SwiftUI views into your AppKit view hierarchies. A hosting view is an NSView
object that manages a single SwiftUI view, which may itself contain other SwiftUI views. Because it is an NSView
object, you can integrate it into your existing AppKit view hierarchies to implement portions of your UI. For example, you can use a hosting view to implement a custom control.
例えば、あなたはホスティングビューを使ってあつらえのコントロールを実装できます。
A hosting view acts as a bridge between your SwiftUI views and your AppKit interface. During layout, the hosting view reports the content size preferences of your SwiftUI views back to the AppKit layout system so that it can size the view appropriately. The hosting view also coordinates event delivery. ホスティングビューは、SwiftUIビューとあなたのAppKitインターフェイスの間のブリッジとしての役割を果たします。レイアウトの間、ホスティングビューはあなたのSwiftUIビューのコンテンツサイズ環境設定をAppKitレイアウトシステムに遡って報告します、そうすることでそれはビューを適切に大きさ指定できます。ホスティングビューはまた、イベント配達をうまく調整します。
init(rootView : Content)
init?(coder: NSCoder)
var rootView : Content
func keyDown (with: NSEvent)
CVarArg
CustomDebugStringConvertible
CustomStringConvertible
Equatable
Hashable
NSAccessibilityElementProtocol
NSAccessibilityProtocol
NSAnimatablePropertyContainer
NSAppearanceCustomization
NSCoding
NSDraggingDestination
NSDraggingSource
NSObjectProtocol
NSStandardKeyBindingResponding
NSTouchBarProvider
NSUserActivityRestoring
NSUserInterfaceItemIdentification
NSUserInterfaceValidations
class NSHostingController