CoreUI

1.1.1

Swift-CoreUI/CoreUI

What's New

2023-01-31T18:04:27Z

CoreUI

Library to build UI in declarative and functional style. Built on top of UIKit and supports old iOS versions.

import UIKit
import CoreUI

class MyViewController: UIViewController {

  override func viewDidLoad() {
    super.viewDidLoad()

    addSubview(
      UI.VScrollView(
        contentInset: .vertical(12),
        UI.VStack(
          UI.View(backgroundColor: .red, height: 20),
          UI.Label("Are you sure?", font: .systemFont(ofSize: 24), color: .label),
          UI.Spacer(minHeight: 30),
          UI.HStack(
            spacing: 12,
            UI.Button("Yes").apply { $0.addTarget(self, action: #selector(yesTapped), for: .touchUpInside) },
            UI.Button("No").apply { $0.addTarget(self, action: #selector(noTapped), for: .touchUpInside) }
          )
        ),
        .leading(6), .trailing(-6), .safeTop(0), .safeBottom(0)
      )
    )
  }

}

Description

  • Swift Tools 5.3.0
View More Packages from this Author

Dependencies

  • None
Last updated: Fri Oct 18 2024 15:52:25 GMT-0900 (Hawaii-Aleutian Daylight Time)