Client
The orchestration layer that wires together all Bricks modules, manages app lifecycle, tab configuration, analytics, and notifications.
The Client package is the orchestration layer of the Youll platform. It sits at the top of the Bricks dependency graph, importing Core, Onboarding, Player, and Profile. Client is where a customer app plugs into Bricks: it provides the setup functions, the screen configuration factory system, analytics wiring, push notification management, and the full coordinator hierarchy that drives navigation.
This page serves as a module reference. For the underlying architectural concepts, see:
- Bootstrap Sequence for Config setup and initialization order
- Coordinator Pattern for coordinator hierarchy, deep linking, and navigation patterns
- Module Interfaces for how optional modules are injected into AppCoordinator
- Communication Patterns for Combine publishers and delegate patterns
Package Dependencies
| Type | Dependencies |
|---|---|
| Internal (Bricks) | Core, Onboarding, Player, Profile |
| Firebase | Crashlytics, Messaging, RemoteConfig |
| Binary frameworks | AppsFlyerLib, PurchaseConnector, BrazeKit, BrazeUI |
| Transitive | SDWebImage (via Core), YoullNetwork (via Core) |
File Inventory
The Client package contains approximately 65 Swift files organized into three directories.
App/
Application-level singletons, configuration, and service managers.
| File | Purpose |
|---|---|
Config.swift | Config singleton implementation. Central state hub holding app config, networking, user service, and Combine publishers |
ConfigType.swift | Protocol defining Config's public API contract |
Config+Actions.swift | Config extension for app config fetching, timezone updates, Crashlytics logger setup, and downloaded sessions cache |
Config+User.swift | Config extension for user refresh, AppsFlyer/Firebase user ID sync, and BricksNetworkDataSource conformance for token management |
Keys.swift | setup(with:) function and Keys accessor for ClientKeysType |
UIConfigurator.swift | setupUIConfigurator(with:) function and UIConfigurator accessor for UIConfig |
AnalyticsManager.swift | Two-layer analytics system: AnalyticsManagerType protocol + AnalyticsManager singleton with 19 protocol conformances |
AppsFlyerManager.swift | AppsFlyer SDK wrapper with PurchaseConnector integration |
TrackingManager.swift | App Tracking Transparency (ATT) wrapper with trackingAuthorizationPublisher |
NotificationManager.swift | FCM token management, push notification parsing, UNUserNotificationCenterDelegate and MessagingDelegate |
UserNotificationManager.swift | Push notification authorization management with notificationAuthorizationPublisher |
LocalNotification.swift | Data model for local notification payloads |
RemoteNotification.swift | Data model for remote notification payloads |
Screen Config/ScreenConfigFactory.swift | ScreenConfigFactoryType protocol, setupScreenConfigFactory(with:), and global ScreenConfig accessor |
Screen Config/FactoryTypes.swift | All 24 sub-factory protocols for screen configuration |
Coordinators/
The full coordinator hierarchy for app navigation.
| File | Purpose |
|---|---|
Coordinator.swift | CoordinatorFlow enum (20 cases), ParentCoordinator protocol, ChildCoordinatorDelegate, and coordinator presenting utilities |
AppCoordinator.swift | Top-level coordinator owning UIWindow. Manages splash, auth/content branching, module injection, and app lifecycle |
AuthCoordinator.swift | Onboarding and authentication flow: splash video, onboarding slider, social proof, auth screens. Supports quiz during onboarding and anonymous login |
| Main/ | |
MainCoordinator.swift | Tab bar coordinator. Manages all tab content post-login, navigation delegation, and deep link routing |
MainCoordinators+TabSetup.swift | Tab creation: calls makeTabItems(), creates coordinators per tab, wires journey completion delegates |
MainCoordinator+RemoteNotifications.swift | Routes parsed remote notifications to appropriate screen navigation |
MainTabBarController.swift | Custom UITabBarController with tab bar appearance, haptic feedback, orientation support, and double-tap detection |
| Tabs/ | |
BaseCoordinator.swift | Base class for Home, Showcase, and Profile coordinators. Provides Tuya screen navigation utilities |
HomeCoordinator.swift | Home v1 (UIKit/GraphQL, deprecated) feed, tag feeds, category/subcategory navigation, journey content, timer, Tuya devices, welcome popups |
ShowcaseCoordinator.swift | Home v2 (Showcase, SwiftUI/GraphQL). Supports both showcase and explore showcase modes |
ExploreCoordinator.swift | Explore feed with generic or custom type, tag feeds, category/subcategory details |
JourneysCoordinator.swift | Journey list (UIKit or SwiftUI), journey details, slides, completion, restart |
LibraryCoordinator.swift | Library view, favorites, playlists, playlist details, downloads, history |
EventsCoordinator.swift | Events list and event details |
ActivityCoordinator.swift | Activity/workout page, workout details, workout player, exercise preview |
MealsCoordinator.swift | Meals page and meal details |
HomeNavigable.swift | Protocol for coordinators that support home-style navigation |
| Tabs/Profile/ | |
ProfileCoordinator.swift | User profile, settings, subscriptions, badges, Tuya device management |
ProfileCoordinator+Account.swift | Account management (edit profile, delete account) |
ProfileCoordinator+AppleHealth.swift | Apple Health settings screens |
ProfileCoordinator+Avatar.swift | Profile image picker |
ProfileCoordinator+Notification.swift | Notification settings in profile |
ProfileCoordinator+Reminders.swift | Reminder configuration screens |
ProfileCoordinator+SecretAction.swift | Hidden debug/admin actions |
ProfileCoordinator+Settings.swift | Settings screen, change password, measurement units |
| Static Coordinators/ | |
ContentDetailsCoordinator.swift | Shared singleton for content detail screens. Split across 8 files for auth, badges, content, events, facilitators, journeys, player, playlists, and reviews |
SearchCoordinator.swift | Shared singleton for search functionality |
SubscriptionCoordinator.swift | Shared singleton for subscription/paywall flows |
QuizCoordinator.swift | Shared singleton for quiz flows |
| Static Coordinators/ContentDetails/Utils/ | |
TabBarItem.swift | TabItem enum and TabItemDetails struct |
GenericConfig.swift | Generic configuration utilities |
AppToastConfig.swift | Toast notification configuration |
UnauthorizedUserActionManager.swift | Content gating alerts for anonymous/unsubscribed users |
PlayerOptionsViewModel.swift | Player options view model |
PortraitNavigationController.swift | Portrait-locked UINavigationController subclass |
Utils/
| File | Purpose |
|---|---|
FirebaseFlagProvider.swift | FlagProvider implementation using Firebase Remote Config |
BNAppConfig+DefaultConfig.swift | Default app configuration fallback values |
WhatsNewControllerManager.swift | "What's New" popup logic using content hash comparison |
UITabBarController+Utils.swift | Tab bar controller utility extensions |
UIViewController+PopupBar.swift | Popup bar (mini player) utility extensions |
UnitTesting.swift | Unit testing hook setup |
Setup Functions
Client exposes five setup functions that customer apps must call during initialization. All are called in AppDelegate.didFinishLaunchingWithOptions.
| Function | Purpose | Accessor |
|---|---|---|
Client.setup(with: ClientKeysType) | Provides app keys (API keys, URLs) | Keys |
Client.setupScreenConfigFactory(with: ScreenConfigFactoryType) | Provides the screen configuration factory | ScreenConfig |
Client.setupUIConfigurator(with: UIConfig) | Provides the UI configurator for design tokens | UIConfigurator |
Client.AnalyticsManager.setup(with: AnalyticsManagerType) | Provides the analytics implementation | AnalyticsManager.shared.analytics |
Client.Config.setup(with: environment, facebookAuthenticator:, enableRestoreAccount:) | Initializes the Config singleton | Config.shared |
Each setup function stores the provided instance in a module-level variable. The corresponding accessor fatally crashes if called before setup, ensuring initialization order is enforced at runtime.
For the full initialization sequence including Core setup and Settings configuration, see Bootstrap Sequence.
Config
ConfigType Protocol
ConfigType defines the public contract for the Config singleton. All coordinators and services depend on this protocol rather than the concrete Config class.
public protocol ConfigType: AnyObject {
// App configuration (fetched from server)
var appConfig: BNAppConfig { get }
// Auth state
var isLoggedIn: Bool { get }
var isAnonymousLogin: Bool { get }
var currentUserId: String? { get }
// Services
var facebookAuthenticator: FacebookAuthenticatoryType? { get }
var flagManager: FlaggingManager { get }
var bricksNetwork: BricksNetwork { get }
var userService: UserService { get }
// Combine publishers
var registrationCompletionPublisher: PassthroughSubject<Void, Never> { get }
var subscriptionCompletionPublisher: CurrentValueSubject<Bool, Never> { get }
var didGetAppConfiguration: CurrentValueSubject<Bool, Never> { get }
var requiredNetworkCheckPublisher: PassthroughSubject<Void, Never> { get }
var applicationLaunchPublisher: PassthroughSubject<Void, Never> { get }
// Network and delegates
var networkReachability: NetworkReachability { get }
var affiliateDelegate: AffiliateTokenDelegate? { get set }
// Actions
func didLogin()
func refreshCurrentUser(completion: ((_ error: Error?) -> Void)?)
func updateUser(completion: ((_ error: Error?) -> Void)?)
func logoutIfNeeded(completion: (() -> Void)?)
func getAppConfig()
func checkDownloadedSessionsCache()
}Config Extensions
Config+Actions handles:
getAppConfig(): Fetches app configuration from the API and stores it inappConfig. SendsdidGetAppConfigurationpublisher on completion.- Timezone update to the server
- Crashlytics non-fatal error logging setup
setAppsFlyerDeviceID(): Syncs the AppsFlyer device IDcheckDownloadedSessionsCache(): Validates cached downloaded sessions against available content
Config+User handles:
prepareCurrentUser(): Sets AppsFlyercustomerUserIDand Firebase Analytics user ID when user state changesrefreshCurrentUser(): CallsuserService.getProfile()to reload user dataBricksNetworkDataSourceconformance: Provides auth tokens to the networking layer for API requests
Tab Selection
Customer apps define their tab bar by implementing GenericConfigFactoryType.makeTabItems(), which returns an array of TabItem values. Each tab maps to a coordinator that MainCoordinator creates on startup.
TabItem Enum
| Case | Coordinator | CoordinatorFlow | Notes |
|---|---|---|---|
.home | HomeCoordinator | .home | Home v1 (UIKit/GraphQL) — Deprecated |
.showcase | ShowcaseCoordinator | .showcase | Home v2 Showcase (SwiftUI/GraphQL) |
.slices | .slices | Home v3 Slices (SwiftUI/REST) | |
.explore | ExploreCoordinator | .explore | Standard explore feed. Uses .generic or .custom type based on feature flags |
.exploreShowcase | ShowcaseCoordinator | .exploreShowcase | Explore using the showcase coordinator (alternative layout) |
.events | EventsCoordinator | .events | Events list and details |
.library | LibraryCoordinator | .library | Saved content, favorites, playlists, downloads |
.journeys | JourneysCoordinator | .journeys | Timeline journeys (UIKit view) |
.linearJourneys | JourneysCoordinator | .journeys | Linear journeys (SwiftUI view) |
.profile | ProfileCoordinator | .profile | Full profile with all settings |
.lightProfile | ProfileCoordinator | .profile | Limited profile (for isLightVersion apps) |
.meals | MealsCoordinator | .meals | Meal plans and nutrition |
.activity | ActivityCoordinator | .activity | Workouts and activity tracking |
.biometrics | via BiometricsModuleInterface | .biometrics | Requires module injection |
.community | via CommunityModuleInterface | .community | Requires module injection |
.custom(name) | via makeCustomCoordinator(name:) | N/A | Customer-defined custom tabs |
TabItemDetails
Each tab's visual appearance is configured by returning a TabItemDetails from makeTabItemDetails(for:):
public struct TabItemDetails {
public var accessibilityIdentifier: String
public var name: String
public var icon: UIImage?
public var selectedIcon: UIImage?
public var uppercased: Bool
public var tintColor: UIColor?
}Search in Tab Bar
Search can optionally appear as a tab bar item (rather than being accessed from a navigation bar button). This is controlled by two Settings:
Settings.isSearchInTabBar: Places search as a tabSettings.isSearchEnabled: Enables search functionality globally
When both are true, a search navigation controller is appended after all makeTabItems() tabs.
Custom Tabs
The .custom(name) tab case allows customer apps to inject tabs that Bricks has no knowledge of. The flow is:
- Customer app returns
.custom(name: "myTab")frommakeTabItems() - MainCoordinator calls
ScreenConfig.makeCustomCoordinator(name: "myTab") - Customer app's
ScreenConfigFactoryTypeimplementation returns aCoordinatorfor that name - The coordinator is used as-is for that tab
The default implementation of makeCustomCoordinator(name:) returns nil, which causes a fatal crash. Customer apps using .custom tabs must override this method.
Screen Config Factory
The screen configuration factory is the primary customization mechanism for the visual appearance of every screen in the app. Customer apps implement ScreenConfigFactoryType and its sub-protocols to provide screen-specific configuration objects (colors, fonts, layout, copy).
Protocol Hierarchy
ScreenConfigFactoryType is the root protocol with 24 sub-factory properties and one method:
| Property | Protocol | Optional | Screens Configured |
|---|---|---|---|
onboarding | OnboardingScreenConfigFactoryType | No | Splash, onboarding slider, auth screens, social proof, login, signup, forgot password |
contentDetails | ContentDetailsScreenConfigFactoryType | No | Category details, subcategory details |
library | LibraryScreenConfigFactoryType | No | Create playlist, library, playlist details, history, downloads |
quiz | QuizScreenConfigFactoryType | Yes | Quiz screen, intro, answers, suggested content, static results, portrait video |
superPaywall | SuperPaywallScreenConfigFactoryType | No | Super paywall with slices |
paywall | PaywallScreenConfigFactoryType | No | Subscription screen, subscription packages |
player | PlayerScreenConfigFactoryType | No | Media player, player info, option picker, workout exercise preview |
shared | SharedScreenConfigFactoryType | No | Subcategory header, reviews widget, description config, confirmation banner, portrait video, error state, progress bar |
home | HomeScreenConfigFactoryType | No | Home screen, tag feed, events list, daily quote, timer sessions history |
search | SearchScreenConfigFactoryType | No | Search screen, search filter |
favorites | FavoritesScreenConfigFactoryType | No | Favorites sessions |
explore | ExploreScreenConfigFactoryType | No | Explore feed |
journey | JourneysScreenConfigFactoryType | No | Journeys screen, journey details, journey completed, journey intro slider |
settings | SettingsScreenConfigFactoryType | No | Settings screen, settings items, edit profile, Apple Health, change password, measurement, notifications |
profile | ProfileScreenConfigFactoryType | No | Profile stats, profile screen, badges, session completed, logout, image picker, share stats, events agenda |
reminders | RemindersScreenConfigFactoryType | Yes | Reminders screen, intro popup, reminder templates |
unauthorized | UnauthorizedAccessConfigFactoryType | No | Registration-only alert, registration+subscription alert, unauthorized action config |
appToast | AppToastConfigFactoryType | No | Remote notification toast, offline app toast |
generic | GenericConfigFactoryType | No | makeTabItems(), tab item details, error config, email alert, delete account, notifications settings, language selector, welcome message, "what's new", navigation bar, and more |
skeletons | SkeletonsConfigFactoryType | No | Skeleton loading configs for all screens |
eventDetails | EventDetailsScreenConfigFactoryType | Yes | Event details, info banners |
meals | MealsConfigFactoryType | Yes | Meals page, meal details |
activity | ActivityConfigFactoryType | Yes | Activity page, workout details, workout player, close alert |
facilitatorDetails | FacilitatorDetailsScreenConfigFactoryType | Yes | Facilitator details, contents list |
Method: makeCustomCoordinator(name: String) -> Coordinator? (optional, defaults to nil)
Optional factories return nil by default via protocol extensions. Customer apps only need to implement them if they activate the corresponding product module.
For implementation guidance and examples, see the Screen Config Factory Guide (planned).
Analytics
Two-Layer Architecture
The analytics system has two layers:
-
AnalyticsManagerTypeprotocol: The interface that customer apps implement. It has one required method (logEvent(name:parameters:)) and six optional convenience methods for AppsFlyer, Meta, and purchase tracking. -
AnalyticsManagerclass: A singleton wrapper that bridges Bricks feature modules to the customer-provided analytics implementation. It conforms to 19 analytics protocols defined across Bricks packages, translating domain-specific events intologEvent(name:parameters:)calls.
Analytics Protocol Conformances
| Protocol | Defined In | Domain |
|---|---|---|
OnboardingAnalytics | Onboarding | Marketing slider, social proof, splash video, registration, login |
MainFeedAnalytics | Core | Featured content, tagged content, banners, journeys, quizzes, events, workouts, meals, facilitators |
ExploreFeedAnalytics | Core | Tags, categories, subcategories, content selection, facilitators |
JourneysFeedAnalytics | Core | Journey selection, widgets, intro, start, content, congrats |
EventsFeedAnalytics | Core | Event selection, event screen, share, respond, location, calendar |
ActivitiesFeedAnalytics | Core | Activity selection, workout lifecycle (get ready, exercise, rest, close, completed, share) |
MealsFeedAnalytics | Core | Meals preparing, no meals, meal details |
LibraryFeedAnalytics | Core | Favorite content, playlist selection |
ContentAnalytics | Core | Category/subcategory screens, like/dislike |
FavoritesAnalytics | Core | Dislike action, content selection |
SearchAnalytics | Core | Feed content, search query, filter tag |
DownloadAnalytics | Core | Downloaded content action, delete |
PlayerAnalytics | Player | Player screen, seek, auto-play, AirPlay, options, like/unlike, download, share, progress, speed, shuffle, playlist |
ProfileAnalytics | Profile | Event selection from profile |
ProfileSettingsAnalytics | Profile | Notification switches, URL opens |
SubscriptionAnalytics | Profile | Subscription success/error, package selection, checkout, Google Analytics e-commerce |
QuizAnalytics | Core | Quiz intro, questions, skip, results, content selection |
DebugAnalytics | Core | Debug content selection, error state logging |
MarketingVideoAnalytics | Core | Marketing video completion |
For implementing a custom AnalyticsManagerType, see the Analytics Integration Guide (planned).
Notifications
The notification system has three components that work together.
NotificationManager
Singleton (NotificationManager.shared) that handles the low-level notification infrastructure:
- Conforms to
UNUserNotificationCenterDelegateand FirebaseMessagingDelegate - Manages FCM token lifecycle: registers device tokens, saves FCM tokens to the server via
UserAPI.updateFCMToken, tracks the last sent token inSettings.lastSentFCMToken - Parses incoming notification payloads: attempts to decode as
PushNotification(remote) first, falls back toLocalNotification - Delegates parsed notifications to
NotificationManagerDelegate(implemented by SceneDelegate in the customer app) - Removes FCM token on logout via
removeFCMTokenForLogout() - Initializes
LocalNotificationsManager.sharedon configuration to reschedule local notifications
UserNotificationManager
Singleton (UserNotificationManager.shared) that manages push notification authorization:
- Publishes authorization status via
notificationAuthorizationPublisher: CurrentValueSubject<UNAuthorizationStatus, Never> requestPushNotificationsAuthorization(completion:): Checks current status, requests permission if.notDetermined, and registers for remote notifications if granted- Automatically registers for remote notifications on init if already authorized
MainCoordinator+RemoteNotifications
Routes parsed notifications to the appropriate screen via MainCoordinator's navigation system. When NotificationManagerDelegate.didReceiveRemoteNotification fires, the SceneDelegate forwards it to MainCoordinator, which uses its redirect(to:) deep link mechanism to navigate to the relevant content.
Notification Flow
Push received → NotificationManager (parse payload)
→ NotificationManagerDelegate (SceneDelegate)
→ MainCoordinator.redirect(to: destination)
→ Appropriate tab coordinatorFeature Flags
FirebaseFlagProvider
Client provides FirebaseFlagProvider, implementing the FlagProvider protocol defined in Core. It wraps Firebase Remote Config:
- Fetch interval:
minimumFetchInterval = 0(fetches fresh values on every call) - Defaults: Loads from
remote_config_defaults.plistbundled with the customer app - Refresh:
refreshAllFlags(completion:)callsfetchAndActivate, then:- Sends
flagRefreshCompletedPublisher(Combine) - Posts
kDidUpdateFlagsnotification (NotificationCenter)
- Sends
- Query:
getState(forFlag:)returnsBool,getStringValue(forFlag:)andgetStringValue(forKey:)returnString?
The FlaggingManager (defined in Core) wraps FirebaseFlagProvider and provides the isActive(flag:) API used throughout the codebase. Feature flags control which product modules are visible and active.
Coordinator Reference
All coordinators defined in Client, with their flow and role. For detailed coordinator lifecycle, deep linking, and navigation patterns, see Coordinator Pattern.
Tab Coordinators
| Coordinator | Flow | Base Class | Module Interfaces Used |
|---|---|---|---|
HomeCoordinator | .home | BaseCoordinator | Timer, Tuya |
ShowcaseCoordinator | .showcase / .exploreShowcase | BaseCoordinator | Timer, Tuya |
ExploreCoordinator | .explore | (none) | Timer |
JourneysCoordinator | .journeys | (none) | (none) |
LibraryCoordinator | .library | (none) | (none) |
EventsCoordinator | .events | (none) | (none) |
ActivityCoordinator | .activity | (none) | (none) |
MealsCoordinator | .meals | (none) | (none) |
ProfileCoordinator | .profile | BaseCoordinator | Tuya |
ProfileCoordinator is the most complex, split across 8 files handling account, Apple Health, avatar, notifications, reminders, secret actions, and settings.
Static Coordinators
Singletons initialized once via AppCoordinator.start(). They provide shared functionality callable from any coordinator.
| Coordinator | Setup Call | Purpose |
|---|---|---|
ContentDetailsCoordinator | .setup(with: config, customSubscriptionsManager:) | Content detail screens, player launch, facilitator details. Split across 8 extension files |
SearchCoordinator | .setup(with: config) | Search screen creation via createSearchController() |
SubscriptionCoordinator | .setup(with: config) | Subscription/paywall presentation |
QuizCoordinator | .setup(with: config) | Quiz flow management |
CoordinatorFlow Enum
The CoordinatorFlow enum has 20 cases used as keys in the childCoordinators dictionary:
auth, main, home, explore, exploreShowcase, showcase, contentDetails, search, events, library, favorites, profile, subscription, journeys, contentReview, quiz, meals, activity, biometrics, community
Content Gating
UnauthorizedUserActionManager is a singleton that handles what happens when an anonymous or unsubscribed user attempts to access premium content. It presents three types of alerts, all configured through UnauthorizedAccessConfigFactoryType:
| Method | When Used |
|---|---|
makeRegistrationOnlyAlert(actionHandler:) | Anonymous user taps content that requires registration |
makeRegistrationAndSubscriptionAlert(actionHandler:) | User taps content that requires both registration and an active subscription |
makeUnauthorizedActionAlert(actionHandler:) | User attempts an action (like, download, playlist) that requires authorization |
The action handler typically triggers navigation to the auth or subscription flow. The manager ensures only one alert is displayed at a time by dismissing any existing alert before presenting a new one.
Utilities
TrackingManager
Wraps ATTrackingManager for App Tracking Transparency. Singleton with:
trackingAuthorizationPublisher: CurrentValueSubject<ATTrackingManager.AuthorizationStatus, Never>: Publishes the current ATT statusrequestPermission(): Requests ATT authorization if status is.notDetermined, logs the result as an analytics event
AppsFlyerManager
Wraps the AppsFlyer SDK for attribution tracking. Integrates with PurchaseConnector for revenue attribution.
WhatsNewControllerManager
Controls the "What's New" popup display after app updates. Uses a content hash comparison pattern:
- Gets the "What's New" configuration from
ScreenConfig.generic.makeWhatsNewViewConfig() - Compares its hash against
Settings.whatsNewPopupHashValue - Shows the popup only when the hash differs (content has changed)
- Stores the new hash after display
MainTabBarController
Custom UITabBarController subclass that adds:
- Tab bar appearance configuration
- Haptic feedback on tab selection
- Device orientation support
- Double-tap detection via
TabSelectionProtocol
PortraitNavigationController
UINavigationController subclass that locks orientation to portrait. Used for screens that should not rotate (search tab, some modal flows).
For Agents
Reading Order
When working with the Client module, read files in this order:
- Start with the protocols:
ConfigType.swift,ScreenConfigFactory.swift,FactoryTypes.swiftto understand the public API surface - Understand the flow:
AppCoordinator.swift(lines 209-237 forstart(), lines 382-419 forshowContent()) - Tab creation:
MainCoordinators+TabSetup.swiftto see how tabs map to coordinators - Specific coordinator: Read the tab coordinator relevant to your task
- Analytics:
AnalyticsManager.swiftif adding or modifying event tracking
Key Files
| Task | Start Here |
|---|---|
| Understanding Config's API | ConfigType.swift |
| Modifying app initialization | Config.swift, Config+Actions.swift |
| Adding a new tab | TabBarItem.swift (add case), MainCoordinators+TabSetup.swift (add coordinator creation) |
| Adding screen configuration | FactoryTypes.swift (add to relevant sub-protocol) |
| Adding analytics events | AnalyticsManager.swift (add conformance or extend existing one) |
| Debugging push notifications | NotificationManager.swift, UserNotificationManager.swift, MainCoordinator+RemoteNotifications.swift |
| Understanding feature flags | FirebaseFlagProvider.swift, then FlaggingManager in Core |
| Content gating behavior | UnauthorizedUserActionManager.swift |
Tips
- The
ScreenConfigglobal accessor is the most common way to access screen configurations throughout Bricks. Search forScreenConfig.to find usage patterns. Config.sharedis the central state object. Most coordinators receive it as a constructor parameter rather than accessing the singleton directly.- Static coordinators (
ContentDetailsCoordinator.shared,SearchCoordinator.shared, etc.) are accessed as singletons from anywhere. They are initialized inAppCoordinator.start()and must not be accessed before that. - ProfileCoordinator is split across 8 files. When modifying profile behavior, check all
ProfileCoordinator+*.swiftextensions.