Update README.md + asset with updated version of @property wrapper
Property wrapper that enables autolayout on applied views.
@UseAutoLayout property wrapper
@UseAutoLayout
@propertyWrapper public struct UseAutoLayout<T: UIView> { public var wrappedValue: T { didSet { setAutoLayout() } } public init(wrappedValue: T) { self.wrappedValue = wrappedValue setAutoLayout() } func setAutoLayout() { wrappedValue.translatesAutoresizingMaskIntoConstraints = false } }
@UseAutoLayout var label = UILabel()
Property wrappers are defined in Swift 5.1. Using @UseAutoLayout requires Xcode 11.0(and above) and Swift 5.1 toolchain
Add .package(url: "https://github.com/bielikb/UseAutoLayout.git", from: "1.0.0") to your Package.swift file’s dependencies.
.package(url: "https://github.com/bielikb/UseAutoLayout.git", from: "1.0.0")
Package.swift
dependencies
If youre using Xcode 11.0 add this Swift Package to your target(s) using Xcode.
@UseAutoLayout
Property wrapper that enables autolayout on applied views.
Declaration:
@UseAutoLayout
property wrapperUsage
Installation
Property wrappers are defined in Swift 5.1. Using @UseAutoLayout requires Xcode 11.0(and above) and Swift 5.1 toolchain
Swift Package Manager
Add
.package(url: "https://github.com/bielikb/UseAutoLayout.git", from: "1.0.0")
to yourPackage.swift
file’sdependencies
.If youre using Xcode 11.0 add this Swift Package to your target(s) using Xcode.
Example