TestsTested | ✓ |
LangLanguage | SwiftSwift |
License | MIT |
ReleasedLast Release | Feb 2017 |
SwiftSwift Version | 3.0 |
SPMSupports SPM | ✗ |
Maintained by Cœur.
Easy way to access view’s frame in iOS and macOS.
import FrameAccessor
view.x = 15.0
view.width = 167.0
instead of
view.frame.origin.x = 15.0
view.frame.size.width = 167.0
UIView/NSView
properties:
Property | Type | Аvailability |
---|---|---|
viewOrigin | CGPoint | readwrite |
viewSize | CGSize | readwrite |
x , y | CGFloat | readwrite |
width , height | CGFloat | readwrite |
top , left , bottom , right | CGFloat | readwrite |
centerX , centerY | CGFloat | readwrite |
middlePoint | CGPoint | readonly |
middleX , middleY | CGFloat | readonly |
Note: the names of @viewOrigin and @viewSize properties are prefixed with view
to not create conflicts with Apple’s private internals (As discussed in #7).
UIScrollView
properties:
Property | Type | Аvailability |
---|---|---|
contentOffsetX , contentOffsetY | CGFloat | readwrite |
contentSizeWidth , contentSizeHeight | CGFloat | readwrite |
contentInsetTop , contentInsetLeft , contentInsetBottom , contentInsetRight | CGFloat | readwrite |
FrameAccessor is available under the MIT license.
See LICENSE file