Implement a Custom Control/カスタムコントロールを実装にて、ミスがあります。
下記コード記述の際に必要なプロパティが存在しないためエラーが出ます。
override func intrinsicContentSize() -> CGSize {
let buttonSize = Int(frame.size.height)
let width = (buttonSize + spacing) * stars
return CGSize(width: width, height: buttonSize)
}
僕は下記のコードを記述して解決しました。
// MARK: Properties 星を出現させるためのプロパティを記述する。
//追加するプロパティです。
var spacing = 5
var stars = 5
参考URL
https://forums.developer.apple.com/thread/23021
http://inaka-gurashi.hatenablog.com/entry/%E4%BA%BA%E5%B7%A5%E7%9F%A5%E8%83%BD%E5%8D%B1%E9%99%BA%E6%80%A7
https://programmer-engine.work/archives/16831