Latest 0.1.0
License MIT
Platforms ios 7.0, requires ARC

CI Status


Quickly compute positions for UIViews.

Do you often write code like this?:

// position view so that its right edge equals the superviews right edge and the bottom right corner of that view to be the same as its superview
view.frame = CGRectMake(CGRectGetMaxY(superview.frame) - CGRectGetWidth(view.frame),
                            CGRectGetMaxY(superview.frame) - CGRectGetHeight(view.frame),

Wouldn’t it be simpler if you wrote JUST this:

view.frameBottomRight = superview.ownBottomRight;
This category provides a convenient way to position your UIViews using any corner or edge of the coordinate system.


// position redView so that its right edge == self.view right edge and the center.y ==
redView.frameRightCenter = self.view.ownRightCenter;
// position blueView so that its right edge equals redView's left edge and the center.y equals with redView's bottom
blueView.frameRightCenter = _redView.frameBottomLeft;
// position greenView so that its bottom edge equals redView's top edge and the right edge equals with redView's center.x
greenView.frameBottomRight = _redView.frameTopCenter;
// move a view down 5 points
view.frameTop += 5;
//view.frameBottom += 5;


There are two ways to use uiview-position in your project:

  • using CocoaPods
  • copying all the files into your project

Installation with CocoaPods

CocoaPods is a dependency manager for Objective-C, which automates and simplifies the process of using 3rd-party libraries in your projects. See the Get Started section for more details.


pod 'uiview-position'

Quick start

Just add UIView+Position.h and UIView+Position.m to your project. Import UIView+Position.h and start using the extensions.

#import "UIView+Position.h"


AbZorbaGames, [email protected]


uiview-position is available under the MIT license. See the LICENSE file for more info.

Latest podspec

    "name": "uiview-position",
    "version": "0.1.0",
    "summary": "Convenience methods for positioning easily UIView relative to other views and points",
    "description": "Convenience methods for positioning easily UIView relative to other views and points.",
    "homepage": "",
    "license": "MIT",
    "authors": {
        "AbZorbaGames": "[email protected]"
    "source": {
        "git": "",
        "tag": "0.1.0"
    "platforms": {
        "ios": "7.0"
    "requires_arc": true,
    "source_files": [
    "resource_bundles": {
        "uiview-position": [

Pin It on Pinterest

Share This