iOS

iOS/Swift

Swift - Type Casting

Type Casting Type Casting이란? https://docs.swift.org/swift-book/documentation/the-swift-programming-language/typecasting/ Documentation docs.swift.org Type Casting Determine a value`s runtime type and give it more specific tpye information. 공식문서에 따르면 Type Casting을 다음과 같이 설명하고 있습니다. 'Value의 런타임 타입을 결정하고 보다 구체적인 타입 정보를 제공한다' 라고 되어 있습니다. Type Casting은 인스턴스의 타입을 체크하는 방법이고 is 또는 as 연산로 실행됩니다. Type Cas..

iOS/Swift

Swift - @Property Wrapper

@Property Wrapper @Property Wrapper란? Swift 5.1 이후 나온 Property Wrapper가 무엇인지 알아보고 예시 및 프로젝트에 사용한 UserDefault 코드를 리팩토링하는 방법까지 한번 알아보겠습니다. https://github.com/apple/swift-evolution/blob/main/proposals/0258-property-wrappers.md https://www.swift.org/blog/property-wrappers/ Exploring Swift: Property wrappers in the wild Property wrappers were introduced in Swift 5.1 as a way to make it easier to reus..

iOS/UIKit

UIKit - UISheetPresentationController 사용해보기.

UISheetPresentationController UISheetPresentationController | Apple Developer Documentation A presentation controller that manages the appearance and behavior of a sheet. developer.apple.com 이번엔 'UISheetPresentationController' 에 대해서 알아보겠습니다. UISheetPresentationController는 sheet의 모양과 동작을 관리하는presentation controller 입니다. @MainActor class UISheetPresentationController : UIPresentationController UIP..

iOS/UIKit

UIKit - imageView의 cornerRadius와 Shadow 적용하기..

ImageView의 cornerRadius 이번엔 imageView에서 cornerRadius와 shadow를 동시에 적용하려 했을 때 발생하는 문제에 대해 알아보겠습니다. 우선 문제를 보기전에 imageVIew에서 간단히 모서리를 둥글게 만들어보겠습니다. 간단하게 imageView를 추가하고 X,Y축 정렬해서 테스트를 진행해보겠습니다. 이후 연결해준 viewController에 다음 코드를 작성합니다. class ViewController: UIViewController { @IBOutlet var mainImageView: UIImageView! override func viewDidLoad() { super.viewDidLoad() view.backgroundColor = .gray mainImag..

ios-hans
'iOS' 카테고리의 글 목록 (3 Page)