CocoaPods trunk is moving to be read-only. Read more on the blog, there are 19 months to go.

FrameKit 0.1.1

FrameKit 0.1.1

TestsTested
LangLanguage SwiftSwift
License MIT
ReleasedLast Release Aug 2017
SwiftSwift Version 3.0
SPMSupports SPM

Maintained by coderfish.



FrameKit 0.1.1

FrameKit

Introduction

中文简介

A UIView frame tool that uses chain calls

Uncomfortable code:

self.view.frame.origin = CGPoint(x: 100.0, y: self.view.frame.origin.y)

In addition, different library extensions to the frame will lead to some naming conflicts.

If you use FrameKit, your frame settings will become::

self.view.lpd.x = 100.0

You can use it directly for your project, or as a dependent library for your personal library.

Install

pod 'FrameKit'

Example

let _ = self.view.fkit.x
self.view.fkit.x = 0.0

let _ = self.view.fkit.right
self.view.fkit.right = 300.0

let _ = self.view.fkit.bottom
self.view.fkit.bottom = 300.0

let _ = self.view.fkit.centerX
self.view.fkit.centerX = 100.0

All API

extension UIView {
    public var fkit: FrameKit.UIViewExtension { get }
}

get set 均可

public var y: CGFloat

public var width: CGFloat

public var height: CGFloat

public var size: CGSize

public var centerX: CGFloat

public var centerY: CGFloat

public var top: CGFloat

public var bottom: CGFloat

public var left: CGFloat

public var right: CGFloat

License

FrameKit 使用 MIT License

Feedback

If there are any suggestions, pleas send an email to [email protected], and also welcome to my blog to discuss. Learning together~