apffhs41

@apffhs41

115 Points 0 Followers

17 Posts

0 Answers

User has not added any information in their about section.

apffhs41 · 2 years ago

UITextFieldDelegate 의 활용

키보드 입력 및 전반적인 text field 편집과 관련된 기능들을 수행하는 프로토콜 textFieldShouldReturn 과 같은 메소드를 사용할 수 있게 해준다 textField.delegate = self 로 사용을 시작할 수 있다...

apffhs41 · 2 years ago

Optional

! ! 을 사용하면 nil 일때 에러가 난다 -> 절대로 nil 이 아닌게 확실할 때 사용한다 let myOptional: String? myOptional = nil let text: String = myOptional! if != nil { } else { } nil 일...

apffhs41 · 2 years ago

timer 의 사용법

세 개의 버튼에 각각 다른 시간의 타이머를 부여할 때 세 개의 버튼에 각 key 에 대한 값으로 5초, 7초, 12초 부여 Timer() 을 설정 import UIKit import AVFoundation class ViewController: UIViewCo...

apffhs41 · 2 years ago

Protocol

Protocol 의 사용법 Protocol 은 서로 다른 Struct 나 Class 에 속한 데이터를 자유자재로 가져올때 사용한다 protocol 은 보통 호출자 (Handler) class 가 있는 file 에 입력한다 호출자 (Handler) 는...

apffhs41 · 2 years ago

as? as!

as? 아래와 같이 Animal class 를 상속받는 Human, Fish class 가 있다 me, myFriend 는 Human type 이고 Nemo 는 Fish type import Foundation class Animal { var name: String init(n:...

apffhs41 · 2 years ago

Text CoreML Model 만들기

직접 원하는 기능을 갖는 CoreML Model 을 만들 수 있다 Image Model 은 Create ML 프로그램으로 손쉽게 만들 수 있다 Text Model 은 Xcode Playground 를 통해 .mlmodel file 을 만든다 csv 파일의 구...

apffhs41 · 2 years ago

Pre-trained CoreML 사용하기

Pre-trained CoreML 을 이용하기 위한 준비작업 developer.apple.com 에서 Core ML Models 를 받아온다 식별하고 싶은 이미지를 고려하여 100MB 이하로 받는다 -> 100MB 이상의 파일은 git hub push...

apffhs41 · 2 years ago

Tuples

튜플은 혼합 타입의 배열이다 유형 1 튜플은 [ ] 을 사용하는 배열처럼 ( ) 를 사용하여 아무 타입의 object 를 넣는다 호출할 때도 0 번째부터 import Cocoa let tuple1 = ("YJ Kim", 32)...

apffhs41 · 2 years ago

guard let vs if let

guard let guard let 은 정말로 벌어져서는 안될 상황을 막기 위해 (guard) 사용한다 -> 만약 그 상황이 벌어진다면 (else) fatalError 로 에러 메시지를 띄운다 if let calcMethod = sender.current...

apffhs41 · 2 years ago

Struct vs Class

Class Class 는 init 을 만들지 않으면 Class 를 호출할 때 속한 property 를 인자로 받는 initializer 가 안뜬다 import Foundation class ClassHero { var name: String var universe: Strin...

apffhs41 · 2 years ago

Computed Property

computed property 의 조건 1. computed property 는 반드시 변수 (var) 이어야 한다 2. computed property 는 반드시 데이터 타입을 지정해야 한다 var numberOfSlices: Int { get { return pi...

apffhs41 · 2 years ago

Realm 을 이용한 Search bar 의 사용

설정하는 조건에 맞는 셀 찾기 Container 타입의 전역변수 itemList 를 읽어올 때 itemList 에 값을 대입한다 (CRUD) 전체 itemList 를 필터링 (filter) 하는데 조건은 다음과 같다 -> title propert...

apffhs41 · 2 years ago

새 pod 기능의 할당과 상속

SwipeCellKit 을 pod install 했을 때 새 swift file 에 해당 기능과 관련된 모든 내용을 할당한다 Super class 는 Sub class 의 내용에 대해서 아무것도 모른다 -> cell 의 identifier 조차도 몰라...

apffhs41 · 2 years ago

Realm 을 이용한 각 Realm Model 의 관계설정

Navigation View 에서 두 VC 의 데이터 타입 관계가 일대다 인 경우 @objc dynamic 은 Realm data 의 변화를 감시한다는 뜻이다 Category Class 에게 Item Class 는 Item 배열 (List) 이다 - 일대 다 im...

apffhs41 · 2 years ago

Realm 을 이용한 CRUD

Create try realm.write 는 {} 안의 내용을 '커밋' 하는 기능을 한다 데이터 추가는 realm.add do { try realm.write{ realm.add(category) }...

apffhs41 · 2 years ago

CoreData 를 이용한 CRUD

AppDelegate 에 CoreData import 와 헤더를 추가한다 import UIKit import CoreData // MARK: - Core Data stack @main class AppDelegate: UIResponder, UIApplicationDelegate { lazy var persi...

apffhs41 · 2 years ago

내부저장소 SQLite 에 데이터 저장하기

우선 저장하려는 Document folder 의 file path 를 만든다 SQLite 는 custom type 의 데이터를 저장할 수 있는 가장 작은 유저 홈 저장소다 class TodoListViewController: UITableViewController {...

Loading More Content