Latest 0.1.1
Homepage https://github.com/tastyone/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
Frameworks CoreMotion, CoreGraphics
Authors

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": "MotionOrientation",
    "version": "0.1.1",
    "description": "Fork from https://github.com/tastyone/MotionOrientation An observer to notify the orientation of iOS device changed, using CoreMotion for taking the orientation in 'Orientation Lock'.",
    "summary": "An observer to notify the orientation.",
    "homepage": "https://github.com/tastyone/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": {
        "Sangwon Park": ""
    },
    "platforms": {
        "ios": null
    },
    "source": {
        "git": "https://github.com/yuyedaidao/MotionOrientation.git",
        "tag": "0.1.1"
    },
    "source_files": "MotionOrientation.{h,m}",
    "preserve_paths": "README.md",
    "frameworks": [
        "CoreMotion",
        "CoreGraphics"
    ]
}

Pin It on Pinterest

Share This