두가지 형태로 구현할 수 있다.
1. 초기화 함수를 재정의 하는 방법
override init(frame: CGRect)
{
super.init(frame: frame)
// 초기화 작업
}
required init?(coder aDecoder: NSCoder)
{
super.init(coder: aDecoder)
fatalError("This class does not support NSCoding")
}
2. 초기화 함수 사용자화(커스터마이즈) 하기
init(parameter: Any)
{
super.init(frame:frame)
// 초기화 작업
}
required init?(coder aDecoder: NSCoder)
{
super.init(coder: aDecoder)
fatalError("This class does not support NSCoding")
}
'iOS Solution' 카테고리의 다른 글
키보드 표시될때 아래 테이블 뷰 셀 가리는 것 해결방법 (0) | 2022.08.04 |
---|---|
키보드 상단에 Done 또는 Cancel 버튼 추가하기 (0) | 2022.08.01 |
UITableView 만들기 (0) | 2022.08.01 |
이벤트 핸들러 구현하기 (0) | 2022.08.01 |
UIViewController 상속시 초기화 장소 (0) | 2022.08.01 |