Contents

tqtuan1201/ttbaseuikit

---

Overview

TTBaseUIKit is an enterprise-grade iOS framework that eliminates boilerplate and accelerates development by providing 100+ production-ready base views for both UIKit (programmatic) and SwiftUI (declarative). Ship production UI in hours, not days.

<p align="center"> <img src="https://tqtuan1201.github.io/images/ttbaseuikit_compress_2.gif" width="80%" alt="TTBaseUIKit Demo" /> </p>

Key Numbers

| Metric | Count | |--------|-------| | UIKit Components | 72+ | | SwiftUI Views | 51+ | | AI Agent Skills | 17 | | Production Apps Shipped | 36+ | | Users Reached | 5M+ |

Features

🧱 UIKit Foundation

Production-ready programmatic views with zero Storyboard/XIB dependency:

  • TTBaseUIViewController, TTBaseUITableViewController, TTBaseUICollectionViewController
  • TTBaseUIView, TTBaseUILabel, TTBaseUIButton, TTBaseUITextField, TTBaseUITextView
  • TTBaseUIImageView, TTBaseUIStackView, TTBaseUIScrollView
  • ViewCodable protocol β€” structured lifecycle: setupData β†’ makeUI β†’ makeConstraints β†’ bindViewModel
  • Popup, Notification, Skeleton Loading, Segmented Control, PIN Input, and more
  • Programmatic Auto Layout helpers β€” chainable, clean constraint syntax

🎨 SwiftUI Modernity (v2.3.0+)

Full SwiftUI support targeting iOS 14+:

  • BaseSUIView, BaseSUIText, BaseSUIButton, BaseSUIImage
  • BaseSUIList, BaseSUIGroup, BaseSUITabView, BaseSUINavLink
  • BaseSUISlider, BaseSUIToggle, BaseSUITextField, BaseSUIProgress
  • View modifiers: ttFont(), ttShadow(), ttPadding()
  • Built-in Shimmer / Skeleton loading animations

πŸ›  Built-in UI Debug Kit (v2.2.1+)

Activate with a single line β€” no additional dependencies:

  • Triple-tap Layout Inspector β€” visualize constraints and view hierarchy
  • API Response Log Viewer β€” inspect request/response data in-app
  • Screen Capture β€” annotate screenshots and share with team
  • Developer Settings Panel β€” toggle environments, feature flags
LogViewHelper.share.config(
    withDes: "Debug Panel",
    isStartAppToShow: false,
    passCode: ""
).onShow()
// Long-press any screen to open | Triple-tap to inspect layout

<p align="center"> <img src="https://tqtuan1201.github.io/images/TTBaseUIKit-DebugKit.gif" width="80%" alt="UI Debug Kit" /> </p>

πŸ–₯ TTBDebugPlus β€” macOS Companion Debugger

A professional-grade native macOS app for debugging iOS applications in real-time. Built entirely with SwiftUI.

⚠️ Requires TTBaseUIKit v2.3.0 or later. The DebugBridge SDK is included from version 2.3.0+.

| Feature | Description | |---------|-------------| | πŸ“‹ Live Console | Real-time log streaming with level filtering & JSON inspector | | 🌐 Network Inspector | Full HTTP inspection, JSON Tree Viewer, cURL & Postman export | | πŸ“± Device Control | Remote screenshot, dark mode toggle, app lifecycle management | | πŸ“Š Performance Monitor | CPU, Memory, FPS charts, bandwidth monitoring, API analytics | | πŸ’¬ Feedback Reporter | Structured bug reports with annotated screenshots | | πŸ“€ Export & Share | Postman Collection v2.1, cURL, session files (.ttbdebug) |

Architecture: iOS ↔ Bonjour (mDNS) ↔ WebSocket ↔ macOS β€” zero configuration, auto-discovery.

<table> <tr> <td align="center" width="50%"> <strong>πŸš€ iOS SDK Integration Guide</strong><br/> <img src="https://tqtuan1201.github.io/public/docs/ttbaseuikit/images/ttbdebugplus-guide.png" alt="TTBDebugPlus Integration Guide" width="100%"/> </td> <td align="center" width="50%"> <strong>πŸ“± Device Control & Screenshot</strong><br/> <img src="https://tqtuan1201.github.io/public/docs/ttbaseuikit/images/ttbdebugplus-device.png" alt="TTBDebugPlus Device Control" width="100%"/> </td> </tr> <tr> <td align="center" width="50%"> <strong>✏️ Screenshot Annotation</strong><br/> <img src="https://tqtuan1201.github.io/public/docs/ttbaseuikit/images/ttbdebugplus-annotation.png" alt="TTBDebugPlus Annotation" width="100%"/> </td> <td align="center" width="50%"> <strong>πŸ›  Dev Tools β€” JSON Editor</strong><br/> <img src="https://tqtuan1201.github.io/public/docs/ttbaseuikit/images/ttbdebugplus-devtools.png" alt="TTBDebugPlus Dev Tools" width="100%"/> </td> </tr> </table>

