🎯 Best Practice · Run First, Read Code Later

The Fastest Way to Learn

Stop reading docs — run the example first. Experience components in action, then study the code. That's how pros learn frameworks.

📱 Example App Screenshots

TTBaseUIKitExample — 5 tabs showcasing UIKit, SwiftUI, Debug tools, and real-world API demos

💡

Why "Run First"?

🏃‍♂️

Experience Before Theory

Seeing components in action creates mental models that make code infinitely easier to understand.

🧠

Pattern Recognition

Running the app reveals architecture patterns — Coordinator, ViewCodable, Config — before you read a single line.

10x Faster Learning

Developers who run examples first learn frameworks 10x faster than those who start with documentation.

⚡ Quick Start — 60 Seconds

From zero to running TTBaseUIKitExample in your Xcode simulator

1
Clone the Repository
Download TTBaseUIKit — the example project is included in the repository.
git clone https://github.com/tqtuan1201/TTBaseUIKit.git
2
Open in Xcode
Open the Xcode project. SPM dependencies resolve automatically — no extra setup needed.
open TTBaseUIKit.xcodeproj
3
Select Target & Run
Choose TTBaseUIKitExample scheme, pick any Simulator, press ⌘R to build & run.
Now Explore!
Tap through all 5 tabs. Try the Demo features — call real APIs. Triple-tap any screen to activate the Debug Kit. Then start reading the code.

🔍 What's Inside the Example

5 tabs covering every aspect of TTBaseUIKit — from basic components to real-world API demos

📋
Menu Tab
Framework overview, theme config demo, base components showcase — TTBaseUIKit config, ViewConfig, SizeConfig, FontConfig all in action.
UIKit
Demos Tab
7 real-world SwiftUI demos — Recipe Book, Product Catalog, User Directory, Social Feed, Quotes Wall, Todo Manager, Photo Gallery. All powered by live APIs.
SwiftUI + API
🔗
DebugBridge Tab
TTBDebugPlus macOS companion integration. Real-time log streaming, network inspection, remote screenshots — connect Mac ↔ iPhone via Bonjour.
v2.3.0+
🔍
UI Debug Tab
Built-in TTBaseDebugKit — triple-tap layout inspector, API response logger, screen capture with annotations, developer settings panel.
v2.2.1+
👤
Contact Tab
Author info, links to documentation, GitHub, portfolio — shows how to build a simple profile screen with TTBaseUIKit.
Info

🧱 UIKit Demos Breakdown

11 dedicated UIKit demo categories covering all base views and patterns

📐
Auto Layout
Programmatic constraints with chainable helpers
📅
Calendar
Custom calendar view implementation
📊
Cell Types
Various table/collection cell patterns
🏗️
CollectionView
BaseUICollectionViewController demos
🧩
Components
Buttons, labels, text fields, images
📭
Empty Table
Empty state + retry pattern
💬
Message
Notification banners & alerts
🪟
Popup
Modal dialogs & bottom sheets
💀
Skeleton
Loading placeholder animations
📋
TableView
BaseUITableViewController patterns
📱
ViewController
ViewCodable lifecycle demos

🏛️ Code Architecture

Understand the patterns used in TTBaseUIKitExample

AppDelegate
Config + Start
AppCoordinator
TabBar + Navigation
ViewControllers
ViewCodable Protocol

1. AppDelegate — Config

// Configure Design System
let view = ViewConfig()
view.viewBgNavColor = UIColor.getColorFromHex(
    netHex: 0x4DA0DC)
view.buttonBgDef = UIColor.getColorFromHex(
    netHex: 0x4DA0DC)

let fontConfig = FontConfig()
fontConfig.HEADER_H = 18
fontConfig.TITLE_H = 14

let sizeConfig = SizeConfig()
sizeConfig.H_BUTTON = 50.0
sizeConfig.CORNER_RADIUS = 8.0

TTBaseUIKitConfig.withDefaultConfig(
    withFontConfig: fontConfig,
    frameSize: sizeConfig,
    view: view
)?.start(withViewLog: true)

2. AppCoordinator — Navigation

class AppCoordinator: Coordinator {
    func start() {
        let tabBar = UITabBarController()

        // Menu Tab (UIKit)
        let menuNav = UINavigationController()
        let menuCoord = MenuCoordinator(
            navigationController: menuNav)
        menuCoord.start()

        // Demos Tab (SwiftUI)
        let demosVC = DemoFeaturesView()
            .embeddedInHostingController(
                isHiddenTabbar: false)

        tabBar.viewControllers = [
            menuNav, demosVC, contactNav]
        window.rootViewController = tabBar
    }
}

📖 After Running — Deep Dive

Once you've experienced the app, explore these resources to understand every component

🎯

Ready to Start?

Clone TTBaseUIKitExample, run it, explore every tab — then come back here to understand the code. That's the best practice.