EdgeKit is a library to make Auto Layout easily on iOS.
For the detailed information, please visit Wiki
To run the example project, clone the repo, and run pod install
from the Example directory first.
- iOS 12.0+
- Swift 6.0
import UIKit
import EdgeKit
class ViewController: UIViewController {
private let firstView: UIView = {
$0.backgroundColor = .systemPurple
$0.layer.cornerRadius = 5
return $0
}(UIView())
private let secondView: UIView = {
$0.backgroundColor = .systemOrange
$0.layer.cornerRadius = 5
return $0
}(UIView())
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
view.addSubview(firstView)
firstView.top(to: .parentView(inSafeArea: true), padding: 16)
firstView.left(to: .parentView(inSafeArea: true), padding: 16)
firstView.setSize(width: 200, height: 200)
view.addSubview(secondView)
secondView.anchor(leftAnchor: .leftEdge(of: firstView),
topAnchor: .bottomEdge(of: firstView),
rightAnchor: .rightEdge(of: firstView),
topPadding: 20)
secondView.setHeight(100)
}
}
Simply add the following line to your Podfile:
pod 'EdgeKit'
pod 'EdgeKit', :git => 'https://github.com/nazmiyavuz/EdgeKit.git', :branch => 'main'
pod 'EdgeKit', '~> 1.0.0'
EdgeKit is available through Swift Package Manager. To install
it, in Xcode select File
> Add Package Dependencies...
and add EdgeKit repository URL:
https://github.com/nazmiyavuz/EdgeKit.git
Note: Please update the latest version or main
branch of the EdgeKit repository in order to get the latest features.
EdgeKit is available under the MIT license. See the LICENSE file for more info.
Find a bug or have a feature request? Please file an issue!
It would be great if you could read our documentation first or search in the issues before you post, to avoid duplicates.