전체 글
-
Intro to REST APIBackEnd/REST API 2022. 3. 18. 00:04
REST ( REpresentational State Transfer ) 개발을 할 때 Server 와의 Communication 이 필요할 때는 Server 에 Request 를 하게되고, 오늘날 가장 권유되는 형태는 REST 이다. REST는 Architectural Style 이라고 할 수 있는데, 이러한 Style 을 작업자 모두가 지키면 서로서로 편하게 작업할 수 있다. (API 의 형태가 어떻게 생길 지 쉽게 알 수 있기 때문에. ) REST 에서는 5가지의 Request Verb 가 사용되고, 종류는 다음과 같다. GET POST PUT PATCH DELETE 이제 하나하나 더 알아보도록 하자. GET 은 CRUD 에서의 Read 와 같은 역할을 한다. 즉, 데이터를 가져온다. POST 는 ..
-
SwiftUI - Passing EnvironmentObjectSwiftUI 2022. 3. 17. 02:31
SwiftUI 에서 EnvironmentObject 는 매우.. 강력하다 import SwiftUI @main struct DeeepMemoApp: App { @Environment(\.scenePhase) var scenePhase let memoEditVM = MemoEditViewModel() let folderEditVM = FolderEditViewModel() let folderOrder = FolderOrder() let memoOrder = MemoOrder() var body: some Scene { return WindowGroup { HomeView() .environment(\.managedObjectContext, persistenceController.container.viewC..
-
계산기 앱(Calie) 줄바꿈 로직 정리Project 2022. 3. 15. 19:45
아래는 iOS 계산기앱 (Calie) 의 줄바꿈 시 사용하는 로직의 일부이다. 처음 줄바꿈에는 O(n) 의 Complexity 였지만, O(1) 으로 수정하였다. (약 1.5 ~ 2년 전에... ) 해당 로직을 새로 만드는 데에 1주일 정도 걸렸던 것 같은데 기억이 너무 가물가물해져서 한번 정리해둔다. func align(){ var sumForEachProcess = 0.0 let displayWidthCase = DisplayWidthCase.normal.rawValue // need to make it enum raw value of 0 if setteroi >= 0{ // compare last moved operator position to operator Index // first Index ..
-
Git commit id로 과거 시간여행카테고리 없음 2022. 2. 5. 21:58
Git commit id 이용해서 들락날락거리기 1. Commit Id 를 알아낸다. Terminal -> git log Github site -> insights 2. 이동하기. git checkout (이때, commit id 일부를 가진 branch 로 이동된다. ) 3.A 이동한 후 작업 , 저장하고싶을 때 git switch -c git add, commit, push 도 차례로 해주면 된다. 3.B 저장하고싶지 않을 때 git stash
-
Swift Language ) PropertiesSwift/Swift Language 2022. 1. 17. 14:12
Properties Properties 는 어떤 class, structure 또는 enumeration 과 values 를 연관시킨다. Stored properties 는 constant or variable values 를 instance 의 일부로 저장하고, computed properties 는 value 를 계산한다. Computed properties 는 classes, structures, enumerations 에서 사용 가능하고, Stored properties 는 classes, structures 에서만 사용 가능하다. Stored, computed properties 는 보통 특정 타입의 instance 에 관련되지만, type 자체와도 관련될 수 있다. 이러한 properties ..
-
SwiftUI - Action sheetSwiftUI 2022. 1. 13. 18:02
There are a couple of reasons you would use this method over the Boolean variable. First, none of the views discussed in this chapter can be used more than once for a view. If you try to attach two alert views, for example, only the last one will work. You can attach an alert, modal, or action sheet to sibling views in a view hierarchy, but you can’t attach more than one to the same view (or to ..