CoreUIKit
provides functional and easy to use extensions on top of UIKit
. Same concepts but less code!
CocoaPods is a dependency manager for Swift and Objective-C Cocoa projects. Learn More!
pod 'CoreUIKit', '0.3.5'
The Swift Package Manager is a tool for managing the distribution of Swift code. It’s integrated with the Swift build system to automate the process of downloading, compiling, and linking dependencies. Learn More!
dependencies: [
.package(url: "https://github.com/swiftkits/CoreUIKit.git", .upToNextMajor(from: "0.3.5"))
]
A simple, decentralized dependency manager for Cocoa. Learn More!
github "CoreUIKit" ~> 0.3.5
- How to add a
subView
on aparentView
which hasleading
trailing
top
andbottom
anchors matching with it'sparentView
self.subView
.add(to: self.parentView)
.allAnchorsSame(on: self.prarentView)
- How to add a
subView
to aparentView
with matching onlyleading
anchor
self.subView
.add(to: self.parentView)
.leading(of: self.parentView.leadingAnchor)
- How to add a
subView
to aparentView
ontop
andleading
with margin/space of 10 units andwidth
andheight
of 120 respectively.
self.subView
.add(to: self.parentView)
.top(of: self.parentView.topAnchor)
.leading(of: self.parentView.leadingAnchor)
.with(width: 120, height: 120)
- To learn more about avilable extensions, check this out
Following are the useful links for learning about autolayout.
- Learn AutoLayout
- Debug
- WWDC Videos
Written By Manish Pandey.