일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | |
7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 | 15 | 16 | 17 | 18 | 19 | 20 |
21 | 22 | 23 | 24 | 25 | 26 | 27 |
28 | 29 | 30 | 31 |
- Refactoring
- 클린 코드
- MVVM
- tableView
- swiftUI
- Clean Code
- Observable
- 애니메이션
- map
- 리팩토링
- 리펙토링
- combine
- 스위프트
- Human interface guide
- Xcode
- rxswift
- uitableview
- UICollectionView
- HIG
- clean architecture
- Protocol
- 리펙터링
- swift documentation
- uiscrollview
- SWIFT
- ribs
- collectionview
- UITextView
- ios
- RxCocoa
- Today
- Total
목록2024/01 (22)
김종권의 iOS 앱 개발 알아가기
CustomStringConvertible 개념 해당 프로토콜을 준수하는 인스턴스에 설명을 붙일 수 있는데 여기에 사용되는 것 프로토콜을 보면 description 하나만 프로퍼티만 소유 public protocol CustomStringConvertible { var description: String { get } } print를 사용할때 내부적으로 이 description을 읽어서 print하는 것 enum A { case a case b } print(A.a) // "a" 만약 A에다가 CustomStringConvertible을 준수하면, description에 정의한 값으로 반환됨 enum A: CustomStringConvertible { case a case b var description..
단순 열거 switch 형태 단순히 자연수를 입력하면 한글로 변환시키는 목적이 있을때 아래처럼 사용이 가능 extension Int { var asHangul: String? { switch self { case 1: return "하나" case 2: return "둘" case 3: return "셋" case 4: return "넷" case 5: return "다섯" default: return nil } } } print(1.asHangul) // "하나" 이렇게 사용하게되면 switch, case, return문이 여러개 들어가게 되면서 길어질 수 있기 때문에, dictinoary를 활용하면 조금 더 단순하게 표현이 가능 extension Int { var asHangulV2: String? ..
기초 개념) stored property와 computed property 메모리 관점 stored property - 별도의 메모리 공간 지정 o computed property - 별도의 메모리 공간 지정 x 사용 관점 stored property - 값을 저장 computed property - 접근하는 시점에 stored property들을 가지고 계산하여 반환 stored property를 사용할때 주의할 점 stored property를 사용하다보면 가장 큰 문제가, 상태 관리를 두 곳 이상에서 하는 경우가 발생 상태 관리를 두 곳 이상에서 하다보면 데이터 관리가 맞지 않아 코드 복잡도가 올라가는 현상이 발생 ex) 커스텀 뷰를 만드는데, ButtonWithImageView안에 또 다른 MyB..
일반적인 방법 네임스페이스를 구성할 때 보통 해당 클래스 혹은 해당 블록 안에 선언하여 구현 ex) 커스텀 버튼을 만들 때 (MyButton) 안쪽에 struct Config를 선언하여 사용 public class MyButton: UIButton { public struct Config { public let backgroundColor: UIColor public init(backgroundColor: UIColor) { self.backgroundColor = backgroundColor } } private let config: Config public init(config: Config) { self.config = config super.init(frame: .zero) setupUI() } ..
ipa 파헤치기 아이디어 앱 바이너리 파일인 .ipa 형식의 파일을 준비 미국 국가안보국에서 만든 오픈소스 ghidra를 활용 (무료) ghidra로 .ipa파일을 읽고난 후 RAM에 있는 데이터들을 code로 변환하는것 ghidra 설치 JDK 11버전이 없다면 설치 https://docs.oracle.com/goldengate/1212/gg-winux/GDRAD/java.htm ghidra github의 release에서 ghidra_11.0_PUBLIC_20231222.zip 설치 ghidra_11.0_PUBLIC_20231222.zip 폴더로 이동 cd ghidra_11.0_PUBLIC_20231222.zip ghidra 실행 ./ghidrarun (terminal창에서 jdk 파일 위치를 물어보..
Optional에서의 map, flatMap 개념 보통 map, flatMap은 Collection Type에서 사용하지만, Optional 내부를 보면 함수로 map, flatMap이 존재 @frozen public enum Optional : ExpressibleByNilLiteral { case none case some(Wrapped) @inlinable public func map(_ transform: (Wrapped) throws -> U) rethrows -> U? @inlinable public func flatMap(_ transform: (Wrapped) throws -> U?) rethrows -> U? } map 개념 Optional 타입에 nil이 아닌 값이라면, Optional..
UIKit framework 저장 경로 find 명령어를 통해 탐색 % find /Applications/Xcode.app -name UIKit.framework 탐색 결과 /Applications/Xcode.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/UIKit.framework /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/UIKit.framework /Applications/Xco..
Optional 타입 Optional 타입은 제네릭스를 받고, 그 제네릭스는 Optional 안에 감싼 값을 의미 Optional 타입은 enum이며, 2개의 case가 존재 none: 값이 없는 case some(Wrapped): 값이 있는 case enum Optional: ExpressibleByNilLiteral { case none case some(Wrapped) } 조건문에서 unwrap 방법 .some으로 접근 변수?로 접근 let optionalString = Optional("jake") switch optionalString { case .none: print("this is nil") case let .some(value): print("some value = ", value) } ..