Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/alexdenisov/frameaccessor
Easy access to view's frame.
https://github.com/alexdenisov/frameaccessor
Last synced: 7 days ago
JSON representation
Easy access to view's frame.
- Host: GitHub
- URL: https://github.com/alexdenisov/frameaccessor
- Owner: AlexDenisov
- License: mit
- Created: 2012-03-18T15:55:00.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2016-09-18T20:09:45.000Z (about 8 years ago)
- Last Synced: 2024-11-06T03:47:48.496Z (14 days ago)
- Language: Objective-C
- Homepage:
- Size: 428 KB
- Stars: 443
- Watchers: 20
- Forks: 49
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# FrameAccessor
[![Build Status](https://travis-ci.org/AlexDenisov/FrameAccessor.svg?branch=master)](https://travis-ci.org/AlexDenisov/FrameAccessor)
[![Coverage Status](https://coveralls.io/repos/AlexDenisov/FrameAccessor/badge.svg?branch=master)](https://coveralls.io/r/AlexDenisov/FrameAccessor?branch=master)Easy way to access view's frame in iOS and OSX.
## Compatibility
* iOS 4.3 or higher
* OSX 10.6 or higher## Installation
### Manual Install (preferred method)
Download framework for [iOS](https://github.com/AlexDenisov/FrameAccessor/releases/download/2.0/FrameAccessor-iOS-2.0.zip) or for [OS X](https://github.com/AlexDenisov/FrameAccessor/releases/download/2.0/FrameAccessor-OSX-2.0.zip) target and drag'n'drop into your project.
Add `-ObjC -all_load` to Other Linker Flags.
### CocoaPods
Edit your Podfile and add `FrameAccessor`:
``` bash
pod 'FrameAccessor'
```## Example Usage
```objective-c
view.x = 15.;
view.width = 167.;
```
instead of
```objective-c
CGRect newFrame = view.frame;
newFrame.origin.x = 15.;
newFrame.size.width = 167.;
view.frame = newFrame;
```## 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](https://github.com/AlexDenisov/FrameAccessor/issues/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.
Copyright (c) 2012 Alexey Denisov
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.