2 min read

DotKit

Table of Contents

DotKit

A description of this package.

Installation

dependencies: [
    .package(url: "https://github.com/E13Lau/DotKit.git", from: "0.0.5"),
]
pod 'DotKit', '~> 0.0.5'

Usage

You can open DotKit.xcworkspace and try DotKit in Playground.

UIView()
    .dk
    .asSubviewAdd(to: view)
    .frame(.init(origin: .init(x: 50, y: 50), size: .init(width: 100, height: 100)))
    .backgroundColor(.red)

let label = UILabel()
    .dk
    .textAlignment(.center)
    .text("Hola!")
    .numberOfLines(0)
    .configLayer {
        $0.layer.dk
        .cornerRadius(6)
        .borderWidth(2)
        .borderColor($0.tintColor.cgColor)
    }    
    .asSubviewAdd(to: view)
    .translatesAutoresizingMaskIntoConstraints(false)
    .activateLayoutConstraint {
        [
            $0.topAnchor.constraint(equalTo: view.topAnchor, constant: 100),
            $0.centerXAnchor.constraint(equalTo: view.centerXAnchor),
        ]
    }
    .setContentHuggingPriority(.defaultHigh, for: .vertical)
    .isAccessibilityElement(true)
    .accessibilityLabel("Hello")
    .base

See more

Wrappable

  • CAAnimation
  • CALayer
  • CAReplicatorLayer
  • CAShapeLayer
  • CATextLayer
  • UIAccessibility
  • UIButton
  • UIControl
  • UIImageView
  • UILabel
  • UIScrollView
  • UISlider
  • UIStackView
  • UISwitch
  • UITextField
  • UITextView
  • UIView
  • UIPickerView
  • UIDatePicker
  • UITableView
  • UICollectionView
  • UISearchBar
  • UIToolbar
  • UIActivityIndicatorView
  • UIPageControl