I noticed that in snapchat they rounded their corners of a uiviewcontroller. I was wondering how could I replicate the same thing accross all view controllers. Would I declare it in the app delegate or in each individual view controller. Could someone please show me how to do it. I have an example image below. Look in the top corners of the view controller and you'll see that there rounded. I'm trying to replicate that.

You could use an extension, then you could apply a corner radius on any view, including the view controller's view. I haven't tried it though.
extension UIView {
func makeCorner(withRadius radius: CGFloat) {
self.layer.cornerRadius = radius
self.layer.masksToBounds = true
self.layer.isOpaque = false
}
}
Usage:
myController.view.makeCorner(withRadius: 10.0)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With