2019-08-01 border is deprecated Use a RoundedRectangle shape

Last edit

Summary: Moving from Xcode 11 beta 4 to beta 5, you may get the following warning: 'border(_:width:cornerRadius:)' is deprecated: Use a . . .

Changed:

< .background(RoundedRectangle(cornerRadius: 16).strokeBorder(lineWidth: 2, antialiased: true))

to

> .background(RoundedRectangle(cornerRadius: 16).strokeBorder(Color.green, lineWidth: 2))


Moving from Xcode 11 beta 4 to beta 5, you may get a warning when you have borders in your code:

    Text("In publishing and graphic design, lorem ipsum is a placeholder text.")
        .border(Color.green, width: 2, cornerRadius: 16)

The warning is:

    'border(_:width:cornerRadius:)' is deprecated: Use a RoundedRectangle shape.

Here's a copy-paste solution to the above warning:

    Text("In publishing and graphic design, lorem ipsum is a placeholder text.")
        .background(RoundedRectangle(cornerRadius: 16).strokeBorder(Color.green, lineWidth: 2))