title: Creating custom modifiers for Swift UI views
body: <p>Was wondering how it's possible to create modifiers for Swift UI views? </p>
  
  <p>For example, let's say I have some view defined as so:</p>
  
  <pre class="lang-swift prettyprint-override"><code>struct LabelView: View {
     let font1: Font = .header
     let font2: Font = .body
  
     var body: Some View {
       // two views, where one uses font1 and other uses font2
     }
  }
  </code></pre>
  
  <p>How would it be possible to create a modifier that allows something like:</p>
  
  <pre class="lang-swift prettyprint-override"><code>LabelView()
    .font1(.callout)
    .font2(.body)
  </code></pre>
  
  <p>I'm trying to learn how to write API's in the declarative nature that Apple is pushing with Swift UI but it seems like documentation isn't complete on this. I've tried creating some sort of <code>ViewModifier</code> type but I'm not really sure what I need to do with this, since it required I return <code>_ModifiedContent&lt;_, _&gt;</code> and not exactly sure how to do this. Basically, is it possible to modify the properties of a view using a declarative syntax like the ones in the built in SwiftUI views.</p>