Skip to content

Instantly share code, notes, and snippets.

@patskovn
Created April 10, 2021 10:42
Show Gist options
  • Save patskovn/360c469ccc6d7048a8a6fa4e62ab9da0 to your computer and use it in GitHub Desktop.
Save patskovn/360c469ccc6d7048a8a6fa4e62ab9da0 to your computer and use it in GitHub Desktop.
//
// 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
@steipete
Copy link

This works great - much appreciated!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment