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,TTBaseUICollectionViewControllerTTBaseUIView,TTBaseUILabel,TTBaseUIButton,TTBaseUITextField,TTBaseUITextViewTTBaseUIImageView,TTBaseUIStackView,TTBaseUIScrollViewViewCodableprotocol β 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,BaseSUIImageBaseSUIList,BaseSUIGroup,BaseSUITabView,BaseSUINavLinkBaseSUISlider,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.0or 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)
π€ 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
π¨ 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:
- File β Add Package Dependencies...
- Enter URL:
https://github.com/tqtuan1201/TTBaseUIKit.git - 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
- Clone or download the repository
- Add
TTBaseUIKit.xcodeprojto your project - Add
TTBaseUIKit.frameworkas 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+ startTTDebugBridge - AppCoordinator β Setup
UITabBarControllerwith 5 tabs using Coordinator pattern - ViewControllers β Implement
ViewCodableprotocol: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:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
If you find TTBaseUIKit useful, please consider giving it a β β it helps others discover the project.
License
TTBaseUIKit is available under the MIT License. See the LICENSE file for details.
MIT License β Copyright (c) 2019 Quang TuanPackage Metadata
Repository: tqtuan1201/ttbaseuikit
Default branch: master
README: README.md