-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Spruced up AlertHandler with source information
- Loading branch information
Showing
2 changed files
with
58 additions
and
28 deletions.
There are no files selected for viewing
24 changes: 9 additions & 15 deletions
24
Sources/KippleUI/SwiftUI/Core/ViewModifiers/NavigationHidden.swift
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 |
---|---|---|
@@ -1,23 +1,17 @@ | ||
// Copyright © 2024 Brian Drelling. All rights reserved. | ||
|
||
#if !os(macOS) | ||
|
||
import Foundation | ||
import SwiftUI | ||
|
||
public struct NavigationHidden: ViewModifier { | ||
public func body(content: Content) -> some View { | ||
content | ||
.navigationBarTitle("") | ||
.navigationBarHidden(true) | ||
.navigationBarBackButtonHidden(true) | ||
} | ||
} | ||
|
||
public extension View { | ||
func navigationHidden() -> some View { | ||
modifier(NavigationHidden()) | ||
@ViewBuilder | ||
func navigationHidden(_ isHidden: Bool = true) -> some View { | ||
#if os(macOS) | ||
self | ||
#else | ||
self | ||
.navigationBarHidden(isHidden) | ||
.navigationBarBackButtonHidden(isHidden) | ||
#endif | ||
} | ||
} | ||
|
||
#endif |
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