전체 글
-
Mac 안켜질 때 해결 방법!카테고리 없음 2022. 4. 8. 10:29
0. Power Cable 이 정상인지 체크 1. Reset NVRAM ( Non-Volatile Random Access Memory) 켜질때까지 Option Command R P 2. SMC (System Management Controller) Reset 충전기 뽑은 후 다시 꽂는다 Option Control Shift 전원 약 3초동안 누르다가 뗀 후, 전원 버튼 누르기 3. 리셋 환경으로 가기 전원 버튼 눌렀다 뗀 후 Command + R 그러면 리셋환경으로 이동하는데, 이때 언어 선택 후 Restart 누르면 리셋하지 않고 재시동 완료 ! (물론 원한다면 리셋 할 수도 있음)
-
Delegate & ProtocolArchitecture + Design Pattern 2022. 3. 28. 21:04
Swift 에서 controllers 간 communication 수단 중 하나인 Delegate & Protocol 은 주로 1:1 communication 에 쓰인다. (다른 수단으로는 Notification & Observer 도 있다. 1:n Communication 에 쓰임, completionHandler(Closure) 를 이용하는 방법도 있음 ) 먼저 간단히 설명하자면, Boss 와 employee 간의 관계로 이해하면 쉽다. (Boss 가 명령을 내릴 수 있는 list 는 protocol 에 정의된다. ) Boss 는 SettingsViewController, employee 는 ProfileViewController 로 보면 된다. 첫번째 화면은 첫번째 Screen 이자 Profile ..
-
ObservablesSwift/RxSwift 2022. 3. 25. 18:12
Observable == Observable sequence == Sequence An Observable is just a sequence, with some special powers. - Asynchronous. Observables produce events over a period of time, which is referred to as emitting. Events can contain values, such as numbers or instances of a custom type, or they can be recognized by gestures, such as taps. When an observable emits an element, it does so in what’s known a..
-
SubjectsSwift/RxSwift 2022. 3. 25. 00:44
import UIKit import RxSwift func example(of description: String, action: () -> Void) { print("\n--- Example of:", description, "---") action() } Observables are a fundamental part of RxSwift, but they’re essentially read-only. You may only subscribe to them to get notified of new events they produce. A common need when developing apps is to manually add new values onto an observable during runti..
-
Rx Swift Cocoa pods 로 설치하기, playground 연습 환경 구축Swift/Tips & Tricks 2022. 3. 23. 00:08
설치하기 !!! 1. Cocoapods 를 설치한다. (Terminal 에 입력) sudo gem install cocoapods 2. Current Folder 로 이동한다. 3. pod init -> podfile 이 생성된다. pod init 4. podfile 로 들어가서 수정 후 저장, 닫는다. # Uncomment the next line to define a global platform for your project # platform :ios, '9.0' target 'RxSwiftProj' do # Comment the next line if you don't want to use dynamic frameworks use_frameworks! # Pods for RxSwiftProj po..
-
Swift With REST API (using Alamofire, in progress )미완성 2022. 3. 18. 01:07
TODO Server: https://github.com/hanmok/TodoServer.git TODO SwiftCode : https://github.com/hanmok/TodoHabitREST let baseUrl = "http://localhost:5001" let targetUrl = "http://localhost:5001/todos" 먼저, Alamofire 의 도움을 받지 않고 REST API 호출하는 법 1. GET func getOneTodo(id: String, completion: @escaping (Result) -> Void ) { let url = "\(baseUrl)/\(id)" guard let URL = URL(string: url) else { return } var u..
-
Difference Between Params and body when Using HTTP RequestBackEnd 2022. 3. 18. 00:28
REST API 에 대해 학습하다가, HTTP 를 Request 할 때 parameter 를 body 에 넣어야 하는지, params 에 넣어야 하는지 궁금해졌다. 예전에도 youtube 를 따라 하면서 둘 모두 쓴 기억이 있는데 둘의 차이를 모른 상태로는 앞으로 어떻게 Request 를 보낼지 계속 헤맬 것 같아 찾아보았다. Stackoverflow 를 찾아본 결과, req.body 와 req.params 둘은 서로 다른 목적을 가지고 있다(고 한다). req.body 는 데이터를 서버에 보낼 때 (저장하는 등), POST Request 를 보낼 때 사용한다. 예를 들면 아래 코드와 같다. 코드에서는 mongodb 에 새로운 blog post 를 POST 하고 있다. request 의 body 내에 있..