One Logo Pool Ball
SwiftUICore · IOS API REFERENCE

View

protocol · iOS 13.0+ · SDK 27.1

@MainActor @preconcurrency protocol View

A type that represents part of your app's user interface and provides modifiers that you use to configure views. You create custom views by declaring types that conform to the `View` protocol. Implement the required ``View/body-swift.property`` computed property to provide the content for your custom view. struct MyView: View { var body: some View { Text("Hello, World!") } } Assemble the view's body by combining one or more of the built-in views provided by SwiftUI, like the ``Text`` instance in the example above, plus other custom views that you define, into a hierarchy of views. For more information about creating custom views, see <doc:Declaring-a-Custom-View>. The `View` protocol provides a set of modifiers — protocol methods with default implementations — that you use to configure views in the layout of your app. Modifiers work by wrapping the view instance on which you call them in another view with the specified characteristics, as described in <doc:Configuring-Views>. For example, adding the ``View/opacity(_:)`` modifier to a text view returns a new view with some amount of transparency: Text("Hello, World!") .opacity(0.5) // Display partially transparent text. The complete list of default modifiers provides a large set of controls for managing views. For example, you can fine tune <doc:View-Layout>, add <doc:View-Accessibility> information, and respond to <doc:View-Input-and-Events>. You can also collect groups of default modifiers into new, custom view modifiers for easy reuse. A type conforming to this protocol inherits `@preconcurrency @MainActor` isolation from the protocol if the conformance is declared in its original declaration. Isolation to the main actor is the default, but it's not required. Declare the conformance in an extension to opt-out the isolation.

Members (0)

This type has no directly callable members in this snapshot. See the framework’s skipped declarations for unsupported APIs.

Skipped declarations

224 declarations were excluded from these bindings. Each reason comes from the generator or the iOS SDK compiler.

View.disabled(_:)

This protocol needs associated types that cannot yet cross the bridge.

View.contentMargins(for:edges:alignment:)

This protocol needs associated types that cannot yet cross the bridge.

View.offset(_:)

This protocol needs associated types that cannot yet cross the bridge.

View.offset(x:y:)

This protocol needs associated types that cannot yet cross the bridge.

View.fixedSize(horizontal:vertical:)

This protocol needs associated types that cannot yet cross the bridge.

View.fixedSize()

This protocol needs associated types that cannot yet cross the bridge.

View.rotationEffect(_:anchor:)

This protocol needs associated types that cannot yet cross the bridge.

View.hoverEffect(_:isEnabled:)

This protocol needs associated types that cannot yet cross the bridge.

View.hoverEffect(_:)

This protocol needs associated types that cannot yet cross the bridge.

View.hoverEffect(_:isEnabled:)

This protocol needs associated types that cannot yet cross the bridge.

View.defaultHoverEffect(_:)

This protocol needs associated types that cannot yet cross the bridge.

View.defaultHoverEffect(_:)

This protocol needs associated types that cannot yet cross the bridge.

View.hoverEffectDisabled(_:)

This protocol needs associated types that cannot yet cross the bridge.

View.foregroundColor(_:)

This protocol needs associated types that cannot yet cross the bridge.

View.accentColor(_:)

This protocol needs associated types that cannot yet cross the bridge.

View.keyframeAnimator(initialValue:trigger:content:keyframes:)

This declaration needs Swift generic type arguments. (no canonical witness for Value)

View.keyframeAnimator(initialValue:repeating:content:keyframes:)

This declaration needs Swift generic type arguments. (no canonical witness for Value)

View.padding(_:)

This protocol needs associated types that cannot yet cross the bridge.

View.padding(_:_:)

This protocol needs associated types that cannot yet cross the bridge.

View.padding(_:)

This protocol needs associated types that cannot yet cross the bridge.

View.glassEffect(_:in:)

This protocol needs associated types that cannot yet cross the bridge.

View.blendMode(_:)

This protocol needs associated types that cannot yet cross the bridge.

View.privacySensitive(_:)

This protocol needs associated types that cannot yet cross the bridge.

View.contrast(_:)

This protocol needs associated types that cannot yet cross the bridge.

View.glassEffectTransition(_:)

This protocol needs associated types that cannot yet cross the bridge.

View.matchedGeometryEffect(id:in:properties:anchor:isSource:)

This protocol needs associated types that cannot yet cross the bridge.

View.environment(_:_:)

This protocol needs associated types that cannot yet cross the bridge.

View.onOpenURL(prefersInApp:)

This protocol needs associated types that cannot yet cross the bridge.

View.overlay(_:alignment:)

This protocol needs associated types that cannot yet cross the bridge.

View.border(_:width:)

This protocol needs associated types that cannot yet cross the bridge.

All SwiftUICore types →