ICode9

精准搜索请尝试: 精确搜索
  • SwiftUI使用URLSession发送https请求免证书验证2022-05-19 15:34:34

    1 自定义MyHttp类 class MyHttp: NSObject, URLSessionDelegate { // 使用URLSession请求数据 func httpGet(request: URLRequest, completionHandler: @escaping (Data?, URLResponse?, Error?) -> Void) { let configuration = URLSessionConfiguration.defau

  • iOS清除WKWebView缓存2021-10-26 19:01:56

    //清除缓存 [[NSURLCache sharedURLCache] removeAllCachedResponses]; [[NSURLCache sharedURLCache] setDiskCapacity:0]; [[NSURLCache sharedURLCache] setMemoryCapacity:0]; //清除Cookie NSHTTPCookieStorage *storage = [NSHTTPCookieStorage sharedHTTPCookieStorage]

  • iOS 解决WKWebView加载H5不显示弹框2020-11-10 11:31:38

    - (void)webView:(WKWebView *)webView runJavaScriptConfirmPanelWithMessage:(NSString *)message initiatedByFrame:(WKFrameInfo *)frame completionHandler:(void (^)(BOOL))completionHandler{ UIAlertController *alertController = [UIAlertController alertContr

  • cell左滑加删除置顶功能 iOS2020-08-13 14:33:42

    需求:开发下面这种样式,列表左滑有置顶和删除功能     - (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath {     return YES; }   -(UISwipeActionsConfiguration *)tableView:(UITableView *)tableView trailingSwipeActionsC

  • 收到push时和点击push时加埋点需求2020-06-03 19:02:10

    (目前用的个推+神策,程序最低兼容iOS10) 收到push时和点击push时加埋点需求,分四种情况 A.APP退到后台时,点击push B.APP运行时,点击push C.APP运行时,收到push D.APP退到后台时,收到push   针对A、B,会执行以下方法,加埋点即可 -(void)userNotificationCenter:(UNUserNotificationCent

  • - (void)openURL:(NSURL*)url options:(NSDictionary<UIApplicationOpenExternalURLOptionsKey, id>2020-03-18 14:03:25

        使用系统自带的openUrl后发现打开浏览器死活会乱码,比如把urlStr中的?转义成%3F,后来发现代码中的调用方法是这么写的 [[UIApplication sharedApplication] openURL:[NSURL fileURLWithPath:url options:@{} completionHandler:nil];       这种写法同样可以打开浏览

  • Alamofire初探(后台下载)2019-09-24 17:39:47

    Alamofire后台下载后台下载先来看看苹果原生后台下载Alamofire后台下载 后台下载 从iOS7以来,苹果推出了NSURLSession后,可以实现后台下载任务 先来看看苹果原生后台下载 设置后台下载请求 let urlString:String = "http://dldir1.qq.com/qqfile/QQforMac/QQ_V6.5.5.dmg" l

  • NIO入门2019-07-27 09:57:44

    本文主要为知识性、概念性介绍。NIO涉及的API较多,熟练使用需要大量的联系。可参考Java书籍推荐。 NIO1.0 NIO1.0是Java1.4(2002)引入的,主要特性如下: 进行异步I/O操作的缓冲区ByteBuffer等; 进行异步I/O操作的管道Pipe; 进行异步I/O操作(异步或同步)的Channel,包括ServerSocketChannel和

  • iOS 后台任务2019-06-29 09:44:46

    首先开启后台任务   使用设置后台任务触发的时机 application.setMinimumBackgroundFetchInterval(UIApplication.backgroundFetchIntervalMinimum) func application(_ application: UIApplication, performFetchWithCompletionHandler completionHandler: @escaping (UIBackgro

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有