Composite Views

Composite

Pre-built composite views combining multiple UIKit primitives into common UI patterns — key-value rows, icon-label pairs, form field rows, two-button layouts, and separators. All live in CustomView/Custom/.

ClassPattern
LabelLeftRightViewLeft label + right label (key-value row)
IconLabelViewIcon (top) + label (bottom) vertical pair
IconLabelHorizontalViewIcon (left) + label horizontal pair
LabelTextFieldViewLabel + text field vertical pair
ButtonPanelViewSingle prominent action button in a panel
LineView / TTLineViewHorizontal separator line
TTBaseLableWithButtonViewLabel + button on the same row
BaseTwoStackButtonViewTwo equal-width action buttons
RowTableViewPre-styled key-value table row
LableSubLabelViewTitle + subtitle vertical pair
BaseTwoButtonDiffWidthViewTwo buttons with different widths
IconLabelTextFieldHorizontalViewIcon + label + text field in a row
TTBaseShadowViewGeneric shadow wrapper for any view

🚀 Usage Examples

// Key-value row (settings, profile details)
let row = LabelLeftRightView(
    leftText: "Email",
    rightText: user.email
)

// Icon + label (tab bar item alternative)
let iconLabel = IconLabelView(
    icon: .heart,
    label: "Favorites"
)

// Icon + label horizontal (list item)
let hRow = IconLabelHorizontalView(
    icon: .mapMarker,
    label: "123 Main St, Springfield"
)
hRow.iconColor = .systemRed

// Form field row (label above text field)
let fieldRow = LabelTextFieldView(label: "Phone Number")
fieldRow.textField.keyboardType = .phonePad

// Separator line
let line = LineView()  // or TTLineView()
line.setHeightAnchor(constant: 1)
line.setBgColor(TTView.lineDefColor)

// Label + button on same row
let row = TTBaseLableWithButtonView(
    labelText: "Remember me",
    buttonText: "Learn more"
)
row.onButtonTouchHandler = { self.showInfo() }

// Two equal buttons
let twoButtons = BaseTwoStackButtonView(
    leftTitle: "Cancel",
    rightTitle: "Confirm"
)
twoButtons.onLeftTouchHandler = { self.dismiss(animated: true) }
twoButtons.onRightTouchHandler = { self.confirm() }

// Title + subtitle
let subtitleView = LableSubLabelView(
    title: "Premium Plan",
    subTitle: "$9.99 / month"
)
Pro Tip: Use BaseTwoStackButtonView in bottom action sheets or confirmation panels. It uses TTBaseUIStackView(.fillEqually) so both buttons always share equal width — great for Cancel/Confirm patterns without manual width constraints.