This project is an iOS app built for iOS 17 using SwiftUI. It shows how to use modern iOS development practices and technologies. The app follows the MVVM pattern and uses SOLID principles. It includes features like listing countries with search and filtering, and basic Bluetooth scanning, assuming a panic button device.
- iOS 17
- SwiftUI
- Swift Package Manager
- Combine
- Swift Serialization (Encodable & Decodable)
The app uses the Model-View-ViewModel (MVVM) architecture. This separates the business logic and state management (handled by the ViewModels) from the UI (handled by the Views), making the app easier to test and maintain.
The code follows SOLID principles, which helps keep the system scalable, maintainable, and robust. For example, CountryFetcher
and CountrySearcher
components demonstrate these principles.
- The header time is updated every minute to display the current time.
- The app includes basic Bluetooth scanning, assuming the use of a panic button device.
-
ListView State Management: The app effectively handles different states like loading, empty, failure, and loaded.
-
Population Filtering: Users can filter countries based on population sizes.
-
Search Functionality: Users can search for countries by name.
- Color Management: Uses color sets from the asset catalog for consistent colors.
- Population Filter: Added a population filter caption view under the search bar with a clear button.
- Edge Case Handling: Handles all edge cases in the country list, including failure, empty, loading, and loaded states.
- Code Coverage: Ensures extensive unit test coverage for all ViewModels.
- Preview Support: All views and components can be previewed in the canvas for easy UI development.
- Clone the repository.
- Open the project in Xcode 15.3.
- Build the project to generate documentation.
- Go to Product → Build for → Documentation (or use
Ctrl + Shift + Cmd + D
).
- Go to Product → Build for → Documentation (or use
The project is fully documented using DocC. To view the documentation:
- Build the project as described above.
- Access the documentation through Xcode to get detailed insights into the codebase.
The ViewModels are fully unit tested, ensuring the business logic is reliable and the app is maintainable. You can generate a code coverage report to see the extent of the tests.
All views and components support previews in the Xcode canvas, allowing for easy UI development and iteration.
RocketSim_Recording_iPhone_15_2024-06-01_17.39.48.mp4
This project shows how to build a modern iOS app using SwiftUI. It focuses on clean architecture, robust state management, and best practices. The features and improvements demonstrate a comprehensive skill set in iOS development.