Latest 1.1.0
Homepage https://github.com/PTEz/MotionOrientation
License Apache License, Version 2.0 Licensed under the Apache License, Version 2.0 (the “License”);
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an “AS IS” BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Platforms ios , requires ARC
Frameworks CoreMotion, CoreGraphics
Authors ,

MotionOrientation

An observer to notify the orientation of iOS device changed, using CoreMotion for taking the orientation in 'Orientation Lock'.

Requirements

This codes are under ARC.

These frameworks are needed.

CoreMotion.framework
CoreGraphics.framework

Usage

Run below.

[MotionOrientation initialize];

Then you can receive notifications below.

MotionOrientationChangedNotification, when the device orientation changed.
MotionOrientationInterfaceOrientationChangedNotification, just when the interface orientation changed.

And then you can retrieve orientation informations.

UIInterfaceOrientation interfaceOrientation = [MotionOrientation sharedInstance].interfaceOrientation;
UIDeviceOrientation deviceOrientation = [MotionOrientation sharedInstance].deviceOrientation;

Latest podspec

{
    "name": "[email protected]",
    "version": "1.1.0",
    "summary": "Orientation change notifications using CoreMotion. Works even on orientation-locked devices.",
    "homepage": "https://github.com/PTEz/MotionOrientation",
    "license": {
        "type": "Apache License, Version 2.0",
        "text": "      Licensed under the Apache License, Version 2.0 (the "License");n      you may not use this file except in compliance with the License.n      You may obtain a copy of the License atn      n      http://www.apache.org/licenses/LICENSE-2.0n      n      Unless required by applicable law or agreed to in writing, softwaren      distributed under the License is distributed on an "AS IS" BASIS,n      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.n      See the License for the specific language governing permissions andn      limitations under the License.n"
    },
    "authors": {
        "Ernesto Rivera": "[email protected]",
        "Sangwon Park": ""
    },
    "platforms": {
        "ios": null
    },
    "requires_arc": true,
    "source": {
        "git": "https://github.com/PTEz/MotionOrientation.git",
        "tag": "1.1.0"
    },
    "source_files": "MotionOrientation.{h,m}",
    "preserve_paths": "README.md",
    "frameworks": [
        "CoreMotion",
        "CoreGraphics"
    ]
}

Pin It on Pinterest

Share This