πŸ“₯ Download TTBDebugPlus for macOS (.dmg β€’ 5.8 MB β€’ macOS 14+ β€’ Universal)

πŸ“– Full documentation & SDK integration guide β†’

πŸ€– AI Agent Ready

Pre-configured for modern AI coding assistants:

  • GitHub Copilot β€” custom instructions & workspace prompts
  • Claude Code β€” CLAUDE.md with project context
  • Xcode Agent Skills β€” 17 custom agent skills
  • Google Gemini β€” GEMINI.md configuration
  • OpenAI Codex β€” codex.md setup

πŸ“– Explore AI Agent Skills β†’

🎨 Configurable Design System

Control every aspect of your app's appearance globally:

let view = ViewConfig()
view.viewBgNavColor = .systemBlue
view.buttonBgDef    = .systemBlue
view.viewBgColor    = .white

let size = SizeConfig()
size.H_BUTTON = 44.0
size.H_SEG    = 50.0

let font = FontConfig()
font.HEADER_H       = 16
font.TITLE_H        = 14
font.SUB_TITLE_H    = 12

TTBaseUIKitConfig.withDefaultConfig(
    withFontConfig: font,
    frameSize: size,
    view: view
)?.start(withViewLog: true)

| Config | Purpose | Reference | |--------|---------|-----------| | ViewConfig | Colors for buttons, labels, backgrounds, navigation | Global theme | | SizeConfig | Heights, corner radius, icon sizes, spacing | Layout system | | FontConfig | Typography scale: header, title, subtitle, body | Type system |

Installation

Swift Package Manager (Recommended)

Via Xcode:

  1. File β†’ Add Package Dependencies...
  2. Enter URL: https://github.com/tqtuan1201/TTBaseUIKit.git
  3. Select "Up to Next Major" from 2.3.0

Via Package.swift:

dependencies: [
    .package(url: "https://github.com/tqtuan1201/TTBaseUIKit.git", from: "2.3.0")
]

CocoaPods

pod 'TTBaseUIKit'

Carthage

github "tqtuan1201/TTBaseUIKit"

Manual

  1. Clone or download the repository
  2. Add TTBaseUIKit.xcodeproj to your project
  3. Add TTBaseUIKit.framework as an embedded binary (General tab) and target dependency (Build Phases tab)

Quick Start

import UIKit
import TTBaseUIKit

@main
class AppDelegate: UIResponder, UIApplicationDelegate {

    var window: UIWindow?

    func application(
        _ application: UIApplication,
        didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
    ) -> Bool {

        // 1. Configure design system
        let view = ViewConfig()
        let size = SizeConfig()
        let font = FontConfig()
        
        TTBaseUIKitConfig.withDefaultConfig(
            withFontConfig: font,
            frameSize: size,
            view: view
        )?.start(withViewLog: true)

        // 2. (Optional) Enable debug bridge for TTBDebugPlus macOS
        #if DEBUG
        TTDebugBridge.shared.start()
        LogInterceptor.shared.install()
        #endif

        // 3. Set root view controller
        window = UIWindow(frame: UIScreen.main.bounds)
        window?.rootViewController = UINavigationController(
            rootViewController: HomeViewController()
        )
        window?.makeKeyAndVisible()
        
        return true
    }
}

Usage Examples

UIKit β€” Custom ViewController

import TTBaseUIKit

class HomeViewController: TTBaseUIViewController<TTBaseUIView> {

    let titleLabel = TTBaseUILabel()
    let actionButton = TTBaseUIButton()

    override func viewDidLoad() {
        super.viewDidLoad()
    }
}

extension HomeViewController: TTViewCodable {

    func setupStyles() {
        titleLabel.setText(text: "Welcome")
        actionButton.setText(text: "Get Started")
    }

    func setupCustomView() {
        view.addSubview(titleLabel)
        view.addSubview(actionButton)
    }

    func setupConstraints() {
        titleLabel.setTopAnchor(constant: 20)
        titleLabel.setCenterXAnchor(constant: 0)
        actionButton.setTopAnchor(titleLabel, constant: 16)
        actionButton.setCenterXAnchor(constant: 0)
    }
}

SwiftUI β€” Declarative View

import TTBaseUIKit

struct HomeView: BaseSUIView {
    var body: some View {
        VStack(spacing: 16) {
            BaseSUIText("Welcome to TTBaseUIKit")
                .ttFont(type: .HEADER_H)
                .foregroundColor(.primary)

            BaseSUIButton(title: "Get Started") {
                // action
            }
            .ttButtonStyle(.filled)

            BaseSUIList(items: viewModel.items) { item in
                ItemRowView(item: item)
            }
        }
        .baseSUIPadding()
    }
}

