2021-09-30 CGRect appendInterpolation

Last edit

Summary: This stuff drives me nuts sometimes. Suppose you have the following state variable in a SwiftUI view: @State private var textFieldFrame1 = . . .

Changed:

< This stuff drives me nuts sometimes.

to

> In the category of errors that you google but don't get results.


In the category of errors that you google but don't get results.

Suppose you have the following state variable in a SwiftUI view:

    @State private var textFieldFrame1 = CGRect()    

And you want to display that somewhere, as follows:

    Text("Frame of textfield 1 = \(textFieldFrame1)")

You'll get the following compiler error:

    No exact matches in call to instance method 'appendInterpolation'

The solution is as follows:

    Text("Frame of textfield 1 = " + String(describing: self.textFieldFrame1))