{"id":15063245,"url":"https://github.com/rsobolewski/rxmotionkit","last_synced_at":"2025-04-10T10:42:49.567Z","repository":{"id":62453152,"uuid":"82150290","full_name":"rsobolewski/RxMotionKit","owner":"rsobolewski","description":"RxMotionKit - reactive motion sensors managing library 🏃","archived":false,"fork":false,"pushed_at":"2019-05-06T15:46:51.000Z","size":39,"stargazers_count":46,"open_issues_count":3,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-24T09:38:21.521Z","etag":null,"topics":["carthage","cocoapods","coremotion","framework","ios","motion","swift"],"latest_commit_sha":null,"homepage":null,"language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rsobolewski.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-02-16T07:03:47.000Z","updated_at":"2024-09-20T12:46:57.000Z","dependencies_parsed_at":"2022-11-01T23:46:32.653Z","dependency_job_id":null,"html_url":"https://github.com/rsobolewski/RxMotionKit","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rsobolewski%2FRxMotionKit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rsobolewski%2FRxMotionKit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rsobolewski%2FRxMotionKit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rsobolewski%2FRxMotionKit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rsobolewski","download_url":"https://codeload.github.com/rsobolewski/RxMotionKit/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248199872,"owners_count":21063774,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["carthage","cocoapods","coremotion","framework","ios","motion","swift"],"created_at":"2024-09-24T23:53:53.172Z","updated_at":"2025-04-10T10:42:49.542Z","avatar_url":"https://github.com/rsobolewski.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"![RxMotionKit](http://i.imgur.com/UCe4ajH.png)\n\n[![Platform](https://img.shields.io/cocoapods/p/RxMotionKit.svg?style=flat)](http://cocoapods.org/pods/RxMotionKit)\n[![CocoaPods Compatible](https://img.shields.io/cocoapods/v/RxMotionKit.svg)](https://img.shields.io/cocoapods/v/RxMotionKit.svg)\n[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)\n\nRxMotionKit is a motion sensors managing library written in Swift.\n\n- [Features](#features)\n- [Description](#description)\n- [Requirements](#requirements)\n- [Installation](#installation)\n\t- [CocoaPods](#cocoapods)\n\t- [Carthage](#carthage)\n- [Usage](#usage)\n- [Communication](#communication)\n- [Author](#author)\n- [License](#license)\n\n\n## Features\n\n- [x] CoreMotion RxSwift support\n- [x] Swifty interface\n- [x] Pleasant data model\n\n## Description\n\nLibrary wraps CoreMotion and RxSwift frameworks and provides pleasant way to obtain data from sensors.\n\n## Requirements\n\n* Xcode 8.1+\n* Swift 3.0+\n\n## Installation\n\n#### CocoaPods\n\nRxMotionKit is available through [CocoaPods](http://cocoapods.org). To install\nit, simply specify it in your `Podfile`:\n\n```ruby\npod 'RxMotionKit', '~\u003e 0.7.0'\n```\n\nThen, run the following command:\n\n```bash\n$ pod install\n```\n\n#### Carthage\n\n[Carthage](https://github.com/Carthage/Carthage) is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks. To integrate RxMotionKit into your Xcode project using Carthage, specify it in your `Cartfile`:\n\n```ogdl\ngithub \"rsobolewski/RxMotionKit\" ~\u003e 0.7.0\n```\n\nRun `carthage update` to build the frameworks and drag them into your Xcode project.\n\n## Usage\n\n#### Start motions source updates\n\nTo start updating data from sensors import `RxMotionKit` module and get reference to singleton instance of `MotionManager`:\n\n```swift\nimport RxSwift\nimport RxMotionKit\n\nunowned let motionManager = MotionManager.shared\n```\n\nsubscribe an Observable:\n\n```swift\nmotionManager.rx_didUpdateMotionData\n\t.subscribe(onNext: { (data) in\n\t\t// Handle received data\n\t})\n```\n\nand start updating selected sources:\n\n```swift\nmotionManager.startUpdating([\n    .accelerometr,\n    .gyroscope,\n    .magnetometer,\n    .deviceMotion\n    ],\n    withInterval: 5.0\n)\n```\n\nFor convenient usage when you want to obtain few updates you can use `take` to automatically stop updates when defined limit is reached:\n\n```swift\nmotionManager.rx_didUpdateMotionData\n\t.take(4)\n\t.subscribe(onNext: { (data) in\n\t\t// Handle received data\n\t})\n```\n\n#### Stop motions source updates\n\nTo stop updates from selected sources:\n\n```swift\nmotionManager.stopUpdating([\n    .accelerometr,\n    .gyroscope,\n    .magnetometer,\n    .deviceMotion\n])\n```\n\n#### Types of motion source\n\nAll motion sources that are available: \n\n- `accelerometr` - Accelerometer\n- `gyroscope` - Gyroscope\n- `magnetometer` - Magnetometer\n- `deviceMotion` - DeviceMotion\n\nAlso you can conveniently specify all motion sources using `MotionSourceType.all`.\n\n#### Types of Observables\n\nThere are several types of Observables provided by `MotionManager`:\n\n* `rx_didUpdateMotionData` - general observable for motion data updates, that merges all events from all source updates\n* `rx_didUpdateAccelerometerData` - accelerometer updates\n* `rx_didUpdateGyroscopeData` - gyroscope updates\n* `rx_didUpdateMagnetometerData` - magnetometer updates\n* `rx_didUpdateDeviceMotionData` - device motion updates\n\n#### Updates configuration\n\nAll sources require the update time interval, that must be provided in method which start updates:\n\n```swift\nlet updateTimeInterval = 1.0 // 1 sec\nstartUpdating([.accelerometer], withInterval: updateTimeInterval)\n```\n\nFor device motion updates you can choose a reference frame for attitude, which will be default if you not provide any.\n\n```swift\nstartUpdating([.accelerometer], withInterval: updateTimeInterval, referenceFrame: .xArbitraryZVertical)\n```\n\n## Communication\n\nIf you want to contribute, please submit a pull request. For code consistency please use SwiftLint with configuration from this repository.  \n\n## Author\n\nRobert Sobolewski, contact me on [Twitter](https://twitter.com/robsobolewski)\n\n## License\n\nRxMotionKit is available under the MIT license. See the LICENSE file for more info.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frsobolewski%2Frxmotionkit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frsobolewski%2Frxmotionkit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frsobolewski%2Frxmotionkit/lists"}