iOS. Custom View 만들기
iOS에서 Custom View를 만들때 xib를 불러와서 많이 이용합니다. 하지만 이렇게 할 경우에, Storyboard에서 사용할 경우에 오류가 발생하게 되는데요. 에러가 발생하는것은 무조건 해결해야한다고 생각합니다. 뭐 다음과 같이 #if TARGET_INTERFACE_BUILDER를 이용하면 됩니다. 123456789101112131415161718192021222324 func loadNib(name: String? = nil) -> UIView? { let nib = { () -> UINib in var bundle: Bundle? #if TARGET_INTERFACE_BUILDER bundle = Bundle(for: type(of: self)) #endif let nibName = name..
Mobile/iOS
2018. 8. 14. 15:02
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
TAG
- docker
- Spring
- Python
- android
- intellij
- Linux
- tomcat
- ubuntu
- Windows
- Kotlin
- golang
- github
- enum
- ios
- CentOS
- centos8
- cocoapods
- war
- Java
- windows10
- SWIFT
- MySQL
- nodejs
- rxswift
- go
- git
- Gradle
- php
- Codable
- Xcode
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | ||||
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 |
글 보관함