0

I am trying to turn my rectangular button into a sort of oval by getting edges on it. Is there anyway to do this programatically through swift?

Also, is there any way to add a string or text to the button? I appreciate it, still getting used to programming swift.

Thanks

Skiddyflyer
  • 213
  • 1
  • 2
  • 8

1 Answers1

0

You will need to use Quartzcore and layer property to achieve this. Eg -

import QuartzCore

let MyView = UIView(frame: CGRectMake(0, 0, 55, 55))
MyView.layer.cornerRadius = 5.0
MyView.clipsToBounds = true

You can add this in your ViewDidLoad function. Try it

zisoft
  • 22,770
  • 10
  • 62
  • 73
Aniket Bochare
  • 427
  • 2
  • 10