Skip to main content

πŸ–₯️ Navigation, modules, theme (iOS)

After connect, the connected AzeooSDK exposes:

  • sdk.navigate(to:) + back operations β€” typed navigation
  • sdk.setModuleContainer(_:) + sdk.tabHost(for:) β€” adaptive native UI coordination
  • sdk.modules.nutrition / sdk.modules.training β€” embedding
  • sdk.theme β€” theme runtime control

Typed navigation​

sdk.navigate(to: .nutrition(.plan(id: "abc-123")))
sdk.navigate(to: .training(.workouts))
sdk.back()
sdk.backToRoot()
sdk.canGoBack { result in /* Bool */ }
sdk.getCurrentRoute { result in /* String? */ }

Full catalogue: Destination catalogue (nutrition + training).

Module coordinators (setModuleContainer)​

Install once at startup so cross-module navigation flips your native UI:

sdk.setModuleContainer(AzeooUITabBarCoordinator(self, mapping: [
.nutrition: 1, .training: 2,
]))

Built-in coordinators:

  • AzeooUITabBarCoordinator β€” for UITabBarController
  • AzeooUINavigationCoordinator β€” for UINavigationController push/pop
  • AzeooSwiftUITabCoordinator<Tag> β€” for SwiftUI TabView with a Binding

Custom containers (sidebar / page view / drawer): implement AzeooModuleContainer directly β€” one method.

Tab hosts (sdk.tabHost(for:))​

Returns a thin UIViewController hosting the shared Flutter surface for one module β€” designed to go directly into UITabBarController.viewControllers:

let nutritionTab = sdk.tabHost(for: .nutrition)
let trainingTab = sdk.tabHost(for: .training)

See Multi-tab hosting for the full pattern.

Embedding (single-screen)​

For one-off full-screen embeds:

// UIKit
sdk.modules.nutrition.display(in: hostVC, bottomSafeArea: true) { _ in }
// SwiftUI
sdk.modules.nutrition.getView(bottomSafeArea: true)

Theme (sdk.theme)​

setMode, setLightMode, setDarkMode, setSystemMode, toggleMode, setPrimaryColor, setSecondaryColor, setLightColors, setDarkColors, setTheme, resetToDefault, getCurrentTheme.

See also​