$ show ChenYilong/iOSInterviewQuestions
This repository is a comprehensive collection of iOS interview questions and answers (both Objective-C and Swift), accompanied by numerous standalone demo Xcode projects that illustrate specific concepts, architectures, and coding patterns. The dominant character is application because most demos are runnable iOS apps (MVVM, Redux, SwiftUI, Core Data, etc.), but the repo is hybrid as its primary purpose is educational reference rather than a single production system. The codebase is fragmented across many independent projects with varying quality, some using older toolchains. Key reusable assets include a protocol-oriented networking package, an async image caching component, an observable binding helper, a mock URL protocol for tests, and Clean Swift Xcode templates.
The LLM identified 5 files worth highlighting for reuse:
A protocol-based networking service that abstracts URLSession, allowing easy mocking and testing. It defines a NetworkService protocol with associated types and a default implementation using URLSession, making it reusable across any project needing HTTP requests.
A simple image cache using NSCache that can be used with SwiftUI's AsyncImage. It downloads images asynchronously and caches them in memory, providing a reusable component for any iOS app needing efficient image loading.
A lightweight Observable class that enables view-model binding without Combine. It wraps a value and notifies observers on changes. This pattern is reusable in any UIKit-based MVVM project.
A mock URLProtocol subclass that intercepts network requests and returns predefined responses from JSON files. It is reusable for testing any URLSession-based networking layer without hitting real endpoints.
An Xcode template for generating a complete Clean Swift (VIP) scene with ViewController, Interactor, Presenter, Router, Worker, and Models. This pattern can be extracted and reused to quickly scaffold new features following the Clean Architecture pattern.