Latest 0.1.3
Homepage https://github.com/pixio/PXPinnedRotation
License MIT
Platforms ios 7.0, requires ARC
Frameworks UIKit
Authors

Version
License
Platform

Usage

PXPinnedRotation allows you to create views that use pinned rotation:

Pinned Rotation

Your views will stay in place but rotate when the phone rotates like with the library and filter buttons in the Camera app in iOS.

There are a few things that you need to do to use PXPinnedRotation:

  1. Subclass PXPinnedRotationView and PXPinnedRotationViewController.
  2. Call [self addSubviewToAnimate:] with your animated subviews (buttons, labels, etc.).
  3. Call [self manuallyStartLayoutPass] at the end of init.
  4. Implement -(NSArray*)calculateBaseConstraintsBeforeLayoutPass and put all the code in here that you would normally put in -(void)updateConstraints.

Any views you have specified to animate will be animated. Anything else will not change at all during rotation.

There are blocks you can assign on the view controller if you need additional behavior during or after rotation. Check out the headers for more info.

There’s also the example project shown above. To run it, clone the repo, and run pod install from the Example directory first.

Installation

PXPinnedRotation is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod "PXPinnedRotation"

Author

Daniel Blakemore, [email protected]

License

PXPinnedRotation is available under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "PXPinnedRotation",
    "version": "0.1.3",
    "summary": "A view and a view controller that let's you do pinned rotation with ease.'",
    "description": "A view and view controller subclass that let you specify which of your view's subviews should rotate in place when the phone rotates.",
    "homepage": "https://github.com/pixio/PXPinnedRotation",
    "license": "MIT",
    "authors": {
        "Daniel Blakemore": "[email protected]"
    },
    "source": {
        "git": "https://github.com/pixio/PXPinnedRotation.git",
        "tag": "0.1.3"
    },
    "platforms": {
        "ios": "7.0"
    },
    "requires_arc": true,
    "source_files": "Pod/Classes/**/*",
    "resource_bundles": {
        "PXPinnedRotation": [
            "Pod/Assets/*.png"
        ]
    },
    "public_header_files": "Pod/Classes/**/*.h",
    "frameworks": "UIKit"
}

Pin It on Pinterest

Share This