爱限免Demo

1.资源:

  网络接口、数据解析库AFNetWorking.h 、...

2.建立界面  --搭建框架

  列表AppListViewController --> 列表显示数据,上拉加载下拉刷新(JHRefresh),搜索列表,传值。。。

  建立几个SubViewController : AppListViewController

// 把汉字转化成url encoded可以在网上传输的...
    NSString *str = [searchBar.text stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];

  详情界面DetailViewController -->数据重载, 传值(block),分享(友盟分享),收藏,下载。。。

//下载
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:self.model.itunesUrl]];

  专题界面TopicViewController --> 嵌套显示

3.导航进入  

  CategoryViewController(分类) --> 传值AppListViewController(重新加载数据)

  ConfigViewController(配置) --> 缓存,数据存储(数据库FMDB)

4.其他

  分享:友盟分享(UMSocial), ShareSDK, 百度分享-- 找官方文档,照做即可

   添加加载效果 --> 第三方HUD下载提示框  SVProgressHUD  

  网络活动提示

    //打开网络活动提示
    [[UIApplication sharedApplication] setNetworkActivityIndicatorVisible:YES];

    //关闭网络活动提示
    [[UIApplication sharedApplication] setNetworkActivityIndicatorVisible:NO];

 

 。。。

去掉performSelector警告
#pragma clang diagnostic ignored "-Warc-performSelector-leaks"'

//是否支持自动旋转
-(BOOL)shouldAutorotate
{
    return YES;
}
//支持的旋转方向
-(NSUInteger)supportedInterfaceOrientations
{
    return UIInterfaceOrientationMaskAll;
}
//是否能否旋转到该方向
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation
{
    return (toInterfaceOrientation == UIInterfaceOrientationPortrait);
}



//即将开始旋转
- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration
{
    
}
//已经结束旋转
-(void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation
{
    _tableView.frame = self.view.bounds;
}


//自动横屏
-(NSUInteger)supportedInterfaceOrientations
{
    return UIInterfaceOrientationMaskLandscapeLeft;
    //return UIInterfaceOrientationMaskPortrait;
    
}
原文地址:https://www.cnblogs.com/wlrBlogs/p/4418363.html