UILabel View with rounded corner radius does not work on iOS 17 Beta - Xcode 15 Beta.

I am using a UILabel View and I have set the corner radius of it so as to make it rounded using runtime attributes. This is how it appears on iOS 16.x or below (any iOS 16 or below).

and this is how it looks on iOS 17 Beta. (Below Picture)

The dot appears like a square. no idea how to fix this.

Tested on multiple devices and the square issue only appears on iOS 17 Beta.

I know it's beta but here I am trying to figure out the reason. It could be a change, new feature, API change or anything else.

Answered by josdev in 760400022

I don't think that an SF Symbol with an UIImageView can be a more robust way. We're here to test the betas, and in this case if something is working in previous iOS versions and not in the new one, we have to question us why is not working before figuring another possible workaround.

In your case, it's a line of code you have to add to make it work in iOS17:

label.layer.masksToBounds = true

You're referring to the red or green "dot" on the left of each row? (It's a little bit confusing, because you're saying it's a UILabel, but there's no actual label text there, IIUC.)

If so, setting the properties of UILabel.layer was never really the right approach. The details of how a system-supplied control draws itself may change between versions, so assumptions like this aren't safe.

How about using a "circle" SF Symbol in a UIImageView instead? That seems like a more robust way forward.

Accepted Answer

I don't think that an SF Symbol with an UIImageView can be a more robust way. We're here to test the betas, and in this case if something is working in previous iOS versions and not in the new one, we have to question us why is not working before figuring another possible workaround.

In your case, it's a line of code you have to add to make it work in iOS17:

label.layer.masksToBounds = true

UILabel View with rounded corner radius does not work on iOS 17 Beta - Xcode 15 Beta.
 
 
Q