Giter Site home page Giter Site logo

brief's Introduction

Brief

Easy access to UIView & CALayer's layout written in Swift (Inspired from FrameAccessor).

Install

Cocoapods

$ pod 'Brief'

or Manually

Just add Brief.swift into your project.

Usage

// Before
view.frame = CGRectMake(20.0, view.frame.minY, view.frame.width, view.frame.height)
view.frame = CGRectMake(view.frame.minX, view.frame.minY, 200.0, view.frame.height)

// After 
view.x = 20.0
view.width = 200.0

Supported Properties

UIView properties:

Property Type Аvailability
frameOrigin CGPoint get/set
frameSize CGSize get/set
x, y CGFloat get/set
width, height CGFloat get/set
top, left, bottom, right CGFloat get/set
boundsOrigin CGPoint get/set
boundsSize CGSize get/set
boundsWidth, boundsHeight CGFloat get/set
boundsTop, boundsLeft, boundsBottom, boundsRight CGFloat get/set
centerX, centerY CGFloat get/set
middlePoint CGPoint get
middleX, middleY CGFloat get

UIScrollView properties:

Property Type Аvailability
contentOffsetX, contentOffsetY CGFloat get/set
contentSizeWidth, contentSizeHeight CGFloat get/set
contentInsetTop, contentInsetLeft,
contentInsetBottom, contentInsetRight
CGFloat get/set

CALayer properties:

Property Type Аvailability
frameOrigin CGPoint get/set
frameSize CGSize get/set
x, y CGFloat get/set
width, height CGFloat get/set
top, left, bottom, right CGFloat get/set
boundsOrigin CGPoint get/set
boundsSize CGSize get/set
boundsWidth, boundsHeight CGFloat get/set
boundsTop, boundsLeft, boundsBottom, boundsRight CGFloat get/set
anchorX, anchorY CGFloat get/set
positionX, positionY CGFloat get/set

ToDo

  • Support for OSX

License

Apache 2.0 License

brief's People

Contributors

kakajika avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.