SkeletonProject is an iOS example application that demonstrates the implementation of common features and scenarios using the Composable Architecture (TCA) from Point-Free. This project serves as a reference and learning resource for developers looking to understand and apply the principles of TCA in their iOS applications.
The SkeletonProject application showcases the following features:
-
Splash Screen: Displays a splash screen with a countdown timer when the app launches, transitioning to the main screen after a short delay.
-
Tab-based Navigation: Implements a tab-based navigation system with two tabs: "Feed" and "Settings".
-
Feed Tab:
- Displays a list of feed items in a scrollable view.
- Allows users to add new feed items.
- Enables users to edit and delete existing feed items.
- Provides a details screen to view and edit the content of a selected feed item.
-
Settings Tab: Provides a settings screen for configuring app preferences, such as enabling dark mode.
-
Onboarding Flow: Demonstrates an onboarding flow for first-time users.
-
Data Persistence: Persists feed items and user settings across app launches using file storage.
-
Error Handling and Loading States: Handles error scenarios gracefully and displays appropriate error messages and loading indicators.
The SkeletonProject application is built using the Composable Architecture (TCA) from Point-Free, which is a state management and architecture pattern for SwiftUI applications. TCA promotes a unidirectional data flow and separates concerns between state management, view rendering, and side effects.
The application is structured into several features, each representing a specific functionality or screen. Each feature is implemented as a separate module, following the principles of TCA.
-
AppFeature: The root feature that manages the application's state and coordinates the transitions between the splash screen and the main screen.
-
MainFeature: Handles the tab-based navigation and manages the state of the "Feed" and "Settings" tabs.
-
FeedFeature: Responsible for managing the state of the feed items, including adding, editing, deleting, and displaying details.
-
UserSettingsFeature: Manages the user settings, such as enabling or disabling dark mode.
-
SplashFeature: Implements the splash screen functionality with a countdown timer.
-
OnboardingFeature: Handles the onboarding flow for first-time users.
The application's state is managed using the @Reducer
and @ObservableState
constructs provided by TCA. Each feature has its own state and reducer, which defines how the state should be updated in response to user actions or side effects.
Side effects, such as network requests, data persistence, and navigation, are handled using the @Dependency
and @Effect
constructs provided by TCA. This separation of concerns allows for better testability and maintainability of the codebase.
The application uses file storage to persist feed items and user settings across app launches. The @Shared
property wrapper from TCA is used to manage the shared state between different features.
Error handling and loading states are implemented using the @Reducer
and @ObservableState
constructs from TCA. Appropriate error messages and loading indicators are displayed to the user based on the application's state.
To run the SkeletonProject application, follow these steps:
- Clone the repository:
gh repo clone Saik0s/SkeletonProject
orgit clone https://github.com/Saik0s/SkeletonProject.git
- Run
make
- Open generated
SkeletonProject.xcworkspace
and run the project
The SkeletonProject is released under the MIT License.