I'm trying to make the buttons with rounded corners. So far this is what I have. I keep getting the "Only instance properties can be declared @IBOutlet" error.
import UIKit
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
}
}
@IBOutlet var Button: UIButton! {
didSet {
Button.backgroundColor = .clear
Button.layer.cornerRadius = 5
Button.layer.borderWidth = 0.8
Button.layer.borderColor = UIColor.black.cgColor
}
}
@IBOutlet weak var sampleButton: UIButton! {
didSet {
sampleButton.layer.cornerRadius = 5
sampleButton.layer.borderWidth = 0.8
}
}