-
Notifications
You must be signed in to change notification settings - Fork 0
Comparing changes
Open a pull request
base repository: lichaoyu/iOSInterviewQuestions
base: master
head repository: ChenYilong/iOSInterviewQuestions
compare: master
- 18 commits
- 179 files changed
- 1 contributor
Commits on Jul 10, 2024
-
feat: [swift101]add multiple test functions and class, struct examples
Added new test functions and examples to SwiftPlaygroundTest for better understanding of Swift structures, classes, and enums:- Added a `welcome` function to return a welcome message. - Added `testWelcome` to demonstrate the `welcome` function and a parameterized `welcome(name:)` function. - Added `error` function to return an error tuple and `testError` to print error details. - Added multiple variations of `subtractOne` functions and `testSubtract` to show their usage. - Added `addOne` function with a default parameter and `testAddone` to show its usage. - Defined enums `Product`, `Suit`, and `Card` with associated test function `testEnum`. - Added struct `Point` and class `Student` with `testStruct` and `testClass` to demonstrate struct and class behaviors. - Added `Company` struct and `Person` class with `testStructAndClass` to explore struct mutability and reference type behaviors. - Added `Cube` struct with property observers and `testStructPropertyObserver` to demonstrate property observers. - Added `BankAccount` struct with mutating methods and `testStructMutatingWithBankAccount` to demonstrate mutating methods. - Added `LightSwitch` enum with mutating method and `testMethodWithLightSwitch` to show state transitions. - Added class hierarchy `Enemy` and `Lion` with `testInheritance` to demonstrate inheritance and method overriding. - Added `Shoe` struct and `testInitializeWithShoe` to explore initializer overloading. - Added `Products` and `Bottle` classes with `testInitializeWithProduct` to show class initializers and convenience initializers. # reference: Intermediate Swift: iOS App Development with UIKit This code modification is based on the Intermediate Swift programming tutorial that covers iOS app development with UIKit. The tutorial provides insights into function handling, enum usage, and the differences between value types (structs) and reference types (classes). It also delves into properties, methods, initializers, and class inheritance, preparing developers to advance from basic Swift knowledge to a more professional level.
Configuration menu - View commit details
-
Copy full SHA for 8b2b76b - Browse repository at this point
Copy the full SHA 8b2b76bView commit details
Commits on Jul 11, 2024
-
feat: demonstrate dependency inversion in SwiftUI using Property Wrapper
Demonstrate Dependency Inversion in SwiftUI using Property Wrapper - Introduced the use of `@StateObject` to manage the lifecycle of objects in SwiftUI views. - Showcased how to inject dependencies into a `@StateObject` using initializer injection. - Example 1: Injecting `NetworkService` into `ViewModel` via initializer. - Example 2: Injecting `Task` into `TaskViewModel` via initializer. - Provided examples of complex state management across multiple views using `@ObservedObject`. - Example: `User` class observed by `ContentView` and `EditUserView`. - Simplified the state management by combining `firstName` and `lastName` into a single `name` property. - Explained how `@Binding` can be used to allow child views to mutate state in parent views. - Example: `ParentView` and `ChildView` sharing and modifying a text state. - Clarified the different methods of dependency injection: Initializer injection, Property injection, and Method injection, and how they relate to the examples provided. This commit includes code examples demonstrating each of the above points, aiming to improve the modularity, testability, and maintainability of SwiftUI applications through effective dependency management. Examples: 1. Initializer Injection: ```swift class NetworkService { /* ... */ } class ViewModel: ObservableObject { @published var data: [String] = [] init(networkService: NetworkService) { /* ... */ } } struct ContentView: View { @StateObject private var viewModel: ViewModel init(networkService: NetworkService) { _viewModel = StateObject(wrappedValue: ViewModel(networkService: networkService)) } var body: some View { /* ... */ } }
Configuration menu - View commit details
-
Copy full SHA for f7a3383 - Browse repository at this point
Copy the full SHA f7a3383View commit details
Commits on Jul 12, 2024
-
feat: migrate SwiftUI property wrappers to iOS 17 style
Migrate SwiftUI Property Wrappers to iOS 17 Style - Updated project to use iOS 17's new `@Observable` macro for property wrappers. - Demonstrated the changes and improvements in property wrappers with iOS 17. - Converted existing `@StateObject` and `@Published` to use `@State` and `@Observable` respectively. - Refactored `Settings` class and related views to adhere to the new observation system. - Simplified state management and improved performance by leveraging the new SwiftUI observation techniques.
Configuration menu - View commit details
-
Copy full SHA for 39b5142 - Browse repository at this point
Copy the full SHA 39b5142View commit details
Commits on Jul 13, 2024
-
docs: add architecture diagram to illustrate TCA and Redux features
Add Architecture Diagram to Illustrate TCA and Redux Features - Created an architecture diagram to visually represent the key features of The Composable Architecture (TCA) and Redux. - The diagram includes: - The unidirectional data flow in both TCA and Redux. - Components such as State, Actions, Reducers, Store, and Middleware. - Comparison of how TCA and Redux handle side effects and state management. - Integration of iOS 17 updates in TCA with @observable, State, and Environment. This visual aid helps to understand the similarities and differences between TCA and Redux, and how the new iOS 17 features impact state management in SwiftUI. Changes include: 1. Added architecture_diagram.png to the docs/images directory. 2. Updated README.md to include the new diagram and a brief explanation.
Configuration menu - View commit details
-
Copy full SHA for b6c4e9f - Browse repository at this point
Copy the full SHA b6c4e9fView commit details -
Configuration menu - View commit details
-
Copy full SHA for 78747e5 - Browse repository at this point
Copy the full SHA 78747e5View commit details
Commits on Jul 14, 2024
-
increment and decrement demo with Redux and SwiftUI
Configuration menu - View commit details
-
Copy full SHA for 601321f - Browse repository at this point
Copy the full SHA 601321fView commit details -
feat: SwiftUI Redux demo with multiple reducers
use multiple reducers and state
Configuration menu - View commit details
-
Copy full SHA for a70df4d - Browse repository at this point
Copy the full SHA a70df4dView commit details -
Configuration menu - View commit details
-
Copy full SHA for 0ce6cbd - Browse repository at this point
Copy the full SHA 0ce6cbdView commit details -
feat: SwiftUI Redux demo with middleware
IncrementMiddleware and IncrementActionAsync
Configuration menu - View commit details
-
Copy full SHA for b6d3ea7 - Browse repository at this point
Copy the full SHA b6d3ea7View commit details
Commits on Jul 18, 2024
-
Configuration menu - View commit details
-
Copy full SHA for aa2baef - Browse repository at this point
Copy the full SHA aa2baefView commit details
Commits on Jul 20, 2024
-
Configuration menu - View commit details
-
Copy full SHA for b91ceb5 - Browse repository at this point
Copy the full SHA b91ceb5View commit details -
Configuration menu - View commit details
-
Copy full SHA for a270f02 - Browse repository at this point
Copy the full SHA a270f02View commit details
Commits on Jul 21, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 905774a - Browse repository at this point
Copy the full SHA 905774aView commit details -
Configuration menu - View commit details
-
Copy full SHA for 694d0c0 - Browse repository at this point
Copy the full SHA 694d0c0View commit details -
Configuration menu - View commit details
-
Copy full SHA for 842ccef - Browse repository at this point
Copy the full SHA 842ccefView commit details
Commits on Jul 22, 2024
-
feat: [SwiftUI Redux Movies demo] get MovieDetail from API
feat: Enhance Webservice to properly decode MovieDetail from API - Updated Webservice to improve error handling and decoding logic. - Added `Rating` struct to handle nested `Ratings` array in the API response. - Included `ratings` field in `MovieDetail` to match API response structure. - Enhanced error handling to capture network errors, decoding errors, and no data scenarios. - Used `do-catch` block for decoding to provide detailed error reporting. These changes ensure that `movieDetail` is correctly parsed from the API response and errors are handled appropriately.
Configuration menu - View commit details
-
Copy full SHA for 5b56824 - Browse repository at this point
Copy the full SHA 5b56824View commit details -
Configuration menu - View commit details
-
Copy full SHA for 8b0148d - Browse repository at this point
Copy the full SHA 8b0148dView commit details
Commits on Feb 19, 2025
-
Configuration menu - View commit details
-
Copy full SHA for ede244d - Browse repository at this point
Copy the full SHA ede244dView commit details
This comparison is taking too long to generate.
Unfortunately it looks like we can’t render this comparison for you right now. It might be too big, or there might be something weird with your repository.
You can try running this command locally to see the comparison on your machine:
git diff master...master