Skip to content

Made ComposeModifierView public. #83

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Sources/SkipUI/SkipUI/Compose/ComposeModifierView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,28 +23,28 @@ public enum ComposeModifierRole {
}

/// Used internally by modifiers to apply changes to the context supplied to modified views.
class ComposeModifierView: View {
public class ComposeModifierView: View {
let view: View
let role: ComposeModifierRole
var action: (@Composable (inout ComposeContext) -> ComposeResult)?
var composeContent: (@Composable (any View, ComposeContext) -> Void)?

/// Constructor for subclasses.
init(view: any View, role: ComposeModifierRole = .unspecified) {
public init(view: any View, role: ComposeModifierRole = .unspecified) {
// Don't copy view
// SKIP REPLACE: this.view = view
self.view = view
self.role = role
}

/// A modfiier that performs an action, optionally modifying the `ComposeContext` passed to the modified view.
init(targetView: any View, role: ComposeModifierRole = .unspecified, action: @Composable (inout ComposeContext) -> ComposeResult) {
public init(targetView: any View, role: ComposeModifierRole = .unspecified, action: @Composable (inout ComposeContext) -> ComposeResult) {
self.init(view: targetView, role: role)
self.action = action
}

/// A modifier that takes over the composition of the modified view.
init(contentView: any View, role: ComposeModifierRole = .unspecified, composeContent: @Composable (any View, ComposeContext) -> Void) {
public init(contentView: any View, role: ComposeModifierRole = .unspecified, composeContent: @Composable (any View, ComposeContext) -> Void) {
self.init(view: contentView, role: role)
self.composeContent = composeContent
}
Expand Down
Loading