迁移至Khala
-
安装Khala
pod 'Khala'
-
// 路由规则 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 }))
-
第一个参数修改为匿名.
from:
@objc func router_location(params: [String:Any],closure: (_ info: [String:Any]) -> Void){ ... }
to:
@objc func router_location(_ params: [String:Any],closure: @escaping KhalaClosure){ ... }
-
iOS 8.0+ / macOS 10.10+ / tvOS 9.0+ / watchOS 2.0+
-
Swift 4.x
CocoaPod
pod 'SPRoutable'
- API Reference - Lastly, please remember to read the full whenever you may need a more detailed reference.
linhay: is.linhay@outlook.com
Routable is available under the MIT license. See the LICENSE file for more info.