Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lm2343635/rxorientation
Screen orientation notification extension based on RxSwift
https://github.com/lm2343635/rxorientation
rxswift screen-orientation-notifications
Last synced: about 1 month ago
JSON representation
Screen orientation notification extension based on RxSwift
- Host: GitHub
- URL: https://github.com/lm2343635/rxorientation
- Owner: lm2343635
- License: mit
- Created: 2018-11-15T09:59:14.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2019-05-27T03:48:08.000Z (over 5 years ago)
- Last Synced: 2024-10-10T19:04:43.901Z (about 1 month ago)
- Topics: rxswift, screen-orientation-notifications
- Language: Swift
- Homepage: https://cocoapods.org/pods/RxOrientation
- Size: 29.3 KB
- Stars: 10
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# RxOrientation
[![CI Status](https://img.shields.io/travis/lm2343635/RxOrientation.svg?style=flat)](https://travis-ci.org/lm2343635/RxOrientation)
[![Version](https://img.shields.io/cocoapods/v/RxOrientation.svg?style=flat)](https://cocoapods.org/pods/RxOrientation)
[![License](https://img.shields.io/cocoapods/l/RxOrientation.svg?style=flat)](https://cocoapods.org/pods/RxOrientation)
[![Platform](https://img.shields.io/cocoapods/p/RxOrientation.svg?style=flat)](https://cocoapods.org/pods/RxOrientation)RxOrientation is a screen orientation notification extension for RxSwift, which transforms the state of screen orientation notifications into RxSwift Observables.
## Example
To run the example project, clone the repo, and run `pod install` from the Example directory first.
## Installation
RxOrientation is available through [CocoaPods](https://cocoapods.org). To install
it, simply add the following line to your Podfile:```ruby
pod 'RxOrientation'
```In your view model class or view controller class, using `UIDevice.current.rx.orientation` to get the current device orientaion and `UIApplication.shared.rx.statusBarOrientation` to get the status bar orientaion.
```Swift
UIApplication.shared.rx.statusBarOrientation.subscribe(onNext: { orientaion in
// ...
}).disposed(by: disposeBag)
```## Author
lm2343635, [email protected]
## License
RxOrientation is available under the MIT license. See the LICENSE file for more info.