Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bolasblack/xcallbackurl.swift
https://github.com/bolasblack/xcallbackurl.swift
Last synced: 11 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/bolasblack/xcallbackurl.swift
- Owner: bolasblack
- Created: 2016-05-18T17:20:27.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2016-07-18T14:17:15.000Z (over 8 years ago)
- Last Synced: 2024-11-10T03:36:30.839Z (2 months ago)
- Language: Swift
- Size: 11.7 KB
- Stars: 1
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# XCallbackURL.swift
## Installation
### Carthage
```ruby
github "bolasblack/XCallbackURL.swift"
```### CocoaPods
```
# TODO
```## Usage
```swift
XCallbackURL.sharedInstance
.processer { context in
print("I can modify context before handler get it")
return context
}
.handle("/tasks/:id") { context in
print("Searching task: \(context.params["id"]!)")
}
.handle("/tasks/new") { context in
print("Creating task")
print("Goto \(context.successURLComponents!.string) after create")
}XCallbackURL.sharedInstance.perform(NSURL(string: "app://x-callback-url/tasks/new?x-success=launch%3A")!)
// print:
// I can return a new context
// Searching task: Optional("new")
// I can return a new context
// Creating task
// Goto Optional("launch:") after create
```