일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- uitableview
- 스위프트
- MVVM
- Refactoring
- clean architecture
- SWIFT
- Clean Code
- UITextView
- ios
- uiscrollview
- rxswift
- UICollectionView
- 리펙터링
- tableView
- map
- swift documentation
- Xcode
- ribs
- 클린 코드
- collectionview
- Protocol
- Observable
- RxCocoa
- combine
- HIG
- Human interface guide
- 리펙토링
- swiftUI
- 리팩토링
- 애니메이션
- Today
- Total
목록String(describing:) (2)
김종권의 iOS 앱 개발 알아가기
CustomStringConvertible 개념 해당 프로토콜을 준수하는 인스턴스에 설명을 붙일 수 있는데 여기에 사용되는 것 프로토콜을 보면 description 하나만 프로퍼티만 소유 public protocol CustomStringConvertible { var description: String { get } } print를 사용할때 내부적으로 이 description을 읽어서 print하는 것 enum A { case a case b } print(A.a) // "a" 만약 A에다가 CustomStringConvertible을 준수하면, description에 정의한 값으로 반환됨 enum A: CustomStringConvertible { case a case b var description..
String(describing:) 모든 Type의 instance를 문자열로 변환 print(String(describing: ViewController.self)) // ViewController 주의: ClassName.Type할 경우 컴파일 에러 -> 특정 클래스의 타입을 얻고 싶은 경우 ClassName.self로 접근 CustomStringConvertible description에 대한 정의가 되어있는 프로토콜 스위프트의 print()와 String(decription:)은 위 description 프로퍼티를 사용 CustomStringConvertible을 conform하고 있는 클래스의 객체를 print()하면 구현된 description프로퍼티를 사용 Linked List에서 연결된 N..