{"id":17090923,"url":"https://github.com/phimage/alamofire-prephirences","last_synced_at":"2025-04-12T22:29:25.724Z","repository":{"id":56901719,"uuid":"44300903","full_name":"phimage/Alamofire-Prephirences","owner":"phimage","description":"Remote preference and configuration for your application","archived":false,"fork":false,"pushed_at":"2019-06-10T06:53:24.000Z","size":65,"stargazers_count":22,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-05-01T21:06:58.457Z","etag":null,"topics":[],"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/phimage.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":null,"patreon":"phimage","open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2015-10-15T07:29:26.000Z","updated_at":"2023-09-16T21:37:06.000Z","dependencies_parsed_at":"2022-08-20T18:50:41.009Z","dependency_job_id":null,"html_url":"https://github.com/phimage/Alamofire-Prephirences","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phimage%2FAlamofire-Prephirences","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phimage%2FAlamofire-Prephirences/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phimage%2FAlamofire-Prephirences/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phimage%2FAlamofire-Prephirences/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/phimage","download_url":"https://codeload.github.com/phimage/Alamofire-Prephirences/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248639449,"owners_count":21137843,"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":[],"created_at":"2024-10-14T13:57:07.805Z","updated_at":"2025-04-12T22:29:25.691Z","avatar_url":"https://github.com/phimage.png","language":"Swift","funding_links":["https://patreon.com/phimage"],"categories":[],"sub_categories":[],"readme":"# Alamofire - Prephirences\n[![License](https://img.shields.io/badge/license-MIT-blue.svg?style=flat)](http://mit-license.org)\n[![Platform](http://img.shields.io/badge/platform-ios_osx-lightgrey.svg?style=flat)](https://developer.apple.com/resources/)\n[![Language](http://img.shields.io/badge/language-swift-orange.svg?style=flat)](https://developer.apple.com/swift)\n[![Cocoapod](http://img.shields.io/cocoapods/v/Alamofire-Prephirences.svg?style=flat)](http://cocoadocs.org/docsets/Alamofire-Prephirences/) [![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)\n\n\n[\u003cimg align=\"left\" src=\"logo.png\" hspace=\"20\"\u003e](#logo) Remote preferences and configurations for your application.\n\nBy using remote preferences you can remotely control the behavior of your app, allowing you to active a feature, to make impromptu A/B tests or to add a simple \"message of the day\".\n\nIt's built on top of [Alamofire](https://github.com/Alamofire/Alamofire) and [Prephirences](https://github.com/phimage/Prephirences), and provides methods to load from remote `plist` or `json` files.\nYou can also have custom format like `xml` or `yaml`\n\n# Usage #\n### Load from URL\nOn your `UserDefault` or any `MutablePreferencesType` for `plist`\n\n```swift\n pref.loadPropertyList(from: \"http://example.com/pref.plist\")\n```\n...or if you need a callback for success/failure\n```swift\npref.loadPropertyList(from: \"http://example.Com/pref.plist\",\n\t\tcompletionHandler: { response in\n\t\t\tswitch response.result {\n\t\t\t\tcase .success:\n\t\t\t\t...\n\t\t\t\tcase .failure(let error):\n\t\t\t\t...\n            }\n\t\t}\n)\n```\n\nAnd for `JSON`format, just change `loadPropertyList` by `loadJSON`\n```swift\n pref.loadJSON(from: \"http://example.com/pref.json\")\n```\n\n## Custom format\nYou can also use custom alamofire `DataResponseSerializer`, which must convert file to `Dictionary`\n```swift\n pref.load(from: \"http://example.com/pref.ext\", format: .custom(MyReponseSerializer))\n```\nSome repo with other format\n- XML : [AlamofireXMLRPC](https://github.com/kodlian/AlamofireXMLRPC)\n- Yaml : [Alamofire-YamlSwift] (https://github.com/phimage/Alamofire-YamlSwift)\n\n### Load from URLRequest\nFor more complex request, instead of using simple URL, you can implement alamofire `URLRequestConvertible` or provide your own `URLRequest`\n\n```swift\nlet url = URL(string: \"http://example.com/pref.plist\")!\nvar urlRequest = URLRequest(url: url)\nurlRequest.httpMethod = \"GET\"\n... (add HTTPHeader, etc...)\n\nmutablePref.loadPropertyList(from: urlRequest)\n```\n\n# Setup #\n\n## Using [cocoapods](http://cocoapods.org/) ##\n\nIf not already done you can optionally :\n- Add `pod 'Alamofire'` to your `Podfile`.\n- Add `pod 'Prephirences'` to your `Podfile`.\n\nThen :\n- Add `pod 'Alamofire-Prephirences'` to your `Podfile` and run `pod install`.\n\n*Don't forget to add `use_frameworks!` to the end of the `Podfile`.*\n\n## Using Carthage ##\n[Carthage](https://github.com/Carthage/Carthage) is a decentralized dependency manager for Objective-C and Swift.\n\n1. Add the project to your [Cartfile](https://github.com/Carthage/Carthage/blob/master/Documentation/Artifacts.md#cartfile).\n\n    ```\n    github \"phimage/Alamofire-Prephirences\"\n    ```\n\n2. Run `carthage update` and follow [the additional steps](https://github.com/Carthage/Carthage#getting-started)\n   in order to add Alamofire-Prephirences to your project.\n\n# Licence #\n```\nThe MIT License (MIT)\n\nCopyright (c) 2015 Eric Marchand (phimage)\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphimage%2Falamofire-prephirences","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphimage%2Falamofire-prephirences","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphimage%2Falamofire-prephirences/lists"}