분류 전체보기
Error) failed to demangle superclass of ‘…’ from mangled name ‘…’
모듈화를 하고, 하나의 라이브러리를 여러 모듈에서 사용할때 런타임에 이런 오류를 마주칠 수 있다. failed to demangle superclass of ‘…’ from mangled name ‘…’ 결론부터 말하면 문제가 되는 클래스를 포함하는 서드 파티나 프레임워크의 mach-O type이 static framework인 것을 모두 dynamic framework로 고쳐주면 해결된다. Tuist의 경우에는 해당 라이브러리를 .framework로 빌드하면 mach-O type이 dynamic framework로 빌드 된다. 그럼 해당 문제가 왜 일어나는지 고찰해보자. Static framework, Dynamic framework 오류에 대해서 정확히 이해하기 앞서 static framework, ..
Existential any in Swift explained with code examples(번역)
원문: https://www.avanderlee.com/swift/existential-any/ Existential any in Swift explained with code examples Existentials in Swift are defined using the any keyword and provide dynamic types, but also come with performance impact you should know. www.avanderlee.com Existential any를 사용하면 type 앞에 any 키워드를 붙여 existential types를 정의할 수 있다. 간단히 말해 existential는 “any type이지만 protocol ’something’을 준수한다.”를..

Swift Opaque Types(번역)
원문: Some keyword in Swift: Opaque types explained with code examples Some keyword in Swift: Opaque types explained with code examples The some keyword in Swift allows you to define opaque parameter and return types. Expose only minimum APIs without losing performance. www.avanderlee.com Opaque Type Concrete Type을 정의하지 않고 예상되는 반환 타입을 설명할 수 있다. 이 같은 것은 SwiftUI body에 사용되는 것을 볼 수 있다. var body: some ..
SwiftUI) iOS13 부터 지원하는 간단한 커스텀 Attribute Text 만들기
SwiftUI에서는 attributeText를 iOS15부터 지원한다. 따라서 그 이전 버젼은 UIViewRepresentable을 사용해서 커스텀 하거나, Text() + Text() 형식으로 AttributeText를 만든다. 그 중 두번째 방법을 사용해서 간단한 커스텀 AttributeText를 만들어보자. UIViewRepresentable를 사용해서 커스텀 하려니 스유 개초보라 만들어진 View가 제대로 크기를 못잡고 지 맘대로 크기를 잡더라.. (비효율적인 코드를 작성했을 수도 있음.) attribute를 사용하는 화면마다 Text() + Text() 하기는 너무 비효율적이니, String의 extension으로 함수를 만들어 전체 String에서 특정 텍스트를 바꿀 수 있도록 해보겠음. 그러..