Bibi's DevLog ๐ค๐
์ฝ๋๋ก UIView ๋ง๋ค๊ธฐ ๊ธฐ๋ณธ ํ ํ๋ฆฟ ๋ณธ๋ฌธ
๐ฑ๐ iOS/Code Templates
์ฝ๋๋ก UIView ๋ง๋ค๊ธฐ ๊ธฐ๋ณธ ํ ํ๋ฆฟ
๋น๋น bibi 2022. 5. 11. 16:23
import UIKit
class AnyView: UIView {
static let identifier = "AnyView"
private let anyLabel: UILabel = {
var label = UILabel()
return label
}()
override init(frame: CGRect) {
super.init(frame: frame)
setUI()
setConstraint()
}
required init?(coder: NSCoder) {
super.init(coder: coder)
setUI()
setConstraint()
}
private func setUI() {
self.addSubview(anyLabel)
}
private func setConstraint() {
// set constraints for all components with individual private functions like below
configureAnyLabelConstraint()
}
private func configureAnyLabelConstraint() {
anyLabel.translatesAutoresizingMaskIntoConstraints = false
NSLayoutConstraint.activate([
// set constraints for anyLabel
])
}
}
'๐ฑ๐ iOS > Code Templates' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[Swift] Linked List - Singly Linked List ๊ตฌํ (0) | 2022.12.15 |
---|---|
[Swift] URL์์ ๋น๋๊ธฐ๋ก ์ด๋ฏธ์ง ๋ค์ด๋ก๋ ๋ฐ ์บ์ฑํ๊ธฐ - NSCache (0) | 2022.05.18 |
UIFont Extension - custom font (0) | 2022.05.11 |
UIColor extension (0) | 2022.05.11 |
[Swift] JSON API์ ๋คํธ์ํฌ ํต์ ํ๊ธฐ - URLSession, JSONConverter (0) | 2022.04.29 |