app刚开始启动时(即:appdelegate文件中)可以写的几个功能

app刚开始启动时(即:appdelegate文件中)可以写的几个功能:

1、通过判断根控制器,来实现区分有无欢迎界面

2、因为ios11的tableview跟之前有的有些区别,所以在app启动时可以加一个适配ios11的方法{

if (@available (iOS 11.0,*)) {

        UIScrollView.appearance.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;

        UITableView.appearance.estimatedRowHeight = 0;

        UITableView.appearance.estimatedSectionFooterHeight = 0;

        UITableView.appearance.estimatedSectionHeaderHeight = 0;

    }

}

3、app有时候会因为内存不够,会触动applicationDidReceiveMemoryWarning:方法,所以,可以做一些清理内存的操作{

[[SDWebImageManager sharedManager]cancelAll]; //取消所有下载

    [[SDWebImageManager sharedManager].imageCache clearMemory]; //立即清除缓存

}

4、如果用到蒲公英打包的时候,可以做一个蒲公英自动更新功能,蒲公英官网有sdk文档,可以参照。

原文地址:https://www.cnblogs.com/includeao/p/8946060.html