SubscriptionView

A view that subscribes to a publisher with an action.

ComponentiOS 13.0+macOS 10.15+tvOS 13.0+watchOS 6.0+SubscriptionView in SwiftUI

Declaration

React
import { SubscriptionView } from 'swiftui-react-native';
Swift
@frozen nonisolated struct SubscriptionView<PublisherType, Content> where PublisherType : Publisher, Content : View, PublisherType.Failure == Never

Initializers

One SwiftUI initializer backs <SubscriptionView>.

React
<SubscriptionView
  content: ReactNode
  publisher: { notification: string; } | { every: number; }
  onPress: (arg0: unknown) => void
/>
Swift
nonisolated init(
    content: Content,
    publisher: PublisherType,
    action: @escaping (PublisherType.Output) -> Void
)
  • content*ReactNode
  • publisher*{ notification: string; } | { every: number; }
  • onPress*(arg0: unknown) => void

    Swift action: (PublisherType.Output) -> Void

Also takes the common view props: modifiers, style and testID.

Relationships

Conforms to

  • View

See also

More in Controls.