Auto Layout Helpers

// Chainable programmatic constraints
myView.setTopAnchor(constant: 16)
myView.setLeadingAnchor(constant: 20)
myView.setTrailingAnchor(constant: 20)
myView.setBottomAnchor(constant: 16)
myView.setCenterXAnchor(constant: 0)
myView.setcenterYAnchor(constant: 0)

UI Components

// Notification banner
let noti = TTBaseNotificationViewConfig(with: window)
noti.setText(with: "Success!", subTitle: "Operation completed")
noti.notifiType = .SUCCESS
noti.onShow()

// Popup dialog
let popup = TTPopupViewController(
    title: "Confirm",
    subTitle: "Are you sure?",
    isAllowTouchPanel: true
)
present(popup, animated: true)

// Empty state for table view
tableView.setStaticBgNoData(
    title: "No Data",
    des: "Nothing to show yet"
) {
    print("Retry tapped")
}

Project Structure

TTBaseUIKit/
β”œβ”€β”€ Sources/TTBaseUIKit/
β”‚   β”œβ”€β”€ BaseConfig/          # ViewConfig, SizeConfig, FontConfig
β”‚   β”œβ”€β”€ Coordinators/        # Navigation coordination
β”‚   β”œβ”€β”€ CustomView/          # 72+ UIKit base views
β”‚   β”‚   β”œβ”€β”€ BaseUIView/
β”‚   β”‚   β”œβ”€β”€ BaseUILabel/
β”‚   β”‚   β”œβ”€β”€ BaseUIButton/
β”‚   β”‚   β”œβ”€β”€ BaseUITextField/
β”‚   β”‚   β”œβ”€β”€ BaseUITableView/
β”‚   β”‚   β”œβ”€β”€ BaseUICollectionView/
β”‚   β”‚   β”œβ”€β”€ ViewCodable/
β”‚   β”‚   └── ...
β”‚   β”œβ”€β”€ SwiftUIView/         # 51+ SwiftUI views
β”‚   β”‚   β”œβ”€β”€ BaseSUIView/
β”‚   β”‚   β”œβ”€β”€ BaseSUIText/
β”‚   β”‚   β”œβ”€β”€ BaseSUIButton/
β”‚   β”‚   └── ...
β”‚   β”œβ”€β”€ Extensions/          # String, Date, JSON, Device utilities
β”‚   └── Support/
β”‚       β”œβ”€β”€ DebugBridge/     # TTBDebugPlus iOS SDK
β”‚       └── Resources/      # Fonts, Images
β”œβ”€β”€ TTBaseUIKitExample/      # Official sample project
β”œβ”€β”€ TTBDebugPlus/            # macOS companion app (Xcode project)
β”œβ”€β”€ Agents/                  # AI agent configurations
β”œβ”€β”€ docs/                    # Documentation website
β”œβ”€β”€ Package.swift
β”œβ”€β”€ TTBaseUIKit.podspec
└── LICENSE

🎯 Best Practice β€” Run First, Read Code Later

The fastest way to learn TTBaseUIKit: Clone the example project, run it first, explore all features in action β€” then study the code. Developers who run examples first learn frameworks 10x faster.

πŸ“– Full Best Practice Guide β†’

Quick Start (60 seconds)

git clone https://github.com/tqtuan1201/TTBaseUIKit.git
open TTBaseUIKit.xcodeproj

What's Inside TTBaseUIKitExample

The TTBaseUIKitExample is a full-featured sample app with 5 tabs:

| Tab | Description | Tech | |-----|-------------|------| | πŸ“‹ Menu | Framework overview, theme config, base components showcase | UIKit | | ✨ Demos | 7 real-world demos β€” Recipe Book, Product Catalog, User Directory, Social Feed, Quotes Wall, Todo Manager, Photo Gallery | SwiftUI + API | | πŸ”— DebugBridge | TTBDebugPlus macOS companion β€” real-time logs, network inspector, remote screenshots | v2.3.0+ | | πŸ” UI Debug | Built-in TTBaseDebugKit β€” layout inspector, API logger, screen capture | v2.2.1+ | | πŸ‘€ Contact | Author info and portfolio links | UIKit |

Example Screenshots

