Routable是采用swift编写的 Target-Action形式的路由框架. 请迁移至Khala
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
Example
ReadmeData
Screenshot
Sources
SourcesA
SourcesB
.gitignore
.swift-version
.travis.yml
AModules.podspec
BModules.podspec
LICENSE
README.md
SPRoutable.podspec
_Pods.xcodeproj
create-apis.sh
trunk.sh

README.md

Routable

build language Platform Version CocoaPods License

迁移至Khala

  1. 安装Khala
    pod 'Khala'
    
  2. 添加路由规则
    // 路由规则
    Khala.language = .cn
    Khala.rewrite.filters.append(RewriteFilter({ (item) -> KhalaURLValue in
        var urlComponents = URLComponents(url: item.url, resolvingAgainstBaseURL: true)
        urlComponents?.host = "Router_" + (item.url.host ?? "")
        urlComponents?.path = "/router_" + item.url.lastPathComponent
        item.url = urlComponents?.url ?? item.url
        return item
    }))
  3. 修改路由函数

    第一个参数修改为匿名.

    from:

    @objc func router_location(params: [String:Any],closure: (_ info: [String:Any]) -> Void){
     	...
    }
    

    to:

    @objc func router_location(_ params: [String:Any],closure: @escaping KhalaClosure){
     	...
    }
  4. 完了.

Require

  • iOS 8.0+ / macOS 10.10+ / tvOS 9.0+ / watchOS 2.0+

  • Swift 4.x

Install

CocoaPod

pod 'SPRoutable'

Useage

  • API Reference - Lastly, please remember to read the full whenever you may need a more detailed reference.

Author

linhay: is.linhay@outlook.com

License

Routable is available under the MIT license. See the LICENSE file for more info.