TTBaseUIKitExample · Official Sample Project

🎬 Project Demo

The complete reference implementation integrating TTBaseUIKit — featuring UIKit and SwiftUI approaches side-by-side.

🧱 UIKit Foundation 🎨 SwiftUI Modern 🛠️ UI Debug Kit 🤖 AI Agent Ready

See It In Action

Full navigation flow · Component library demo · UIKit to SwiftUI in one app

TTBaseUIKitExample — Full animated demo of UIKit and SwiftUI components
LIVE TTBaseUIKitExample — UIKit + SwiftUI components in one sample project

Also includes built-in UI Debug Kit (v2.2.1+) — triple-tap to inspect layouts, view API logs, capture screens

TTBaseUIKit Built-in UI Debug Kit
🛠️ DEBUG KIT Real-time layout inspector · API log viewer · Screen capture

Two Approaches, One Kit

TTBaseUIKitExample demonstrates both UIKit programmatic and SwiftUI declarative patterns

🧱 BaseUIViewController
// UIKit — Programmatic approach
class HomeViewController: TTBaseUIViewController {

    // ViewCodable protocol auto-calls:
    override func makeUI() {
        super.makeUI()
        // Build UI here — no Storyboard
        view.addSubview(titleLabel)
        view.addSubview(actionButton)
        setConstraints()
    }

    override func bindViewModel() {
        super.bindViewModel()
        // Bind data to views
    }
}

// BaseUITableViewController
class ListViewController: TTBaseUITableViewController {
    override func viewDidLoad() {
        super.viewDidLoad()
        // Table setup is handled by base
    }

    override func tableView(_ tableView: UITableView,
        cellForRowAt indexPath: IndexPath) -> UITableViewCell {
        // Register & dequeue from base
    }
}

What's Included

  • ViewCodable Protocol
    Structured lifecycle: setupData → makeUI → makeConstraints → bindViewModel
  • BaseUIViewController
    Navigation, loading states, error handling — zero boilerplate
  • BaseUITableViewController
    Built-in empty state, pull-to-refresh, skeleton loading
  • BaseCollectionViewController
    Compositional layouts supported out of the box
  • Auto Layout Helpers
    Chainable programmatic constraints — no NSLayoutConstraint verbosity
  • Popup, Notification, Skeleton
    Show messages, alerts, badges, loading skeletons in 1 line
UIKit No Storyboard Programmatic iOS 12+
🎨 BaseSUIView
// SwiftUI — Declarative approach
struct HomeView: BaseSUIView {

    var body: some View {
        VStack(spacing: 16) {

            // Base text with TTBaseUIKit font system
            BaseSUIText("Welcome to TTBaseUIKit")
                .ttFont(type: .HEADER_H)
                .foregroundColor(.primary)

            // Base button with built-in styles
            BaseSUIButton(title: "Get Started") {
                // action handler
            }
            .ttButtonStyle(.filled)

            // Base list with skeleton loading  
            BaseSUIList(items: viewModel.items) { item in
                ItemRowView(item: item)
            }
        }
        .baseSUIPadding()
    }
}

// Preview in Xcode — no simulator needed
#Preview {
    HomeView()
}

What's Included

  • BaseSUIView
    Base SwiftUI view with built-in theme, spacing, and lifecycle helpers
  • BaseSUIText & BaseSUIButton
    Font system and button styles from TTBaseUIKit config — auto-themed
  • BaseSUIList & BaseSUIGroup
    Declarative list with empty state, skeleton loading, pull-to-refresh
  • Shimmer Animations
    Built-in shimmer / skeleton loading effect for any view
  • View Modifiers
    ttFont, ttShadow, ttPadding — consistent styling across the app
  • iOS 14+ Compatible
    Full SwiftUI support from iOS 14 — maximum device reach
SwiftUI Declarative iOS 14+ v2.1.0+

What's Inside TTBaseUIKitExample

A full-featured sample demonstrating all framework capabilities

🧱
UIKit Foundation
72+ production-ready base views, ViewControllers, programmatic Auto Layout helpers and Coordinator pattern.
72+ Components
🎨
SwiftUI Modern
51+ declarative views — buttons, texts, layouts, sliders, toggles, shimmer animations targeting iOS 14+.
51+ Views
🛠️
UI Debug Kit
Triple-tap layout inspector, API response viewer, screen capture with notes. Available since v2.2.1.
v2.2.1+
🤖
AI Agent Ready
Pre-configured for shared Agent Skills, GitHub Copilot, Claude Code, Gemini and Xcode Agent Skills with reusable workflows.
AI Ready

How to Run

Get TTBaseUIKitExample running in Xcode in under 60 seconds

1
Clone the Repository
Download TTBaseUIKit from GitHub — TTBaseUIKitExample is included in the repo.
git clone https://github.com/tqtuan1201/TTBaseUIKit.git
2
Open the Xcode Project
Open the .xcodeproj file in Xcode. No CocoaPods or SwiftPM install required for the example.
open TTBaseUIKit.xcodeproj
3
Select the TTBaseUIKitExample Target
In Xcode, select the TTBaseUIKitExample scheme from the target dropdown, choose a Simulator, and press ⌘ R to run.

Ready to Explore?

Clone TTBaseUIKitExample and see how UIKit and SwiftUI coexist in a single, production-grade iOS project.