UIView Components に Lazy を使用していますか?
皆さん、
Swifter と iOS 開発者の皆さんに簡単な質問があります.
あなたの構想では
またね !
First time I wrote on Dev!
Swifter と iOS 開発者の皆さんに簡単な質問があります.
あなたの構想では
Lazy
の実装を使用していますか?// Without Lazy
var imageView: UIImageView = {
let imageView = UIImageView(forAutoLayout: ())
imageView.image = Asset.mapIconBold.image
imageView.frame = CGRect(x: 0, y: 0, width: 10, height: 10)
return imageView
}()
// With Lazy
lazy var reloadNavBarButton: BaseButton = {
let button = BaseButton(frame: CGRect(x: 0, y: 0, width: 60, height: 60))
button.configureForAutoLayout()
button.setImage(Asset.reload.image, for: .normal)
button.imageView?.setImageColor(color: .white)
button.addTarget(self, action: #selector(reloadApplication), for: .touchUpInside)
button.isHidden = true
button.contentEdgeInsets = UIEdgeInsets(top: 0, left: 20, bottom: 15, right: 10)
return button
}()
またね !
Reference
この問題について(UIView Components に Lazy を使用していますか?), 我々は、より多くの情報をここで見つけました https://dev.to/rsickenberg/are-you-using-lazy-for-your-uiview-components-2kodテキストは自由に共有またはコピーできます。ただし、このドキュメントのURLは参考URLとして残しておいてください。
Collection and Share based on the CC Protocol