Dev/WWDC 정리8 [WWDC19] Advances in Collection View Layout (Compositional Layout 정리) - 1 Compositional Layout Composable: 복잡한 것을 단순한 것들로 구성할 수 있는 Flexible: 어떠한 레이아웃도 작성할 수 있을 정도로 유연한 Fast: 빠른 Composing small layout groups together Layout groups are line-based Composition instead of subclassing (UICollectionViewFlowLayout) subclassing Item, Group, Section, Layout let size = NSCollectionLayoutSize( widthDimension: .fractionalWidth(1), heightDimension: .absolute(44) ) let item = NSColl.. 2023. 4. 27. [WWDC18] iOS memory deep dive - 1 메모리 사용량을 왜 줄일까 더 나은 사용자 경험 더 빠른 앱 실행 시스템 성능 향상 앱이 메모리에 더 오래 유지된다 (이건 뭘까) etc Memory pages 힙에 여러개의 객체들을 담을 수 있다 Page Type Clean: 값이 아무것도 안쓰여있는 상태 Dirty: 값이 하나라도 쓰여있는 상태 pages 수 * page 사이즈 = 앱의 메모리 사용량(memory in use) Memory mapped files read-only 파일은 항상 clean pages Clean 페이징할 수 있는 데이터 memory-mapped file 이미지, data Blob, 학습 모델, 프레임워크 등 모든 프레임워크에는 DATA CONST섹션이 있다. method swizzling(????)같은 런타임 장난을 치면.. 2023. 3. 27. [WWDC21] Use async/await with URLSession + 적용 시작 swift concurrency관련된 wwdc를 이어서 보는중입니다. 앞선 async/await 개념에 관한 글은 조금 정리가 덜 된 것 같아서 그 다음편으로 이어지는 해당 세션에 대한 글부터 먼저 올리고자합니다. 정리 마지막에는 실제 코드를 한번 리팩토링하는 경험까지 가져보았습니다. 예제 코드 (completion handler) 얼핏봤을 때 문제가 없어보이지만 이제부터 이 코드의 문제점 3가지에 대해서 앞으로 살펴볼 것입니다. Control Flow control flow를 먼저 살펴보자 우리는 data task를 만들고 task를 resume시킨다 task가 끝나면 completion handler로 들어와서, response를 확인하고 이미지를 만든다. control flow가 이렇게 앞뒤로.. 2023. 3. 23. [WWDC16] Understanding Swift Performance 2부 Protocol Oriented Programming (POP) 상속이나 참조 semantics없이 다형성 구현 protocol Drawable { func draw() } struct Point: Drawable { var x, y: Double func draw() { } } struct Line: Drawable { var x1, y1, x2, y2: Double func draw() {} } var drawables: [Drawable] = [] for d in drawables { d.draw() } class SharedLine: Drawable { var x1, y1, x2, y2: Double func draw() { // ... } } class도 물론 프로토콜을 사용할 수 있지만, re.. 2023. 3. 3. 이전 1 2 다음