title: Change default system font in SwiftUI
body: <p>I'm trying to set a custom default font in my SwiftUI app. I tried several suggestions from this thread <a href="https://stackoverflow.com/questions/8707082/set-a-default-font-for-whole-ios-app/40484460">Set a default font for whole iOS app?</a>.</p>
  
  <p>However, none of those seem to work with SwiftUI. For example with this approach:</p>
  
  <pre class="lang-swift prettyprint-override"><code>// Constants.swift
  struct Fonts {
      static var plex = "IBMPlexMono-Text"
  }
  
  
  // FontExtension.swift
  extension UILabel {
      var substituteFontName : String {
          get { return self.font.fontName }
          set { self.font = UIFont(name: Fonts.plex, size: 17)! }
      }
  
  }
  
  // AppDelegate.swift in didFinishLaunchingWithOptions-function
  UILabel.appearance().substituteFontName = Fonts.plex
  </code></pre>
  
  <p>When I start the app, the custom font appears for a split second and then changes back to the default font by Apple. Why does it change back to Apple's font and how can it be done permanently?</p>
  
  <p>Is it maybe possible with an extension on <code>Text</code>-View? </p>