Question: I cannot figure out why this breaks it. I have an a element which uses CSS transitions to fade into a gradient background on hover. For whatever reason whenever I set the text color on hover to white the transition breaks?

```css
.social-item {
    margin-left: 0.25vw;
    padding: 0.1vw;
    transition: 0.2s;
    color: white;
}
.social-item:hover {
    background: linear-gradient(to left, #8E2DE2, #DC0486);
    color: white;
}
```

```html
<a href="https://google.com" class="social-item"><i class="fab fa-keybase"></i> Keybase</a>
```

I'm also using Bulma and Font Awesome.

Answer: 
Meanwhile here are the places (not all) where/how you can call a function

```
    init() {
        self.testFunction()     // non always good, but can
    }

    var body: some View {
        self.testFunction()            // 1)
        return VStack {
            Text("TextBox")
               .onTapGesture {
                  self.testFunction()    // 2)
               }
            Text("SecondTextBox")
        }
        .onAppear {
            self.testFunction()     // 3)
        }
        .onDisappear {
            self.testFunction()     // 4)
        }
    }

```

... and so on
There is a reason, when writing in swift UI (iOS Apps), that there is a View protocol that needs to be followed. Calling functions from inside the structure is not compliant with the protocol.

The best thing you can do is the .on(insertTimeORAction here).

[Read more about it here](https://developer.apple.com/documentation/swiftui/text/onappear(perform:))