├── Backend └── Database.md ├── Design Patterns ├── VIPER.md └── VIPER.png ├── README.md └── Swifty Notes ├── Animations.md ├── Automatic Reference Counting (ARC).md ├── Cocoapods & Swift Package Manager.md ├── Core Animation.md ├── GCD & NSOperation.md ├── Memory Management.md ├── Network.md ├── RxSwift Example.png ├── RxSwift.md └── SwiftUI.md /Backend/Database.md: -------------------------------------------------------------------------------- 1 | # Database 2 | 3 | ## Firebase (noSQL) 4 | 5 | ### Pros 6 | 7 | - No need for any database setup or maintenance 8 | - Custom Security Settings 9 | - Great for small projects 10 | 11 | ### Cons 12 | 13 | - Complex querying may be difficult to implement 14 | - Data migration in your applicatio becomes difficult 15 | - High costs as apps grow fast 16 | 17 | ## MongoDB (noSQL) 18 | 19 | ### Pros 20 | 21 | - Dynamic schematics architecture for unstructured data and storage options 22 | - Reliable scalability 23 | - High Performance 24 | 25 | ### Cons 26 | 27 | - Joins on data are not supported 28 | 29 | -------------------------------------------------------------------------------- /Design Patterns/VIPER.md: -------------------------------------------------------------------------------- 1 | # VIPER Design Pattern 2 | 3 | ![VIPER](/Design Patterns/VIPER.png) 4 | 5 | 6 | 7 | ## Basics 8 | 9 | ### View 10 | 11 | - User Interface where user interacts or see or input information 12 | - Examples: UITableView, UICollectionView, UIView, UIButton, etc. 13 | 14 | ### Interactor 15 | 16 | - Logic layer: get data from database and provide logical functions 17 | - Examples: map data to another type, provide bonus when user finishes a task, etc. 18 | 19 | ### Presenter 20 | 21 | - **View** asks **Presenter** for information/data. **Presenter** asks **Interactor** to return data 22 | - **Presenter** communicates with **Router** to open new screens, but **Router** have the logic of transition 23 | 24 | ### Entity (Model) 25 | 26 | ### Routing 27 | 28 | - Navigation logics 29 | 30 | - Examples: ```pushViewController()```, ```addSubView()```, etc. 31 | 32 | ## Benefits 33 | 34 | - Make your codes scalable, easier to test each layer 35 | - Make your ViewController lightweight 36 | - Build the app based on use cases or behaviors 37 | 38 | ## Memory management 39 | 40 | - **Router** keeps a weak reference of the **View** and the **Presenter** 41 | - **Presener** hold strong refernces of **Router** and **Interactor** 42 | - **Interactor** keeps a weak reference of **Presenter** 43 | - **View** keeps a strong reference of **Presenter** 44 | 45 | -------------------------------------------------------------------------------- /Design Patterns/VIPER.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dks333/Study-Mobile-Development/72fba6d1084db9ef570727c80f70b3f345845f80/Design Patterns/VIPER.png -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # KD Mobile Development Journey 2 | Welcome to my journey path 3 | 4 | ## Published Applications   🎉 5 | App Name | Description 6 | ---------- | ------------------------------------------------------------ 7 | Kasa Games | [1v1 Creative Games](https://apps.apple.com/app/kasa-games/id1527215483) 8 | ARminder | Augmented Reality Reminder 9 | MarKetUp | Stock Market Simulator(Real-time & Virtual Cash) 10 | 11 | ## Projects 🛠 12 | Project Name | Description | Progress 13 | -------- | ---------- | :------------: 14 | Tiktok-Clone | Clone **Tiktok** App | 🔒 15 | KDInstagram | Clone **Instagram** App using three different design patterns (MVC, MVVM, VIPER) | ✅ 16 | ARelax | Help you stretch your neck druing work or studying (AR) | ✅ 17 | 18 | ## Design Patterns 19 | Content | Progress 20 | :------ | :-------: 21 | Singleton | ✅ 22 | MVC | ✅ 23 | MVVM (associated with RxSwift) | ✅ 24 | MVP | 25 | [VIPER Architecture](Design Patterns/VIPER.md) | ✅ 26 | 27 | ## iOS 28 | 29 | Type | Content | Progress 30 | :--- | :------ | :-------: 31 | Swift | UIKit | ✅ 32 | Swift | ARKit (Image Tracking) | ✅ 33 | Swift | [GCD & NSOperation](Swifty Notes/GCD & NSOperation.md) | ✅ 34 | Swift | ARC
[Memory Management](Swifty Notes/Memory Management.md) | ✅ 35 | Swift | [Networking](Swifty Notes/Network.md) | ✅ 36 | Swift | Delegates & Segues | ✅ 37 | Swift | Core Animation | ✅ 38 | Swift | Core Graphics | 39 | Swift | AVFoundation | 🔒 40 | SwiftUI | SwiftUI | 🔒 41 | Reactive Programming | [RxSwift](Swifty Notes/RxSwift.md) | 🔒 42 | Reactive Programming | Combine | 43 | 44 | ### Cocoapods & Swift Package Manager (Case Study) 45 | 46 | | Name | Progress | 47 | | :----------------------------------------------------------- | :------: | 48 | | [Cocoapods & SPM](Swifty Notes/Cocoapods & Swift Package Manager.md) | ✅ | 49 | | Lottie | ✅ | 50 | | SDWebImage | | 51 | | Texture Framework (AsyncDisplayKit) | | 52 | 53 | 54 | 55 | ## Android 56 | 57 | | Type | Content | Progress | 58 | | :----: | :-----: | :------: | 59 | | Kotlin | | | 60 | 61 | ## Hybrid 62 | - Flutter 63 | - React Native 64 | 65 | ## Backend 66 | 67 | - [Database: Firebase & MongoDB](/Backend/Database.md) 68 | 69 | ## UI/UX (Human Computer Interaction) 70 | 71 | | Tools | Content | 72 | | ------------------------- | ------------------------------------------------------------ | 73 | | Figma & Adobe Illustrator | [Second Hand Market App](https://www.figma.com/proto/dAsKLryHMNpJMb9l86isMi/Interactive-Prototype?node-id=8%3A1570&scaling=scale-down) | 74 | | Adobe After Effect | Lottie | 75 | 76 | ### Favorite Design List 77 | - [UnDraw](https://undraw.co/illustrations) 78 | 79 | ## Annotations 80 | - ✅   = I have either used or learned about 81 | - 🔒   = Studying currently 82 | -------------------------------------------------------------------------------- /Swifty Notes/Animations.md: -------------------------------------------------------------------------------- 1 | # Animation 2 | 3 | ## Core Animation 4 | 5 | 6 | 7 | 8 | 9 | ## Custom Transition between View Controllers 10 | 11 | https://juejin.im/post/5a309c466fb9a0451c3a6120 12 | 13 | UIViewControllerAnimatedTransitioning 14 | 15 | When the transition between the two view controllers begins, the existing view is added to a transition container view and the new view controller’s view is created but not yet visible, as illustrated below: 16 | 17 | ![Transition-3](https://koenig-media.raywenderlich.com/uploads/2019/04/Transition-3.png) 18 | 19 | 20 | 21 | 22 | 23 | [Source](https://www.raywenderlich.com/2925473-ios-animation-tutorial-custom-view-controller-presentation-transitions) -------------------------------------------------------------------------------- /Swifty Notes/Automatic Reference Counting (ARC).md: -------------------------------------------------------------------------------- 1 | # Automatic Reference Counting (ARC) 2 | 3 | 4 | 5 | ## How it works 6 | 7 | - Keeping the count of strong references 8 | - The instance is not deallocated until the last strong reference is broken 9 | 10 | ## Retain Cycle (Strong Reference Cycle) 11 | 12 | - Problem: Memory Leak 13 | - Cause: two strong references pointing to each other 14 | - Solution: 15 | - Weak references 16 | - Unowned References 17 | - Alwasys refers to an instance that has not been deallocated 18 | - Runtime error occurs when access unowned reference after the instance has been deallocated 19 | - An unowned optional reference can be nil 20 | 21 | ## Types that are managed by ARC (Reference Type) 22 | 23 | - Class 24 | - Closure 25 | 26 | ## Types that are NOT managed by ARC (Value Type) 27 | 28 | - Basic types, like Bool, Int, etc. 29 | - Struct 30 | - Enum 31 | - Tuple -------------------------------------------------------------------------------- /Swifty Notes/Cocoapods & Swift Package Manager.md: -------------------------------------------------------------------------------- 1 | # Cocoapods & Swift Package Manager 2 | 3 | ## Cocoapods 4 | 5 | ### Benefits 6 | 7 | - Dynamic Framewordks and static libraries 8 | - Easily managed dependecies 9 | - Supported by almost all iOS frameworks 10 | 11 | ### Disadvantages 12 | 13 | - Need to update once a while 14 | - Slower build time because all your dependencies will also be built 15 | 16 | ## Swift Package Manager 17 | 18 | ### Benefits 19 | 20 | - Multi-platforms 21 | - Test, Code, Execution in one tool 22 | - Reusable Codebase (Standardization) 23 | - Part of Xcode, so every Xcode released version contains SPM 24 | 25 | ### Composition 26 | 27 | - **Dependencies** 28 | - **Targets** 29 | - **Products** 30 | 31 | ### Design Concept 32 | 33 | - Safe: isolated environment 34 | - Fast: expandable relations 35 | - Expressive: -------------------------------------------------------------------------------- /Swifty Notes/Core Animation.md: -------------------------------------------------------------------------------- 1 | # Core Animation 2 | 3 | ## Metal 4 | 5 | 6 | 7 | ## OpenGL 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Swifty Notes/GCD & NSOperation.md: -------------------------------------------------------------------------------- 1 | # GCD & NSOperation 2 | 3 | ## GCD 4 | 5 | - Serial and concurrent 6 | - Synchronous method returns control to the caller only after the task is completed 7 | - Asychronous method returns control to the caller immediately 8 | - Three main types of queues 9 | - Main queue (only Async) 10 | - Mainly used to rendering User Interface without any interferences 11 | - Global queues (4 types of Quality of Service from User-interactive to Background) 12 | - Custom queues(Default: serial queues) 13 | - Deadlock 14 | - Solutions: Make queues concurrent, avoid using locks 15 | - Dispatch Barries: all works prior to the barrier are guarateed to complete in the same queue 16 | - No need to retain or release any of the global dispatch queues, including the concurrent dispatch queues or the main dispatch queue. Any attempts to retain or release the queues are ignored 17 | - On iphones, discretionary and background operations including networking are paused when Low Power Mode is enabled 18 | 19 | 20 | 21 | ## NSOperation 22 | 23 | - Operations are executed on a separate thread from GCD 24 | - Using dependencies to execute an operation after another one is done 25 | - Support KVO and KVC 26 | - Ready, cancelled, executed 27 | - Cacellation is enabled at any time duirng execution 28 | - NSBlockOperation 29 | - ```let blockOperation = BlockOperation{ () -> Void }``` 30 | - NSInvocationOperation (Not in Swift) 31 | - Operations with high priority will be executed first (5 levels) 32 | 33 | 34 | # GCD & Timer 35 | NSTimer requires an active run loop, when initialized in Main Thread it automatically uses the main run loop. If you need to make a background timer you need attach it to the thread’s run loop and invoke run() to make it active. 36 | - NSTimer needs one live NSRunLoop to execute it’s events. In main thread, the NSRunLoop is always live and will never stop until the app is terminated, but in other threads, you must invoke **run()** to active the NSRunLoop. 37 | - NSTimer must invoke invalidate() to release the current timer, otherwise, the timer will retain a strong reference of the current instance of target, and it will remain in memory until **invalidate()** invoked or app terminated; 38 | - NSTimer must created and invalidated in the same thread, and a lot of times, we may forget that. 39 | - [GCD & Timer](http://www.acttos.org/2016/08/NSTimer-and-GCD-Timer-in-iOS/) 40 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /Swifty Notes/Memory Management.md: -------------------------------------------------------------------------------- 1 | # Memory Management 2 | 3 | ## Memory Structure 4 | 5 | ![](https://media.geeksforgeeks.org/wp-content/uploads/memoryLayoutC.jpg) 6 | 7 | **1. Text Segment/Code Segment** 8 | 9 | It contains executable instructions. Usually, the text segment is sharable so taht only a single copy needs to be in memory for frequently executed programs. Also, the text segment is often read-only, to prevent a program from modifying its instructions 10 | 11 | **2. Initialized Data Segment** 12 | 13 | Initialized data segment, usually called simply the Data Segment. It contains **global variables and static variables** that are initialized by the programmer. This segment can be further classified into initilized read-only area and initialized read-write area. For example the global styring `char s[] = "hello world"` , the pointer variable `s` would be stored in read-write area while the string literal `"hello world"` is stored in read-only area. 14 | 15 | **3. Unintialized Data Segment(bss)** 16 | 17 | It contains all global vriables and static variables that are initialized to zero or do not have explicity initialization in source code. For instance, `global in j` and `static int j` 18 | 19 | **4. Stack** 20 | 21 | Stack contains the program stack, a LIFO struture, typically located in the higher parts of memory. Every time a function is called, a **Stack frame** is pushed into the stack, and the "satck pointer" will be set to track the top of the stack. When the function returns, the corresponding stack frame will be popped and terminated. Memoery in Stack is managed by the system, and the system automatically allocate and deallocate the variables. 22 | 23 | **5. Heap** 24 | 25 | Heap is the segment where dynamic memory allocation usually takes place. The memory is managed by programmers manually. Programmers can use `malloc`, `calloc`, `realloc` to manage the heap memory, and use `free` to delete the data. However luckily in Swift, Heap is managed by [ARC](./Automatic%20Reference%20Counting%20(ARC).md), so programmers don't need to handle memory allocation and deallocation on their behalf. 26 | 27 | ### Difference between Stack and Heap 28 | 29 | | | Heap | Stack | 30 | | --------- | :----------------------------------------------------------- | ------------------------------------------------------------ | 31 | | Structure | Based on Linked List, Tree, Array | Stack | 32 | | Feature | Manually handle the memory size, allocation & deallocation, etc | The system automatically handles allocating and deallocating the data, LIFO structure | 33 | | Object | Class, Referece Type, Variable Type | Value Type, such as struct, enum, Int, function return value, local variables | 34 | | Thread | Since it's shared and global, it may be not safe in multi-thread. | Thread-safe | 35 | 36 | 1. Access Speed: stack is faster than heap 37 | 2. Memory Limit: stack usually has memory size limit, but heap doesn't 38 | 39 | ## Source 40 | 41 | [Memory Layout of C Program](https://www.geeksforgeeks.org/memory-layout-of-c-program/) 42 | 43 | -------------------------------------------------------------------------------- /Swifty Notes/Network.md: -------------------------------------------------------------------------------- 1 | # Network 2 | 3 | ## Almofire vs. URLSession 4 | 5 | ### Almofire 6 | 7 | - Easy to implement features 8 | - Syntax are a lot easier to use, easier error handling 9 | - Updates of Almofire may cause crashes 10 | 11 | 12 | 13 | ## TCP/IP 14 | 15 | - Application -> Transport -> Internet -> Network Access 16 | - Application 17 | - Interface with end users 18 | - Data is formatted, converted, encrypted/decrypted, sent to users 19 | - Open/Close, manage a session between end user process 20 | - Transport (TCP) 21 | - Services the application with different ports 22 | - Reliable end-toend data transport and data stream services (TCP for reliable, UDP for unreliable) 23 | - Internet 24 | - Providing host addressing 25 | - Choose the best path to the destinatio network(Routing) 26 | - Network Access 27 | - Two sublayers: 28 | - Logical Link Control: provides services to the upper layers 29 | - Media Access Control: defines how devices access the medium, Token Passing Host addressing(MAC addressing) 30 | 31 | ## OSI 32 | 33 | - Application -> Presentation -> Session -> Transport -> Network -> Data Link -> Physical 34 | 35 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /Swifty Notes/RxSwift Example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dks333/Study-Mobile-Development/72fba6d1084db9ef570727c80f70b3f345845f80/Swifty Notes/RxSwift Example.png -------------------------------------------------------------------------------- /Swifty Notes/RxSwift.md: -------------------------------------------------------------------------------- 1 | # RxSwift 2 | 3 | ## Why using RxSwift 4 | 5 | Making serialization of data/event streams and asynchronous tasks more convenient 6 | 7 | - Asynchrony is simplified with declarative programming: no more nested callbacks, delegates, notifications, KVOs 8 | - Safe multi-threading with .observerOn(scheduler) 9 | - Clean code and release pressures in controller layers 10 | 11 | ## Subjects 12 | 13 | ### PublishSubject 14 | 15 | - Only accepts events that occur after subscribing to him 16 | 17 | ### ReplySubject 18 | 19 | - Accepts event after subscribing to him, as well as receive the event that was send before him(buffersize: the number of previous events) 20 | 21 | ### BehaviorSubject (the most common usage) 22 | 23 | - Accepts event after subscribing to him, as well as the last event 24 | 25 | ## Variable 26 | 27 | - Wrapped BehaviorSubject 28 | - Use ```.asObservable``` to unbox 29 | - Modify the value of the object when issuing an event 30 | 31 | ## Transformation 32 | 33 | 1. Map 34 | 2. FlatMap 35 | - FlatMapLatest: only care about changes in the value of the lastest subsription 36 | 37 | ## Resouces Release 38 | 39 | 1. Dispose (MRC) 40 | - Dispose Bags (ARC) 41 | 42 | ## Example: Tableview with RxSwift 43 | 44 | ![RxSwift Example](/Swifty Notes/RxSwift Example.png) 45 | 46 | 47 | 48 | ## Related Articles or Resources 49 | 50 | Credits from: This article 51 | 52 | MVVM & RxSwift 53 | 54 | -------------------------------------------------------------------------------- /Swifty Notes/SwiftUI.md: -------------------------------------------------------------------------------- 1 | # SwiftUI 2 | 3 | 4 | 5 | --------------------------------------------------------------------------------