일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- tableView
- swift documentation
- MVVM
- Human interface guide
- Refactoring
- swiftUI
- clean architecture
- Protocol
- UICollectionView
- 클린 코드
- 리펙토링
- collectionview
- rxswift
- HIG
- 스위프트
- 리팩토링
- map
- RxCocoa
- 애니메이션
- ios
- Xcode
- Observable
- SWIFT
- uiscrollview
- Clean Code
- 리펙터링
- combine
- uitableview
- ribs
- UITextView
- Today
- Total
목록iOS 응용 (swift) (675)
김종권의 iOS 앱 개발 알아가기
Custom Cell 셀에 들어갈 Model생성 (용도 - bind할 때 인수로 넘길 객체) // // TitleModel.swift // Testtes // // Created by 김종권 on 2020/11/01. // Copyright © 2020 jongkwon kim. All rights reserved. // import Foundation struct TitleModel { let title: String let subTitle: String } cocoa touch class -> "Also create XIB file"체크 후 넥스트 각 UI배치 및 hugging, compression 설정 (Description이 길어질 수 있으므로, Title의 hugging, compression모..
nib파일 인터페이스 빌더에서 생성한 객체들을 직렬화하여 저장하는 파일(UI를 구성하는 객체 정보) 세부 설정(폰트, 색상, 스타일) 및 객체 간의 연결정보 포함 nib파일 로드 앱이 런칭할 때 nib-loading code 라는 nib파일을 로드하는 프레임워크의 기능에 의해 자동으로 로딩 모든 객체들이 인스턴스화, 모든 연결이 재구성 앱이 런칭될 때 자동으로 로드될 nib파일은 info.plist파일에 기록 (이 파일을 바탕으로 초기화) nib파일과 관련된 라이프 사이클 nib파일 로드: nib에 관련된 리소스를 메모리 또는 캐쉬로 불러옴(인스턴스화) 그 객체들은 initWithCoder: 메시지 받음 (커스텀 뷰는 initWithFrame 메시지 받음) init메세지를 받아 초기화 초기화가 끝나면 커..
Codable이란? Encodable + Decodable 두 속성 모두 가지고 있는 타입 Encodable: 스위프트의 struct구조의 "객체"를 "json형식"으로 변한 하는 것 (Binary Data로 변환) Decodable: "json형식"을 "객체"로 변환 필요한 이유: 서버와 통신할 경우, 객체 그대로를 보내지 / 받지 않고, Binary Data로 통신 Encode swift의 struct객체 -> Binary Data (json형) struct정의 struct Person: Codable { var name: String var age: Int var birthDate: Date } Encode_ Binary데이터 변환 // create let person = Person(name: "..
sc특정 textField를 탭한 경우, 특정 위치로 scroll시키는 로직 ScrollView만들기 여기 참고 방향 정의 public enum ScrollDirection { case top case center case bottom } extension으로 scroll이동 구현 public extension UIScrollView { func scroll(to direction: ScrollDirection) { DispatchQueue.main.async { switch direction { case .top: self.scrollToTop() case .center: self.scrollToCenter() case .bottom: self.scrollToBottom() } } } private f..
info.plist에서 해당 부분 삭제 AppDelegate.swift에서 함수 두 가지 삭제 SceneDelegate.swift삭제 후 AppDelegate 수정 func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { window = UIWindow(frame: UIScreen.main.bounds) window?.rootViewController = ViewController() // 특정 ViewController window?.makeKeyAndVisible() return true } (정상 빌드 성공)
nib파일의 구성 인터페이스 빌더에서 정의한 요소들을 object grpah로 만든 파일 인터페이스 빌더에서 정의한 요소란? 색상, 폰트, ViewController등 인터페이스 빌더에서 구성된 파일: XML형태의 .xib지만, 컴파일 하면 .nib파일이 됨 저장되는 위치는 App Bundle iOS 앱의 파일 구조 iOS앱은 보안의 목적으로 자신이 속한 샌드반스안의 디렉토리에만 접근 가능 Bundle Contatiner: 파일 시스템 중 한 디렉토리 (실행 가능한 코드, 사진, 소리, nib파일 등의 자원) Data Container: 사용자를 위한 Data 기타 앱이름.app:이 디렉토리는 read-only권한만 부여되며 iCloud에 백업 x Documents/: 사진첩과 같은 앱의 사용자에게 보여..
NFD Mac OS에서 한글을 저장하는 방식 : NFD(Normalization Form Canonical Decomposition) "한글.txt"저장 -> "ㅎㅏㄴㄱㅡㄹ.txt"로 풀어서 유니코드로 저장 ex) 보통 mac에서 window로 파일을 전송할 때, window에서 파일을 열어보면 한글 자소가 분리되어 있는걸 발견 NFC Windows OS에서 한글을 저장하는 방식: NFC(Normalization Form Canonical Composition) "한글.txt"저장 -> 그대로 병합하여 유니코드로 저장 swift에서 UILabel에 문구를 넣을 때 NFD로 표현되는 경우 - NFC로 변환 let sample = "한글" lblTitle.text = sample.precomposedStri..
codable을 사용하여 json데이터를 가져오는 것 json자료형을 직접 파싱해서 사용하는 것은 코드상의 복잡함이 따름 -> 미리 struct형을 정해놓고 거기에 매핑되게끔하는 방법 case #1. 일반적인 사용방법 // json데이터 형태를 미리 정의 struct DataForm: Codable { var key_name1: String? var key_name2: String? } // json데이터 let sample = """ { "key_name1": "value1", "key_name2": "value2" } """.data(using: .utf8)! // 결과 let result = try! JSONDecoder().decode(DataForm.self, from: sample) print..