SwiftFrameGadget
SwiftFrameGadget is a very small view extension. It provides you a more elegant way to use frame layout.
Feature
SwiftFrameGadget provide some anchor to make the layout easier.
topbottomleftrightcenterXcenterYwidthheight
Usage
Without SwiftFrameGadget, If you want to set a view next to another view, you may write code like this:
// viewA, viewB
let x = viewA.frame.origin.x + viewA.frame.width + 5
viewB.frame = CGRect(x: x, y: viewA.frame.origin.y, width: viewB.frame.width, viewB.frame.height)With SwiftFrameGadget, you can write more grace code like this:
// viewA, viewB
viewB.left = viewA.right + 5
viewB.top = viewA.topExample
To run the example project, clone the repo, and run pod install from the Example directory first.
Requirements
None
Installation
SwiftFrameGadget is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'SwiftFrameGadget'Author
limchihi, [email protected]
License
SwiftFrameGadget is available under the MIT license. See the LICENSE file for more info.