{"id":13719187,"url":"https://github.com/RxSwiftCommunity/RxCoreLocation","last_synced_at":"2025-05-07T11:31:15.952Z","repository":{"id":26822369,"uuid":"110551133","full_name":"RxSwiftCommunity/RxCoreLocation","owner":"RxSwiftCommunity","description":"RxCoreLocation is a reactive abstraction to manage Core Location.","archived":false,"fork":false,"pushed_at":"2022-03-26T04:26:32.000Z","size":12890,"stargazers_count":181,"open_issues_count":15,"forks_count":82,"subscribers_count":12,"default_branch":"master","last_synced_at":"2024-11-07T19:18:13.337Z","etag":null,"topics":["cllocationmanager","corelocation","location","placemark","rxcorelocation","rxswift","swift"],"latest_commit_sha":null,"homepage":"https://github.com/RxSwiftCommunity/RxCoreLocation","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/RxSwiftCommunity.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-11-13T13:23:31.000Z","updated_at":"2024-06-12T12:28:14.000Z","dependencies_parsed_at":"2022-07-27T08:52:24.333Z","dependency_job_id":null,"html_url":"https://github.com/RxSwiftCommunity/RxCoreLocation","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RxSwiftCommunity%2FRxCoreLocation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RxSwiftCommunity%2FRxCoreLocation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RxSwiftCommunity%2FRxCoreLocation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RxSwiftCommunity%2FRxCoreLocation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RxSwiftCommunity","download_url":"https://codeload.github.com/RxSwiftCommunity/RxCoreLocation/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224153248,"owners_count":17264861,"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":["cllocationmanager","corelocation","location","placemark","rxcorelocation","rxswift","swift"],"created_at":"2024-08-03T01:00:43.998Z","updated_at":"2024-11-14T08:31:25.245Z","avatar_url":"https://github.com/RxSwiftCommunity.png","language":"Swift","readme":"## RxCoreLocation\n\n[![Platforms](https://img.shields.io/cocoapods/p/RxCoreLocation.svg)](https://cocoapods.org/pods/RxCoreLocation)\n[![License](https://img.shields.io/cocoapods/l/RxCoreLocation.svg)](https://raw.githubusercontent.com/RxSwiftCommunity/RxCoreLocation/master/LICENSE)\n\n[![Swift Package Manager](https://img.shields.io/badge/Swift%20Package%20Manager-compatible-brightgreen.svg)](https://github.com/apple/swift-package-manager)\n[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)\n[![CocoaPods compatible](https://img.shields.io/cocoapods/v/RxCoreLocation.svg)](https://cocoapods.org/pods/RxCoreLocation)\n\n[![Travis](https://img.shields.io/travis/RxSwiftCommunity/RxCoreLocation/master.svg)](https://travis-ci.org/RxSwiftCommunity/RxCoreLocation/branches)\n[![JetpackSwift](https://img.shields.io/badge/JetpackSwift-framework-red.svg)](http://github.com/JetpackSwift/Framework)\n\nRxCoreLocation abstract the Rx behavior for Core Location\n\n- [Requirements](#requirements)\n- [Installation](#installation)\n- [Usage](#usage)\n- [License](#license)\n\n## Requirements\n\n- iOS 9.0+ / Mac OS X 10.10+ / tvOS 9.0+ / watchOS 2.0+\n- Xcode 9.1+\n\n## Installation\n\n### CocoaPods\n\n[CocoaPods](http://cocoapods.org) is a dependency manager for Cocoa projects. You can install it with the following command:\n\n```bash\n$ gem install cocoapods\n```\n\nTo integrate RxCoreLocation into your Xcode project using CocoaPods, specify it in your `Podfile`:\n\n```ruby\nsource 'https://github.com/CocoaPods/Specs.git'\nplatform :ios, '9.0'\nuse_frameworks!\n\npod 'RxCoreLocation', '~\u003e 1.5.1'\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 automates the process of adding frameworks to your Cocoa application.\n\nYou can install Carthage with [Homebrew](http://brew.sh/) using the following command:\n\n```bash\n$ brew update\n$ brew install carthage\n```\n\nTo integrate RxCoreLocation into your Xcode project using Carthage, specify it in your `Cartfile`:\n\n```ogdl\ngithub \"RxSwiftCommunity/RxCoreLocation\" ~\u003e 1.5.1\n```\n### Swift Package Manager\n\nTo use RxCoreLocation as a [Swift Package Manager](https://swift.org/package-manager/) package just add the following in your Package.swift file.\n\n``` swift\nimport PackageDescription\n\nlet package = Package(\n    name: \"HelloRxCoreLocation\",\n    dependencies: [\n        .Package(url: \"https://github.com/RxSwiftCommunity/RxCoreLocation.git\", \"1.5.1\")\n    ]\n)\n```\n\n### Manually\n\nIf you prefer not to use either of the aforementioned dependency managers, you can integrate RxCoreLocation into your project manually.\n\n#### Git Submodules\n\n- Open up Terminal, `cd` into your top-level project directory, and run the following command \"if\" your project is not initialized as a git repository:\n\n```bash\n$ git init\n```\n\n- Add RxCoreLocation as a git [submodule](http://git-scm.com/docs/git-submodule) by running the following command:\n\n```bash\n$ git submodule add https://github.com/RxSwiftCommunity/RxCoreLocation.git\n$ git submodule update --init --recursive\n```\n\n- Open the new `RxCoreLocation` folder, and drag the `RxCoreLocation.xcodeproj` into the Project Navigator of your application's Xcode project.\n\n    \u003e It should appear nested underneath your application's blue project icon. Whether it is above or below all the other Xcode groups does not matter.\n\n- Select the `RxCoreLocation.xcodeproj` in the Project Navigator and verify the deployment target matches that of your application target.\n- Next, select your application project in the Project Navigator (blue project icon) to navigate to the target configuration window and select the application target under the \"Targets\" heading in the sidebar.\n- In the tab bar at the top of that window, open the \"General\" panel.\n- Click on the `+` button under the \"Embedded Binaries\" section.\n- You will see two different `RxCoreLocation.xcodeproj` folders each with two different versions of the `RxCoreLocation.framework` nested inside a `Products` folder.\n\n    \u003e It does not matter which `Products` folder you choose from.\n\n- Select the `RxCoreLocation.framework`.\n\n- And that's it!\n\n\u003e The `RxCoreLocation.framework` is automagically added as a target dependency, linked framework and embedded framework in a copy files build phase which is all you need to build on the simulator and a device.\n\n#### Embeded Binaries\n\n- Download the latest release from https://github.com/RxSwiftCommunity/RxCoreLocation/releases\n- Next, select your application project in the Project Navigator (blue project icon) to navigate to the target configuration window and select the application target under the \"Targets\" heading in the sidebar.\n- In the tab bar at the top of that window, open the \"General\" panel.\n- Click on the `+` button under the \"Embedded Binaries\" section.\n- Add the downloaded `RxCoreLocation.framework`.\n- And that's it!\n\n## Usage\n[RxCoreLocation](https://github.com/RxSwiftCommunity/RxCoreLocation) exposes lots of  [Apple Core Location](https://developer.apple.com/documentation/corelocation)  `API` for you to use directly inside your  App.\n\n-  Subscribing for a `CLPlacemark`\n```swift\n\n    /// Setup CLLocationManager\n    manager.requestWhenInUseAuthorization()\n    manager.startUpdatingLocation()\n    \n    manager.rx\n    .placemark\n    .subscribe(onNext: { placemark in\n        guard let name = placemark.name,\n            let isoCountryCode = placemark.isoCountryCode,\n            let country = placemark.country,\n            let postalCode = placemark.postalCode,\n            let locality = placemark.locality,\n            let subLocality = placemark.subLocality else {\n                return print(\"oops it looks like your placemark could not be computed\")\n        }\n        print(\"name: \\(name)\")\n        print(\"isoCountryCode: \\(isoCountryCode)\")\n        print(\"country: \\(country)\")\n        print(\"postalCode: \\(postalCode)\")\n        print(\"locality: \\(locality)\")\n        print(\"subLocality: \\(subLocality)\")\n    })\n    .disposed(by: bag)\n```\n-  You can also subscribe for  a single `CLLocation`  update or for `[CLLocation]` \n```swift\n\n    ///Subscribing for a single location events\n    manager.rx\n    .location\n    .subscribe(onNext: { location in\n        guard let location = location else { return }\n        print(\"altitude: \\(location.altitude)\")\n        print(\"latitude: \\(location.coordinate.latitude)\")\n        print(\"longitude: \\(location.coordinate.longitude)\")\n    })\n    .disposed(by: bag)\n    \n    ///Subscribing for an array of location events\n    manager.rx\n    .didUpdateLocations\n    .subscribe(onNext: { _, locations in\n        guard !locations.isEmpty,\n            let currentLocation = locations.last else { return }\n            print(\"altitude: \\(currentLocation.altitude)\")\n            print(\"latitude: \\(currentLocation.coordinate.latitude)\")\n            print(\"longitude: \\(currentLocation.coordinate.longitude)\")\n    })\n    .disposed(by: bag)\n```\n\n- Observing the  `CLAuthorizationStatus`  and reacting based on your needs\n\n```swift\n\n    ///Monitoring authorization changes\n    \n    manager.rx\n    .didChangeAuthorization\n    .subscribe(onNext: {_, status in\n        switch status {\n        case .denied:\n            print(\"Authorization denied\")\n        case .notDetermined:\n            print(\"Authorization: not determined\")\n        case .restricted:\n            print(\"Authorization: restricted\")\n        case .authorizedAlways, .authorizedWhenInUse:\n            print(\"All good fire request\")\n        }\n    })\n    .disposed(by: bag)\n```\n## License\n\nRxCoreLocation is released under the MIT license. See [LICENSE](https://github.com/RxSwiftCommunity/RxCoreLocation/blob/master/LICENSE) for details.\n![Try me](https://media.giphy.com/media/d2jjuAZzDSVLZ5kI/giphy.gif)\n","funding_links":[],"categories":["Libraries"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FRxSwiftCommunity%2FRxCoreLocation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FRxSwiftCommunity%2FRxCoreLocation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FRxSwiftCommunity%2FRxCoreLocation/lists"}