zoukankan      html  css  js  c++  java
  • JLRoutes--处理复杂的URL schemes-备

     
    JLRoutes可简单地处理复杂的URL schemes,无需进行任何类型的URL或者字符串解析。

    功能:
    Simple API with minimal impact to existing codebases
    Parse any number of parameters interleaved throughout the URL
    Wildcard parameter support
    Seamlessly parses out query string and fragment parameters and passes them along as part of the parameters dictionary
    Route prioritization
    Scheme namespaces to easily segment routes and block handlers for multiple schemes
    Return NO from a handler block for JLRoutes to look for the next matching route
    Optional verbose logging
    Pretty-print the whole routing table
    No dependencies other than Foundation

    简单示例
    // in your app delegate:
    
    - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
      // ...
      [JLRoutes addRoute:@"/user/view/:userID" handler:^BOOL(NSDictionary *parameters) {
        NSString *userID = parameters[@"userID"]; // defined in the route by specifying ":userID"
        // present UI for viewing user with ID 'userID'
        return YES; // return YES to say we have handled the route
      }];
      // ...
      return YES;
    }
    
    - (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation {
      return [JLRoutes routeURL:url];
    }
  • 相关阅读:
    vmware导出为ovf
    华三接入交换机推荐
    mysql root情况
    ospf精确宣告地址
    kubernetes k8s yum localinstall
    js判断邮箱、用户名、手机号码和电话号码是否输入正确?
    如何修改Oracle中表的字段长度?
    mybatis与hibernate区别
    SSM框架的优势?
    SSH框架的优势?
  • 原文地址:https://www.cnblogs.com/isItOk/p/5542556.html
Copyright © 2011-2022 走看看