-
-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: - Added ability to change the background colour of screens within the entire application
- Loading branch information
1 parent
b9e730b
commit 70f9cff
Showing
11 changed files
with
66 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
// | ||
// Public+NavigatableView.swift of Navigattie | ||
// | ||
// Created by Tomasz Kurylik | ||
// - Twitter: https://twitter.com/tkurylik | ||
// - Mail: [email protected] | ||
// | ||
// Copyright ©2023 Mijick. Licensed under MIT License. | ||
|
||
|
||
import SwiftUI | ||
|
||
// MARK: - Initialising | ||
public extension NavigatableView { | ||
func implementNavigationView(config: NavigationConfig? = nil) -> some View { NavigationView(rootView: self, config: config) } | ||
} | ||
|
||
// MARK: - Pushing And Removing Views From Stack | ||
public extension NavigatableView { | ||
/// Pushes a new view. Stacks previous one | ||
func push(with animation: TransitionAnimation) { NavigationManager.push(self, animation) } | ||
} | ||
public extension View { | ||
/// Removes the presented view from the stack | ||
func pop() { NavigationManager.pop() } | ||
|
||
/// Removes all views up to the selected view in the stack. The view from the argument will be the new active view | ||
func pop<N: NavigatableView>(to view: N.Type) { NavigationManager.pop(to: view) } | ||
|
||
/// Removes all views from the stack. Root view will be the new active view | ||
func popToRoot() { NavigationManager.popToRoot() } | ||
} | ||
|
||
// MARK: - Configurable | ||
public extension NavigatableView { | ||
/// OPTIONAL: Changes the background colour of the selected view | ||
var backgroundColour: Color? { nil } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters