おみくじアプリを作成しています
⇦の部分のエラーを解消したいです。
import UIKit
class ViewController: UIViewController {
@IBOutlet weak var myLabel: UILabel! @IBAction func getomikuji(_ sender: Any) {
// n + 1
// arc4random(n + 1)
let results = ["大吉","中吉","小吉","吉","凶","大凶"]
let random = arc4random_uniform(UInt32(results.count)) //let random = arc4random_uniform(10) //self.myLabel.text = String(random) self.myLabel.text = results[Int(random)] } override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view, typically from a nib. myLabel.layer.borderColor = UIColor.orange.cgColor myLabel.layer.borderWidth = 5 myLabel.layer.borderRadius = 50 ⇦このコードでエラーが出ます。 myLabel.layer.masksToBounds = true } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() // Dispose of any resources that can be recreated. }
}
このエラーが出てきます。
Value of type 'CALayer' has no member 'borderRadius'
``` でコードを囲んでいただくと、インデントが反映されて読みやすくなるので、修正のほどお願いします。
teratailの対応しているmarkdown記法はこちらをご確認ください。
https://teratail.com/help#about-markdown