Created
April 10, 2021 10:42
-
-
Save patskovn/360c469ccc6d7048a8a6fa4e62ab9da0 to your computer and use it in GitHub Desktop.
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
// | |
// EmptySwiftUIModifiers.swift | |
// Architectory | |
// | |
// Created by Nikita Patskov on 09.09.2020. | |
// | |
import SwiftUI | |
struct TestView: View { | |
var body: some View { | |
Text("Test") | |
.navigationDisplayMode(.inline) | |
} | |
} | |
#if os(iOS) | |
public extension View { | |
func navigationDisplayMode(_ displayMode: NavigationBarItem.TitleDisplayMode) -> some View { | |
navigationBarTitleDisplayMode(displayMode) | |
} | |
} | |
#else | |
public enum DisplayMode { | |
case inline | |
case large | |
case automatic | |
} | |
public typealias StackNavigationViewStyle = DefaultNavigationViewStyle | |
public extension View { | |
func navigationBarTitle(_ title: String , displayMode: DisplayMode) -> some View { | |
self | |
} | |
func navigationBarHidden(_ hidden: Bool) -> some View { | |
self | |
} | |
func navigationDisplayMode(_ displayMode: DisplayMode) -> some View { | |
self | |
} | |
} | |
#endif | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This works great - much appreciated!