전체 글
-
Redux Architecture (ReSwift)Swift/아키텍쳐 2021. 11. 18. 13:12
https://github.com/ReSwift/ReSwift/ GitHub - ReSwift/ReSwift: Unidirectional Data Flow in Swift - Inspired by Redux Unidirectional Data Flow in Swift - Inspired by Redux - GitHub - ReSwift/ReSwift: Unidirectional Data Flow in Swift - Inspired by Redux github.com ReSwift는 Swift의 단방향 데이터 흐름 아키텍처를 Redux 와 유사하게 구현한 것이다. ReSwift는 앱 구성 요소를 아래 세 가지로 분리하고 있다. State : ReSwift 앱에서 전체 앱 상태는 데이터 구조에 명시적으로 저..
-
swift Pecker란Swift 2021. 11. 15. 16:52
https://github.com/woshiccm/Pecker GitHub - woshiccm/Pecker: CodePecker is a tool to detect unused Swift code. CodePecker is a tool to detect unused Swift code. Contribute to woshiccm/Pecker development by creating an account on GitHub. github.com 유명한 예제들을 보다가 Pecker라는게 있어서 알게 되었다. Pecker란? Pecker는 사용되지 않는 코드를 detect 해준다. warning으로 보여주는 셈이다. 물론 사용되지 않는 변수 선언정도는 기본적으로 warning이 나오나, 위를 보면 protocol..
-
Xcode 빌드 속도 높이기2 - cocoapods-binary-cacheSwift 2021. 11. 11. 14:32
https://kkimin.tistory.com/15 Xcode 빠른 빌드가 필요할때 컴파일 타임을 확인하기 DerivedData 파일 삭제 rm -rf ~/Library/Developer/Xcode/DerivedData rm -rf ~/Library/Developer/Xcode/DerivedData (가끔 원인불명 warning이 날때 derivedData 파일을 삭제하면 해결.. kkimin.tistory.com 위의 글에 이어서 빠른 빌드를 위한 노력2 우아한 형제 기술 블로그에서 CocoaPods의 경우 빌드 시 라이브러리도 함께 빌드 되어 컴파일 속도에 영향을 끼치기 때문에 비교적 가벼운 라이브러리 및 내부 코드에서 디버깅이 필요한 라이브러리를 추가하였고, Carthage의 경우 내부 코드 디버..
-
Ribs - 로그인편Swift/아키텍쳐 2021. 10. 15. 16:36
위를 이어서 진행하고 있습니다. 이전편 : https://kkimin.tistory.com/89 Ribs 예제 도입기 - Root편 https://github.com/uber/RIBs/wiki 이거를 그대로 따라가면서 Root, LoggedIn 을 만들어 보자! 아 예제로 이런걸 구현하는구나 한눈에 이해한뒤,. 순서대로 1. Root 를 생성한다. 2. AppDelegate에서 호출 func.. kkimin.tistory.com 우버와 달리 login에 input은 하나만 넣어서 진행할 예정이다. 로그인에 통신 쪽까지 구현해보고 싶어서 다른건 좀 덜어내고 할 예정이다. 먼저 RootBuilder에서 Router, Interactor, View, Component를 모두 생성하고 DI를 정의합니다. Roo..
-
Ribs 예제 도입기 - Root편Swift/아키텍쳐 2021. 10. 15. 11:03
https://github.com/uber/RIBs/wiki 이거를 그대로 따라가면서 Root, LoggedIn 을 만들어 보자! 아 예제로 이런걸 구현하는구나 한눈에 이해한뒤,. 순서대로 1. Root 를 생성한다. 2. AppDelegate에서 호출 func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { let window = UIWindow(frame: UIScreen.main.bounds) self.window = window let launchRouter = RootBuilder(dependency:..
-
Ribs 예제 도입기 - Ribs 설치 편Swift/아키텍쳐 2021. 10. 15. 10:16
https://github.com/uber/RIBs#installation-for-ios 위의 방법을 참고해서 우선 설치를 한다. 나는 pod을 사용했다. pod 'RIBs', '~> 0.9' 그리고 나서 RIB 템플릿을 Xcode에 추가해야한다.https://github.com/uber/RIBs/tree/master/ios/tooling install-xcode-template.sh 를 아래처럼 실행한다. ./install-xcode-template.sh => 위 그림처럼 나오면 Xcode에 적용이 안료된것이다. NewFile을 만들때 아래처럼 템플릿이 보이면 아주 잘 적용된것입니다~ 그리고 나서 빌드를 했더니 문제가 생긴다. 바로 아래와 같은 내용인데,,, 뭔가 이상하다는 점을 알 수 있다. 그 외에..
-
Swift Moya 설치 및 내용, RxMoyaSwift 2021. 10. 13. 20:20
URLSession, Alamofire를 사용한뒤, Moya 를 사용해보기로 했다. => 적용하고나서의 나 대만족 우선 알아야되는 사항 13이상부터 가능함. - Moya' has a minimum deployment target of iOS 13.0 설치방법 pod file에 아래를 추가 pod 'Moya' pod install 하면, alamofire와 함께 install 되는것을 확인 할 수 있다. RxSwift를 사용하면서 Moya를 사용한다면 아래처럼 설치해야한다. pod 'Moya/RxSwift' 설명 https://github.com/Moya/Moya Moya 란, Alamofire를 한번 더 감싼 네트워크 라이브러리 할 수 있다. 그렇다면 왜 굳이 이런게 필요할까? 보통 작성하는 APIMan..
-
자꾸 까먹는 Swift Array 안전하게 배열 조회 하는법Swift 2021. 9. 30. 16:38
extension Array { public subscript (safe index: Int) -> Element? { return indices ~= index ? self[index] : nil // iOS 9 or later } } 매번 Array에서 Index를 safe 하게 꺼내기 위해 if index < list.count { print(list[index]) } 이렇게 하지 않고 위를 활용해 아래처럼 사용할 수 있다. let list = [1, 2, 3] list[safe: 4] // nil list[safe: 2] // 3 참고사항 https://developer.apple.com/documentation/swift/collection/1641719-indices Apple Develope..