Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- 애니메이션
- Xcode
- 클린 코드
- Refactoring
- 리펙터링
- UICollectionView
- Observable
- rxswift
- ios
- ribs
- swiftUI
- clean architecture
- 스위프트
- 리팩토링
- map
- Human interface guide
- 리펙토링
- tableView
- SWIFT
- collectionview
- uiscrollview
- uitableview
- swift documentation
- Clean Code
- combine
- HIG
- MVVM
- UITextView
- RxCocoa
- Protocol
Archives
- Today
- Total
목록[weak self] (1)
김종권의 iOS 앱 개발 알아가기
[iOS - swift] DispatchQueue에서 [weak self]를 안써도 되는 이유 이해하기
기본지식 1) capture list 개념 closure = { [weak self] in // Void)? } 그래서 보통 위와 같은 전역변수가 아닌, 함수 or 메서드에 @escaping 키워드를 붙이는 것 func someFunc(_ closure: @escaping (Void) -> Void) { } 기본지식 3) [weak self]를 안써서 memory leak을 일으키는 코드 SomeClass의 setupClosure() 메서드를 보면 closure를 assign할 때 self를 집어넣음 -> retain cycle 발생 1) SomeClass 인스턴스가 closure 프로퍼티 참조 2) closure 프로퍼티가 SomeClass 인스턴스 참조 (이 부분이 클로저 안에서 self를 참조해서 ..
iOS 응용 (swift)
2024. 2. 10. 01:03