https://medium.com/swiftfy/swift-6-0-protocol-extensions-powerful-new-tricks-you-need-to-know-2e4a8372ed2f Swift 6.0 Protocol Extensions: Powerful New Tricks You Need to KnowUnleashing the Full Potential of Protocols with New Enhancements in Swift 6.0medium.com Swift 6.0에서 프로토콜 익스텐션의 추가된 기능들에 대해 설명해주고 있다1. Parameterized Extensionsprotocol Cacheable { associatedtype Key associatedtype Value..
공부
Alamofire vs URLSession: a comparison for networking in Swift Alamofire vs URLSession: a comparison for networking in SwiftAlamofire and URLSession both help you to make network requests in Swift. The URLSession API is part of the foundation framework, whereas…medium.com- 요약-Alamofire는 쓰기 편하고 retry 등의 기능을 지원한다. URLSession이 등장한 이후로는 굳이 필요없다면 쓰지 않아도됨. 하지만 커스텀하기 귀찮거나 편하게 쓰고 싶다면 Alamofire를 사용해라. 큰 규..
SwiftUI: Why You Need AnyView SwiftUI: Why You Need AnyViewAnyView’s “performance problems”… and solutions.medium.com AnyView, 정말 나쁘기만 할까?SwiftUI에서 AnyView는 종종 피해야 할 기능처럼 언급됩니다. 하지만 그 이유를 제대로 설명할 수 있는 사람은 드물며, 많은 경우 단순히 "안 좋다"는 소문에 의존하고 있죠. 이번 포스트에서는 AnyView에 대한 오해와 진실을 정리하고, 실제로 어떤 상황에서 유용하게 활용할 수 있는지를 풍부한 예시와 함께 소개합니다.✨ 다양한 View 타입을 리턴하는 방법SwiftUI는 some View를 사용하는 구조이기 때문에, 조건에 따라 서로 다른 View 타..

Swift에서Hashable이 Equatable을 채택하는 진짜 이유는 Hash Collision 때문이다. 글을 쓰게 된 계기.. 며칠 전 회사에서 일을 하며 DiffableDatasource을 사용하고 있었다. 이때 SnapShot에 해쉬값이 동일한 아이템을 넣었는데 크래쉬가 나지 않았다!!! 이유를 알기 위해 문서를 찾다 보니 아래와 같은 내용이 있었다. Updating Collection Views Using Diffable Data Sources Two identifiers that are equal must always have the same hash value. However, the converse isn’t true; two values with the same hash value ar..

이번에 회사에서 소셜로그인을 담당하게 되어 작업 중이었는데 Tuist 사용하는 프로젝트에 Google Sign-In 라이브러리가 추가시 빌드 에러가 발생하였습니다. could not build module 'GTMAppAuth 대충 이런 종류에 모듈을 찾을 수 없다는 에러가 마구마구 떠버려 몇시간을 서치한 결과.. 트위스트 에러였습니다. GoogleSignIn 6.2.0 이후 버전에는 트위스트에서 특정 헤더를 찾지 못하는 버그가 있어 이런 에러가 발생한 것이였습니다. 다시 여러번 시도해보니 6.2.0 버전은 정상적으로 빌드가 가능했습니다. 하지만 7.0.0 부터 swift concurrency와 info.plist에 키를 넣을 수 있는 등 여러 기능이 추가되었기 때문에.. 깃 이슈를 살펴본 결과 해결 방..