Skip to content

Commit

Permalink
Put preferences system in place. Implement navigation bar and .naviga…
Browse files Browse the repository at this point in the history
…tionTitle
  • Loading branch information
aabewhite committed Sep 23, 2023
1 parent b849ef6 commit f0ab72e
Show file tree
Hide file tree
Showing 4 changed files with 171 additions and 463 deletions.
9 changes: 5 additions & 4 deletions Sources/SkipUI/SkipUI/Compose/ComposeContext.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,20 @@ import androidx.compose.ui.Modifier

/// Context to provide modifiers, parent, etc to composables.
public struct ComposeContext {
/// Mechanism for a parent view to change how a child view is composed.
public var composer: (@Composable (inout View, ComposeContext) -> Void)?

/// Modifiers to apply.
public var modifier: Modifier = Modifier

/// Use in conjunction with `rememberSaveable` to store view state.
public var stateSaver: Saver<Any, Any> = ComposeStateSaver()

/// Mechanism for a parent view to change how a child view is composed.
public var composer: (@Composable (inout View, ComposeContext) -> Void)?

/// The context to pass to child content of a container view.
public func content(modifier: Modifier = Modifier, composer: (@Composable (inout View, ComposeContext) -> Void)? = nil) -> ComposeContext {
public func content(modifier: Modifier = Modifier, stateSaver: Saver<Any, Any>? = nil, composer: (@Composable (inout View, ComposeContext) -> Void)? = nil) -> ComposeContext {
var context = self
context.modifier = modifier
context.stateSaver = stateSaver ?? self.stateSaver
context.composer = composer
return context
}
Expand Down
Loading

0 comments on commit f0ab72e

Please sign in to comment.