<table> <tr> <td align="center" width="25%"> <strong>πŸ“‹ Menu</strong><br/> <img src="https://tqtuan1201.github.io/public/docs/ttbaseuikit/images/sample/iOS_sam_01.jpeg" alt="Menu Tab" width="100%"/> </td> <td align="center" width="25%"> <strong>✨ Demos</strong><br/> <img src="https://tqtuan1201.github.io/public/docs/ttbaseuikit/images/sample/iOS_sam_02.jpeg" alt="Demos Tab" width="100%"/> </td> <td align="center" width="25%"> <strong>πŸ”— DebugBridge</strong><br/> <img src="https://tqtuan1201.github.io/public/docs/ttbaseuikit/images/sample/iOS_sam_03.jpeg" alt="DebugBridge Tab" width="100%"/> </td> <td align="center" width="25%"> <strong>πŸ” UI Debug</strong><br/> <img src="https://tqtuan1201.github.io/public/docs/ttbaseuikit/images/sample/iOS_sam_04.jpeg" alt="UI Debug Tab" width="100%"/> </td> </tr> </table>

Code Architecture

The example follows a clean architecture pattern:

AppDelegate (Config) β†’ AppCoordinator (TabBar) β†’ ViewControllers (ViewCodable)
  • AppDelegate β€” Configure ViewConfig, SizeConfig, FontConfig, StyleConfig, ParamConfig + start TTDebugBridge
  • AppCoordinator β€” Setup UITabBarController with 5 tabs using Coordinator pattern
  • ViewControllers β€” Implement ViewCodable protocol: setupData β†’ makeUI β†’ makeConstraints β†’ bindViewModel

UIKit Demo Categories

The Menu tab includes 11 UIKit demo categories:

| Demo | What It Shows | |------|---------------| | Auto Layout | Programmatic constraints with chainable helpers | | Calendar | Custom calendar view implementation | | Cell Types | 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 |

Apps Built with TTBaseUIKit

<table> <tr> <td align="center" width="25%"> <strong>12Bay iOS</strong><br/> <em>✈️ Travel β€’ #20 App Store VN</em><br/> <sub>UIKit + SwiftUI β€’ MVVM/VIPER</sub> </td> <td align="center" width="25%"> <strong>Aihealth - Truedoc</strong><br/> <em>πŸ₯ Healthcare β€’ Pre-Series A</em><br/> <sub>UIKit β€’ AI Diagnostics</sub> </td> <td align="center" width="25%"> <strong>TMS Mobile</strong><br/> <em>πŸš› Logistics</em><br/> <sub>UIKit β€’ Real-time GPS</sub> </td> <td align="center" width="25%"> <strong>WECARE 247</strong><br/> <em>🫢 Care Management</em><br/> <sub>UIKit + SwiftUI</sub> </td> </tr> <tr> <td align="center" width="25%"> <strong>12Bay macOS</strong><br/> <em>πŸ–₯️ Mac Catalyst</em><br/> <sub>Shared codebase with iOS</sub> </td> <td align="center" width="25%"> <strong>AiDoctor</strong><br/> <em>βš•οΈ Telemedicine</em><br/> <sub>UIKit β€’ Video Consult</sub> </td> <td align="center" width="25%"> <strong>AiPharmacy</strong><br/> <em>πŸ’Š Pharmacy</em><br/> <sub>UIKit β€’ Order Management</sub> </td> <td align="center" width="25%"> <strong>Contacts Plus</strong><br/> <em>πŸ‘€ Productivity</em><br/> <sub>UIKit β€’ App Store</sub> </td> </tr> </table>

36+ production apps shipped across Travel, Healthcare, Logistics, Education, and more. See full showcase β†’ Apps Showcase

Documentation

| Resource | Link | |----------|------| | πŸ“– Full Documentation | tqtuan1201.github.io/public/docs/ttbaseuikit | | πŸš€ Getting Started | Installation & Setup Guide | | 🧱 UIKit Components | 72+ Component Docs | | 🎨 SwiftUI Views | 51+ View Docs | | πŸ›  TTBDebugPlus | macOS Debugger & SDK Guide | | πŸ€– AI Agent Skills | 17 Agent Configurations | | 🎯 Best Practice | Run First, Read Code Later | | 🎬 Project Demo | TTBaseUIKitExample Demo | | πŸ“± Apps Showcase | 36+ Production Apps | | πŸ“ Author's Blog | Technical Articles |

Requirements

| Requirement | Minimum | |-------------|---------| | iOS | 14.0+ | | macOS (Catalyst) | 10.15+ | | Swift | 5.0+ | | Xcode | 13.0+ | | TTBDebugPlus (macOS) | macOS 14+ |

Contributing

Contributions are welcome! Feel free to:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

If you find TTBaseUIKit useful, please consider giving it a ⭐ β€” it helps others discover the project.

Author

Truong Quang Tuan β€” Mobile Lead & Framework Author

We build high-quality apps. Get in touch if you need help with a project.

License

TTBaseUIKit is available under the MIT License. See the LICENSE file for details.

MIT License β€” Copyright (c) 2019 Quang Tuan

Package Metadata

Repository: tqtuan1201/ttbaseuikit

Default branch: master

README: README.md