Skip to content

A UIView frame tool that uses chain calls / 链式调用的 UIView frame 工具

License

Notifications You must be signed in to change notification settings

summertian4/FrameKit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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~

About

A UIView frame tool that uses chain calls / 链式调用的 UIView frame 工具

Resources

License

Stars

Watchers

Forks

Packages

No packages published