If you encounter any problem or have a question on adding the package to an Xcode project, I suggest reading the Adding Package Dependencies to Your App guide article from Apple.
CocoaPods
CocoaPods is a dependency manager for Cocoa projects.
Add the following line to your Podfile:
pod 'TTBaseUIKit'
Carthage
Add the following line to your Cartfile:
github "tqtuan1201/TTBaseUIKit"
Manual
Put TTBaseUIKit repo somewhere in your project directory.
In Xcode, add TTBaseUIKit.xcodeproj to your project.
On your app’s target, add the TTBaseUIKit framework:
as an embedded binary on the General tab.
as a target dependency on the Build Phases tab.
Usage example
A few motivating and useful examples of how your product can be used. Spice this up with code blocks and potentially more screenshots.
Basic config settings
When you use this framework. You have the ability to control Color, FontSize, UI size. It helps you a lot when you apply themes, build apps on different platforms and they are easy to change. Config setting in AppDelegate
With ViewConfig, you can customize the most of colors for Button, Label, Background colors, ect. You can see all the config here: ViewConfig
With SizeConfig, you can customize the most of size for Button, Label, Navigation, Conner radius, Icon, Textfield, ect. You can see all the config here: SizeConfig
With SizeConfig, you can customize the most of font size for Title, SubTitle, Header, ect. You can see all the config here: FontConfig
TTBaseUIKit dramatically simplifies writing to build UI programmatically. Let’s take a quick look at some examples, using TTBaseUIKit from Swift.
Interface Customization
Show Message
let noti:TTBaseNotificationViewConfig = TTBaseNotificationViewConfig(with: window)
noti.setText(with: "WELCOME ^^", subTitle: "Just demo little element ui with write by programmatically swift")
noti.type = .NOTIFICATION_VIEW
noti.touchType = .SWIPE
noti.notifiType = .SUCCESS
noti.onShow()
Show Popup
let popupVC = TTPopupViewController(title: "SOMETHING LIKE THIS", subTitle: "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has b", isAllowTouchPanel: true)
yourVC.present(popupVC, animated: true)
Show empty for table view
yourVC.tableView.setStaticBgNoData(title: "NO DATA", des: "Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making ") {
print("Touch handle!!!!")
}
ViewCodable
This is a protocol use to easily organize UI handling code. You can see all configs here: ViewCodable
func setupViewCodable(with views : [UIView])
This function calls all other functions in the correct order. You can use it in an UIViewController viewDidLoad method or in a view initializer, for example.
func setupStyles()
This function should be used to apply styles to your customs views.
func setupData()
This function should be used to set data
func setupConstraints()
This function should be used to add constraints to your customs views
func setupBaseDelegate()
This function should be used to set delegate for views
TTBaseUIKit provides common handling functions for String, Date, Json, Device, Language, VietNamLunar , Validation, NetworkSpeedTest
Example Apps
For more examples and usage, please refer to example project TTBaseUIKitExample
Installed Applications
During my work, I have updated and used this framework in many projects. All my project using UI programmatically instead of using Storyboard. Here are some screenshoots of the apps:
TTBaseUIKit
Build your project with programmatically UI. You can see more details in here: TTBaseUIKit - Framework to Build UI Programmatically
Add the following line to your Podfile:

Installation
Swift Package Manager
Once you have your Swift package set up, adding Alamofire as a dependency is as easy as adding it to the
dependencies
value of yourPackage.swift
.If you encounter any problem or have a question on adding the package to an Xcode project, I suggest reading the Adding Package Dependencies to Your App guide article from Apple.
CocoaPods
CocoaPods is a dependency manager for Cocoa projects. Add the following line to your Podfile:
Carthage
Add the following line to your Cartfile:
Manual
TTBaseUIKit.xcodeproj
to your project.Usage example
A few motivating and useful examples of how your product can be used. Spice this up with code blocks and potentially more screenshots.
Basic config settings
When you use this framework. You have the ability to control
Color
,FontSize
,UI size
. It helps you a lot when you apply themes, build apps on different platforms and they are easy to change. Config setting inAppDelegate
ViewConfig
, you can customize the most of colors forButton
,Label
,Background colors
, ect. You can see all the config here: ViewConfigSizeConfig
, you can customize the most of size forButton
,Label
,Navigation
,Conner radius
,Icon
,Textfield
, ect. You can see all the config here: SizeConfigSizeConfig
, you can customize the most of font size forTitle
,SubTitle
,Header
, ect. You can see all the config here: FontConfigApply config by:
Usage
TTBaseUIKit
dramatically simplifies writing to build UI programmatically. Let’s take a quick look at some examples, usingTTBaseUIKit
from Swift.Interface Customization
Show Message
Show Popup
Show empty for table view
ViewCodable
This is a
protocol
use to easily organize UI handling code. You can see all configs here: ViewCodableThis function calls all other functions in the correct order. You can use it in an UIViewController viewDidLoad method or in a view initializer, for example.
This function should be used to apply styles to your customs views.
This function should be used to set data
This function should be used to add constraints to your customs views
This function should be used to set delegate for views
Base UIViews
Custom View
BaseUIViewController
BaseUITableViewController
Auto Layout
TTBaseUIKit
to make easy Auto Layout. This framework provides some functions to setup and update constraints.setLeadingAnchor
: Set/Update value for current view or super viewsetTrailingAnchor(_ view:UIView? = nil, isUpdate:Bool = false, constant:CGFloat, isApplySafeArea:Bool = false, priority:UILayoutPriority? = nil)
setTopAnchor(_ view:UIView? = nil, isUpdate:Bool = false, constant:CGFloat, priority:UILayoutPriority? = nil)
setBottomAnchor(_ view:UIView? = nil, isUpdate:Bool = false, constant:CGFloat,isMarginsGuide:Bool = false, priority:UILayoutPriority? = nil)
setCenterXAnchor(_ view:UIView? = nil, isUpdate:Bool = false, constant:CGFloat)
setcenterYAnchor(_ view:UIView? = nil, isUpdate:Bool = false, constant:CGFloat)
Useful functions
TTBaseUIKit
provides common handling functions forString
,Date
,Json
,Device
,Language
,VietNamLunar
,Validation
,NetworkSpeedTest
Example Apps
For more examples and usage, please refer to example project
TTBaseUIKitExample
Installed Applications
During my work, I have updated and used this framework in many projects. All my project using
UI programmatically
instead of usingStoryboard
. Here are some screenshoots of the apps:12Bay iOS App
12Bay MacOS app
Aihealth iOS app
You can see all my projects here: Link
Advantages
Disadvantages
SwiftUI
solved that problem I was thinking about.For more examples and usage, please refer to example project [TTBaseUIKitExample]
Meta
Truong Quang Tuan – @website/gmail – truongquangtuanit@gmail.com
Distributed under the XYZ license. See
LICENSE
for more information.https://github.com/tqtuan1201/TTBaseUIKit
About my project
We build high quality apps! Get in touch if you need help with a project.
License
TTBaseUIKit is distributed under the MIT license. See LICENSE for details.