# Cookpit Flickr API implementation for iOS with C++ core ## Requirement * Xcode * [Carthage](https://github.com/Carthage/Carthage) for dependency management ## Installation * Run `make ios` at root folder * Install iOS dependencies (do one of the following) * Run `carthage update --platform iOS` read `Cartfile`, rebuild dependency resolver, re-write Cartfile.resolved and fetch dependencies * Run `carthage bootstrap --platform iOS` read `Cartfile.resolved` and build previously listed version there ## Building * Open Cookpit.xcworkspace to develop iOS app ## Bridging Code * `objc_gen/` contains all bridging code in Objective-C++ generated by djinni's interface files in `djinni/` * `cookpit.xcodeproj` and `vendors/` are products from gyp which generating library projects for iOS app to use ## Architecture * MVVM - Model(M) is sharing between iOS and Android with C++ code. VM(View Model) is a class on Swift provide necessary data for application to render. V (View) is purely on iOS with Swift. V and VM are glued together with reactive paradigm in this project we use [RxSwift](https://github.com/ReactiveX/RxSwift/). ## Output * `<>_controller` which contains all necessary data (`<>_view_data`) for mobile app to render. Application layer (typically View Model class on iOS/Android needs to implement `<>_controller_observer` contracts to be able to receive data produced by C++ layer. `<>_controller` communicates with application layer by subscribing to method `void subscribe(const shared_ptr< <>_controller_observer >& observer)`. ## Folder structure ```bash ios ├── carthage/ # Carthage folder for iOS app dependencies ├── Cookpit/ # traditional xcode project folder ├── cookpit.xcodeproj/ # xcodeproj file (untrack) ├── Cookpit.xcworkspace/ # workspace file that bundle everything together ├── objc_gen/ # bridging code (untrack) ├── vendors/ # xcodeproj for C++ dependencies (untrack) └── Cartfile # Carthage file that controls dependencies ```