Hi i am searching a clean solution without overwriting drawRect or stuff like that to create a UIView with Rounded corners on the Top of the View. My main problem here is to create variable solution if the view is getting resized or something like that.
Is there a clean solution? Apple is this doing too on the first table item. it can’t be so hard to do this.
Hi i am searching a clean solution without overwriting drawRect or stuff like that
Share
You can do this by setting a
maskon your view’s layer:IMPORTANT: You should do this in your view’s
layoutSubviews()method, so the view has already been resized from the storyboardIn Swift <= 1.2
Swift 2.x
Swift 3.x