In Xcode 8, Apple says:
Xcode 8 removes the ability to customize views without restrictions with a frame that resizes. Unlimited views may look different after compiling with Xcode 8 when switching size classes at runtime. Go ahead, use constraints and autoresist masks using the device panel to achieve your desired location. (25894544)
In previous versions of Xcode, we used the definition in ViewDidLoad. But here, different elements were not created (and restrictions too), so the view was created with the size in the storyboard.
Now, in Xcode 8, we can no longer do this. We need restrictions because the frame is not initialized (why some of you have these values โโfor the frame size: 0, 0, 1000, 1000). For example, do it in ViewDidAppear and it will work fine. But first you will see your button without an angular radius.
So you can use this function (here in Objective-C) (where you want, even in the load function):
[self performSelector:@selector(setCornerToMyButton) withObject:NULL afterDelay:0];
You can request a delay, but even with 0 it works.
And change the radius in this function, for example:
- (void) setCornerToMyButton {
Hope this helps you.
source share