🎨 View instance initializing sugar for Swift & UIKit

Overview

AddThen

CI Status Version License Platform

🎨 View instance sugar for Swift & UIKit

Example

Add UIView & UIViewController code with AddThen

let label = UILabel()
label.backgroundColor = .red
label.text = "Hello, World"

...

view.addSubview(label)

This is equivalent to :

let label = UILabel()

...

view.add(label) {
  $0.backgroundColor = .red
  $0.text = "Hello, World!"
}

Also very useful with SnapKit

let label = UILabel()

...

view.add(label) {
  $0.backgroundColor = .red
  $0.text = "Hello, World!"
  
  $0.snp.makeConstraints {
    $0.edges.equalToSuperview()
  }
}

Requirements

  • iOS 9.0+ (11.0+ recommended)
  • Xcode 12.0+
  • Swfit 5.0

Installation

AddThen is available through CocoaPods & SPM. To install it, simply add the following line to your Podfile:

cocoapod

pod 'AddThen'

Swift Package Manager

import PackageDescription

let package = Package(
  name: "MyApp",
  dependencies: [
    .package(url: "https://github.com/stareta1202/AddThen", .upToNextMajor(from: "1.0.1")),
  ]
)

Author

  • Yongjun Lee, stareta1202
  • Chanwoo Cho, GREENOVER

License

AddThen is available under the MIT license. See the LICENSE file for more info.

You might also like...
Application to test MVVM architecture with Combine and UIKit librarys.

Application to test MVVM architecture with Combine and UIKit librarys.

xTensions is a collection of useful class extensions for UIKit.

xTensions Intro xTensions is a collection of useful class extensions for UIKit. Swift Package Manager Note: Instructions below are for using SwiftPM w

A simple and elegant UIKit for iOS.
A simple and elegant UIKit for iOS.

HamsterUIKit A simple and elegant UIKit(Chart) for iOS, written in Swift. πŸ“Š Curve and bar Charts. πŸ’‘ Protocols are designed based on UIKit(UITableVie

πŸ“ Declarative UIKit in 10 lines of code.
πŸ“ Declarative UIKit in 10 lines of code.

Withable πŸ“ Declarative UIKit in 10 lines of code. See corresponding article at Declarative UIKit with 10 lines of code A simple extension instead of

🧩 Easy scrollable layouts in UIKit
🧩 Easy scrollable layouts in UIKit

Easy scrollable layouts in UIKit Create complex scrollable layout using UIViewControllers or plain UIViews and simplify your code! ScrollStackControll

A way to quickly add a notification badge icon to any view. Make any view of a full-fledged animated notification center.
A way to quickly add a notification badge icon to any view. Make any view of a full-fledged animated notification center.

BadgeHub A way to quickly add a notification badge icon to any view. Demo/Example For demo: $ pod try BadgeHub To run the example project, clone the r

Confetti View lets you create a magnificent confetti view in your app
Confetti View lets you create a magnificent confetti view in your app

ConfettiView Confetti View lets you create a magnificent confetti view in your app. This was inspired by House Party app's login screen. Written in Sw

Cool Animated music indicator view written in Swift
Cool Animated music indicator view written in Swift

Cool Animated music indicator view written in Swift. ESTMusicIndicator is an implementation of NAKPlaybackIndicatorView in Swift for iOS 8. ζœ¬δΊΊθ‘—δ½œηš„δΉ¦η±γ€ŠLa

An easy to use FAQ view for iOS written in Swift
An easy to use FAQ view for iOS written in Swift

FAQView An easy to use FAQ view for iOS written in Swift. This view is a subclass of UIView. Setup with CocoaPods If you are using CocoaPods add this

Releases(1.0.3)
Owner
Yongjun Lee
I make things work
Yongjun Lee
Shadow - Syntactic sugar for shadows in the SwiftUI framework

Shadow Syntactic sugar for shadows in the SwiftUI framework. import SwiftUI impo

Dima Koskin 2 Jan 31, 2022
Swift extensions for UIKit.framework.

XUIKit Example To run the example project, clone the repo, and run pod install from the Example directory first. Requirements Installation XUIKit is a

FITZ 0 Oct 22, 2021
Neumorphism framework for UIKit.

NeumorphismKit is neumorphism framework for UIKit. Requirements iOS 12.0+ Swift 5.1+ Versions NeumorphismKit version Xcode version 1.0.0 Xcode 11+ 1.1

y-okudera 42 Dec 13, 2022
Easily use UIKit views in your SwiftUI applications. Create Xcode Previews for UIView elements

SwiftUIKitView Easily use UIKit views in SwiftUI. Convert UIView to SwiftUI View Create Xcode Previews from UIView elements SwiftUI functional updatin

Antoine van der Lee 682 Dec 29, 2022
Make ComposableArchitecture work with UIKit

ComposableUIKit The ComposableArchitecture (TCA) library provides a way of structuring Swift code with the Redux-pattern. It is highly optimized for S

Manuel Maly 11 Nov 5, 2022
Combine publisher bridges for UIKit

Combine publisher bridges for UIKit

Combine Community 1.3k Jan 1, 2023
Convenient domain specific language for writing programmatic UI built over UIKit and more.

XYKit Swifty and convenient domain specific language for creating programmatic UI in a more declarative way and more than that. Built on top of UIKit

Denis Goloborodko 1 Nov 5, 2021
🎸🎸🎸 Common categories for daily development. Such as UIKit, Foundation, QuartzCore, Accelerate, OpenCV and more.

?????? Common categories for daily development. Such as UIKit, Foundation, QuartzCore, Accelerate, OpenCV and more.

77。 423 Jan 4, 2023
Example Catalyst app that is shown in a UIKit popover underneath an NSStatusItem

CatalystStatusItemPopoverExample Example Catalyst app that is shown in a UIKit popover underneath an NSStatusItem. References How to use macOS Specifi

Tom Irving 9 Sep 8, 2022
Create descriptive UIKit screens, faster!

Columbina's DeclarativeUIKit Create descriptive UIKit screens, faster! Get rid of constraints manipulation and use declarative language to create your

Columbina 2 Dec 12, 2021