본문 바로가기

Swift59

[Swift] lazy var 사용 시 retain cycle 주의 [iOS - swift] lazy var 클로저 사용 주의 (리테인 사이클, 메모리 릭) Lazy var 클로저 사용시 주의사항 lazy var 클로저 사용 시 retain cycle이 발생하는지? 아래 1)번과 2)번 구분 (아래에서 계속) 1) private let text = "label" private lazy var label: () -> UILabel = { let label = UILabel() label. ios-development.tistory.com lazy var는 어떠한 연산을 통해 변수를 생성하기 위해서 closure를 사용하게 된다. 이 때 아래와 같이 블록{} 마지막에 () 가 붙은 형태는 nonescaping closure라고 해서 실행 즉시 결과를 반환함을 가정하기 때문에.. 2023. 1. 16.
[Swift] nil vs null The difference between nil, Nil, NULL, and NSNull in Swift As a programmer, sometimes you will need to define “nothingness”… 🧐 Data stores can have a value, or simply be nothing, this nothing comes in different flavors (nil, Nil, Null, NSNull) which all came to be called “null”. In Swift, you will n www.linkedin.com LinkedIn에 nil과 Null의 차이에 대한 글이 올라와있어서 요약해보았다. 프로그래밍을 하면서 '아무것도 없음'을 표현할 필요가 있는데,.. 2023. 1. 7.
[Swift] Int vs Int32, Int64 What is the difference between Int and Int32 in Swift? In Core Data you can store Int16, Int32, Int64 but it is different from Int. What is the reason for their existence, how do you use them? stackoverflow.com The Basics — The Swift Programming Language (Swift 5.7) The Basics Swift is a new programming language for iOS, macOS, watchOS, and tvOS app development. Nonetheless, many parts of Swift .. 2023. 1. 7.
[Swift] Extension에서의 Override Extension 에서 Override 하기 안녕하세요. 피더입니다. 오늘은 Extension과 Override에 대해 알아보도록 하겠습니다. Extension 이란 Extension은 구조체, 클래스, 열거형, 프로토콜 타입에 새로운 기능을 추가할 수 있는 기능입니다. 클 feather.tistory.com Extensions — The Swift Programming Language (Swift 5.7) Extensions Extensions add new functionality to an existing class, structure, enumeration, or protocol type. This includes the ability to extend types for which you don’.. 2022. 10. 1.