Make the View rounded iOS

Mr.Javed Multani
1 min readOct 5, 2020

To make a rounded UIView, specify a cornerRadius for the view’s layer. This also applies any class which inherits from UIView, such as UIImageView. Programmatically

Swift Code

someImageView.layoutIfNeeded()
someImageView.clipsToBounds = true
someImageView.layer.cornerRadius = 10

Objective-C Code

[someImageView layoutIfNeeded];
someImageView.clipsToBounds = YES;
someImageView.layer.cornerRadius = 10;

Example

//Swift codetopImageView.layoutIfNeeded()…

--

--

Mr.Javed Multani

Software Engineer | Certified ScrumMaster® (CSM) | UX Researcher | Youtuber | Tech Writer