lately, I've been playing around with the new SwiftUI framework.
I do have a basic understanding of how the framework works but I cannot figure out a way to change title attributes for a navigation bar.
I am using the latest Xcode 11 beta 5 and the corresponding swift/swiftUI version
I already tried a few things. First thing I tried was to just add modifiers to a Text, but somehow SwiftUI seems to ignore modifiers in a navigation bar environment.
The second thing I tried was to change the title attributes through UINavigationBar.apperance().titleTextAttributes = ...
but it seems like they removed the ability to customize titleTextAttributes of UINavigationBar in the latest beta version.
//First thing:
List(myData) {
...
}
.navigationBarTitle(Text("My title").font(myFont))
// Second thing
UINavigationBar.appearance().titleTextAttributes = myAttrs
I expect the navigation bar title to have my custom font but it's always the apple default font.