Swiftpack.co -  bestK1ngArthur/K1ngLayout as Swift Package
Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
bestK1ngArthur/K1ngLayout
📐 Simple autolayout wrapper
.package(url: "https://github.com/bestK1ngArthur/K1ngLayout.git", from: "v0.0.1-alpha")

K1ngLayout

Language

📐 Simple autolayout wrapper

Instalation

CocoaPods

Add pod to Podfile

pod 'K1ngLayout', :git => 'https://github.com/bestK1ngArthur/K1ngLayout'

Swift Package Manager

Add package to dependencies

.package(url: "https://github.com/bestK1ngArthur/K1ngLayout", from: "0.0.1"),

Examples


// With Auto Layout

let constraints = [
    view.topAnchor.constraint(equalTo: superview.topAnchor, constant: 8),
    view.leftAnchor.constraint(equalTo: superview.leftAnchor, constant: 16)
]

NSLayoutConstraint.activate(constraints)

// With K1ngLayout

let constraints = [
    view.top.equal(to: superview.top, constant: 8),
    view.left.equal(to: superview.left, constant: 16)
]

view.activate(constraints)


// With Auto Layout

let constraints = [
    view.topAnchor.constraint(equalTo: superview.topAnchor),
    view.bottomAnchor.constraint(equalTo: superview.bottomAnchor),
    view.leftAnchor.constraint(equalTo: superview.leftAnchor),
    view.rightAnchor.constraint(equalTo: superview.rightAnchor)
]

NSLayoutConstraint.activate(constraints)

// With K1ngLayout

view.activate(
    view.pinEqualEdges(to: superview)
)


// With Auto Layout

let constraints = [
    view.leftAnchor.constraint(equalTo: superview.leftAnchor, constant: 16),
    view.rightAnchor.constraint(equalTo: superview.rightAnchor, constant: -16)
]

NSLayoutConstraint.activate(constraints)

// With K1ngLayout

view.activate(
    view.pinEqualEdges(to: superview, insets: .horizontal(16))
)

GitHub

link
Stars: 0
Last commit: 1 week ago

Ad: Job Offers

iOS Software Engineer @ Perry Street Software
Perry Street Software is Jack’d and SCRUFF. We are two of the world’s largest gay, bi, trans and queer social dating apps on iOS and Android. Our brands reach more than 20 million members worldwide so members can connect, meet and express themselves on a platform that prioritizes privacy and security. We invest heavily into SwiftUI and using Swift Packages to modularize the codebase.

Release Notes

Alpha
6 weeks ago

Alpha version

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API