title: SwiftUI - How can I call a Function in my View?
body: <p>I am using SwiftUI/Swift for a week now, and I love it. Now I have a problem. I want to call a Function from my View, but I get this Error</p>
  <blockquote>
  <p>Type '()' cannot conform to 'View'; only struct/enum/class types can conform to protocols</p>
  </blockquote>
  <p>This is the Code:</p>
  <pre><code>struct testView: View {
      
      
      var body: some View {
          VStack {
              Text(&quot;TextBox&quot;)
              Text(&quot;SecondTextBox&quot;)
              self.testFunction()
          }
      }
      
      func testFunction() {
          print(&quot;This is a Text.&quot;)
      }
      
  }
  </code></pre>
  <p>I don't get it. In other languages its much simpler and could work that way. Can anybody help me please? Swift is pretty new to me :D</p>