Latest 3.0.1
Homepage https://github.com/Coeur/FrameAccessorSwift
License MIT
Platforms ios 8.0, osx 10.9
Authors , , ,

FrameAccessor

Build Status
Coverage Status

Easy way to access view’s frame in iOS and macOS.

Compatibility

  • iOS 8.0 or higher
  • OSX 10.9 or higher

Installation

CocoaPods

Edit your Podfile and add FrameAccessorSwift:

pod 'FrameAccessorSwift'

Example Usage

import FrameAccessor
view.x = 15.0
view.width = 167.0

instead of

view.frame.origin.x = 15.0
view.frame.size.width = 167.0

Available Properties

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

License

FrameAccessor is available under the MIT license.

See LICENSE file

Latest podspec

{
    "name": "FrameAccessorSwift",
    "module_name": "FrameAccessor",
    "version": "3.0.1",
    "license": "MIT",
    "summary": "Easy access to view's frame.",
    "homepage": "https://github.com/Coeur/FrameAccessorSwift",
    "description": "You can access x, y, width, height, origin or size like properties.nLike this:nview.x = 15nview.width = 167",
    "authors": {
        "AlexDenisov": "[email protected]",
        "holgersindbaek": "[email protected]",
        "noxt": "[email protected]",
        "Cu0153ur": "[email protected]"
    },
    "source": {
        "git": "https://github.com/Coeur/FrameAccessorSwift.git",
        "tag": "3.0.1"
    },
    "platforms": {
        "ios": "8.0",
        "osx": "10.9"
    },
    "ios": {
        "source_files": "FrameAccessor/*.{swift}"
    },
    "osx": {
        "source_files": "FrameAccessor/ViewFrameAccessor.{swift}"
    },
    "pushed_with_swift_version": "3.0"
}

Pin It on Pinterest

Share This