Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: lichaoyu/iOSInterviewQuestions
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: ChenYilong/iOSInterviewQuestions
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Checking mergeability… Don’t worry, you can still create the pull request.
  • 18 commits
  • 179 files changed
  • 1 contributor

Commits on Jul 10, 2024

  1. 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.
    ChenYilong committed Jul 10, 2024
    Configuration menu
    Copy the full SHA
    8b2b76b View commit details
    Browse the repository at this point in the history

Commits on Jul 11, 2024

  1. 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 { /* ... */ }
    }
    ChenYilong committed Jul 11, 2024
    Configuration menu
    Copy the full SHA
    f7a3383 View commit details
    Browse the repository at this point in the history

Commits on Jul 12, 2024

  1. 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.
    ChenYilong committed Jul 12, 2024
    Configuration menu
    Copy the full SHA
    39b5142 View commit details
    Browse the repository at this point in the history

Commits on Jul 13, 2024

  1. 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.
    ChenYilong committed Jul 13, 2024
    Configuration menu
    Copy the full SHA
    b6c4e9f View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    78747e5 View commit details
    Browse the repository at this point in the history

Commits on Jul 14, 2024

  1. feat: SwiftUI Redux demo

    increment and decrement demo with Redux and SwiftUI
    ChenYilong committed Jul 14, 2024
    Configuration menu
    Copy the full SHA
    601321f View commit details
    Browse the repository at this point in the history
  2. feat: SwiftUI Redux demo with multiple reducers

    use multiple reducers and state
    ChenYilong committed Jul 14, 2024
    Configuration menu
    Copy the full SHA
    a70df4d View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    0ce6cbd View commit details
    Browse the repository at this point in the history
  4. feat: SwiftUI Redux demo with middleware

    IncrementMiddleware and IncrementActionAsync
    ChenYilong committed Jul 14, 2024
    Configuration menu
    Copy the full SHA
    b6d3ea7 View commit details
    Browse the repository at this point in the history

Commits on Jul 18, 2024

  1. Configuration menu
    Copy the full SHA
    aa2baef View commit details
    Browse the repository at this point in the history

Commits on Jul 20, 2024

  1. Configuration menu
    Copy the full SHA
    b91ceb5 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    a270f02 View commit details
    Browse the repository at this point in the history

Commits on Jul 21, 2024

  1. Configuration menu
    Copy the full SHA
    905774a View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    694d0c0 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    842ccef View commit details
    Browse the repository at this point in the history

Commits on Jul 22, 2024

  1. 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.
    ChenYilong committed Jul 22, 2024
    Configuration menu
    Copy the full SHA
    5b56824 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    8b0148d View commit details
    Browse the repository at this point in the history

Commits on Feb 19, 2025

  1. Update objective_qa.md

    ChenYilong authored Feb 19, 2025
    Configuration menu
    Copy the full SHA
    ede244d View commit details
    Browse the repository at this point in the history
Loading