TTBaseUIKit
TTBaseUIKit is a framework that helps you build iOS applications in the fastest and most efficient way, by providing base views written in both UIKit Programmatically and SwiftUI.
Install / Use
/learn @tqtuan1201/TTBaseUIKitREADME
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 native macOS app for debugging iOS apps in real-time — live console, network inspector, remote screenshots, and more. Built with SwiftUI.
<p align="center"> <img src="https://tqtuan1201.github.io/public/docs/ttbaseuikit/images/ttbdebugplus-annotation.png" width="80%" alt="TTBDebugPlus — macOS Debugger for iOS" /> </p>Requires TTBaseUIKit v2.3.0+. The DebugBridge SDK is bundled automatically.
| Feature | Highlights | |---------|-----------| | 📋 Live Console | Log level filtering, full-text search, JSON inspector, auto-scroll LIVE mode | | 🌐 Network Inspector | JSON Tree Viewer, waterfall timing, cURL & Postman export, API analytics | | 📱 Device Control | Remote screenshot, dark mode toggle, app lifecycle (launch/kill/reset) | | 📊 Performance | CPU, memory, FPS charts, bandwidth monitoring, slow request detection | | 💬 Feedback & Export | Bug reports with annotated screenshots, Postman Collection v2.1, session files |
Architecture: iOS ↔ Bonjour (mDNS) ↔ WebSocket ↔ macOS — zero config, auto-discovery.
Quick Start:
// AppDelegate.swift
#if DEBUG
TTDebugBridge.shared.start() // Auto-discover macOS app via Bonjour
LogInterceptor.shared.install() // Auto-forward console logs
#endif
<p align="center">
<a href="https://tqtuan1201.github.io/public/docs/ttbaseuikit/apps/TTBDebugPlus-Installer.dmg"><img src="https://img.shields.io/badge/⬇_Download-macOS_(.dmg)-0A84FF?style=for-the-badge&logo=apple&logoColor=white" alt="Download"/></a>
</p>
<p align="center"><sub>5.8 MB • macOS 14+ • Universal (Apple Silicon + Intel)</sub></p>
📖 Full documentation & SDK integration guide → | 💻 Source Code →
🤖 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)
}
}
