闻道丶iOS(尝鲜版)iOS Developer

iOS开发杂记

2017-03-28  本文已影响39人  Mr_Zander

下面的内容基本都是我亲测的

#ifdef DEBUG
    #define DebugLog(format, ...) NSLog((@"%s [Line %d] " format), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__)
#else
    #define DebugLog(...)
#endif
UIViewController.automaticallyAdjustsScrollViewInsets = NO;
self.navigationController.navigationBar.backIndicatorImage = self.navigationController.navigationBar.backIndicatorTransitionMaskImage = [[UIImage imageNamed:@"navi_back"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
[self.navigationController.navigationBar setTitleTextAttributes:@{NSForegroundColorAttributeName: [UIColor colorWithHexString:@"#333333"], NSFontAttributeName: [UIFont systemFontOfSize:16.5]}];
-(void)viewDidLayoutSubviews
{
    if ([self.tableView respondsToSelector:@selector(setSeparatorInset:)])
    {
        [self.tableView setSeparatorInset:UIEdgeInsetsZero];
        
    }
    if ([self.tableView respondsToSelector:@selector(setLayoutMargins:)])
    {
        [self.tableView setLayoutMargins:UIEdgeInsetsZero];
    }
}
  // 在UITabBarController的子类中调用
  - (void)viewWillLayoutSubviews
  {
    CGRect tabFrame = self.tabBar.frame; //self.TabBar is IBOutlet of your TabBar
    tabFrame.size.height = kTabbarH;
    tabFrame.origin.y = self.view.frame.size.height - kTabbarH;
    self.tabBar.frame = tabFrame;
  }
  - (void)setTitleTextAttributes:(nullable NSDictionary<NSString *,id> *)attributes   forState:(UIControlState)state NS_AVAILABLE_IOS(5_0)   UI_APPEARANCE_SELECTOR;
[[UITabBar appearance] setSelectionIndicatorImage:[UIImage imageWithColor:UIColorFromHex(FFDC02) size:CGSizeMake(kScreenWidth / self.viewControllers.count, kTabbarH)]];
[UITabBarItem appearance].titlePositionAdjustment = UIOffsetMake(0, -3);
  -(void)viewDidLayoutSubviews
  {
      if ([self.tableView respondsToSelector:@selector(setSeparatorInset:)])
      {
          [self.tableView setSeparatorInset:UIEdgeInsetsZero];   
      }
      if ([self.tableView respondsToSelector:@selector(setLayoutMargins:)])
      {
          [self.tableView setLayoutMargins:UIEdgeInsetsZero];
      }
  }
  - (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell       forRowAtIndexPath:(NSIndexPath *)indexPath
  {
      if ([cell respondsToSelector:@selector(setSeparatorInset:)])
      {
          [cell setSeparatorInset:UIEdgeInsetsZero];
      }
      if ([cell respondsToSelector:@selector(setLayoutMargins:)])
      {
          [cell setLayoutMargins:UIEdgeInsetsZero];
      }
  }
NSArray *searchBarSubViews = [[sc.searchBar.subviews objectAtIndex:0] subviews];
    for (UIView *searchbuttons in searchBarSubViews)
    {
        if ([searchbuttons isKindOfClass:[UIButton class]])
        {
            UIButton *cancelButton = (UIButton *) searchbuttons;
            cancelButton.enabled = YES;
            cancelButton.hidden = YES;
            [cancelButton setTitle:@"取消" forState:UIControlStateNormal]; //文字
            [cancelButton setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
            [cancelButton setTitleColor:[UIColor whiteColor] forState:UIControlStateHighlighted];
            break;
        }
    }
UIBarItem.imageInsets
animation.removedOnCompletion = NO;
animation.fillMode = kCAFillModeForwards;
  - (MyView *)duplicate
  {
    NSData * tempArchive = [NSKeyedArchiver archivedDataWithRootObject:self];
    return [NSKeyedUnarchiver unarchiveObjectWithData:tempArchive];
  }
  - (UIImage *)imageWithView:(UIView *)view
  {
      UIGraphicsBeginImageContextWithOptions(view.bounds.size, NO, [UIScreen   mainScreen].scale);
      [view.layer renderInContext:UIGraphicsGetCurrentContext()];
      UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
      UIGraphicsEndImageContext();
      return image;
}
其中[UIScreen mainScreen].scale参数可以使生成的图片更清晰。
  [toolBar setBackgroundImage:[UIImage alloc] forToolbarPosition:UIBarPositionAny   barMetrics:UIBarMetricsDefault];
  [toolBar setShadowImage:[UIImage alloc] forToolbarPosition:UIBarPositionAny];
  NSURL *myUrl = [NSURL URLWithString:@"search?q=uiviewcontroller"
                          relativeToURL:[NSURL URLWithString:@"https://www.baidu.com/"]];
    
  NSLog(@"baseURL = %@", myUrl.baseURL);  //  https://www.baidu.com/
  NSLog(@"path = %@", myUrl.path);        //  /search
  NSLog(@"scheme = %@", myUrl.scheme);    //  https
  NSLog(@"resourceSpecifier = %@", myUrl.resourceSpecifier);  //  search?  q=uiviewcontroller
  NSLog(@"relativePath = %@", myUrl.relativePath);    //  search
  NSLog(@"relativeString = %@", myUrl.relativeString);    //  search?  q=uiviewcontroller
NSLog(@"absoluteURL = %@", myUrl.absoluteURL);  //    https://www.baidu.com/search?q=uiviewcontroller
  NSLog(@"absoluteString = %@", myUrl.absoluteString);    //      https://www.baidu.com/search?q=uiviewcontroller
  /**
   *  初始化方法
   */
  + (instancetype)sharedManager
  {
      static dispatch_once_t onceToken;
      dispatch_once(&onceToken, ^{
          _sharedManger = [[super allocWithZone:NULL] init];
      });
      return _sharedManger;
  }
  - (id)copyWithZone:(NSZone *)zone
  {
      return [YZJIMManager sharedManager];
  }

  + (id)allocWithZone:(struct _NSZone *)zone
  {
      return [YZJIMManager sharedManager];
  }
    self.edgesForExtendedLayout = UIRectEdgeNone;
机型 像素
6 p / 6s p 1242 * 2208 414 * 736
6 / 6s 750 * 1334 375 * 667
5 / 5c / 5s 640 * 1136 320 * 568
4 / 4s 640 * 960 320 * 480
  1. 进入libksygpulivedylib.framework目录,执行命令:
  2. lipo libksygpulivedylib -remove x86_64 -output libksygpulivedylib
  3. lipo libksygpulivedylib -remove i386 -output libksygpulivedylib
  4. 执行完成后可使用lipo -info libksygpulivedylib 命令确认当前的动态库已经移除上面两个平台。
  5. 如果不执行上述操作,那么在提交app store的时候,可能会出现ITMS-90087, ITMS-90209, ITMS-90125错误。
screen shot : 上架尺寸
iPhone4 : 640x960 或者 960x640
iPhone5 640 x 1136或者1136 x 640
iPhone6 750 x 1334 或者1334 x 750
iPhone6 plus 1242 x 2208 或者 2208x1242 (phone 6 plus实际分辨率是 1080x1920)

ipad不管是哪代 都是 768 x 1024 或者 1024 x 768

视频尺寸
3.5寸 无视频 无需上传
ipad 900x1200 或者 1200 x 900
4.7寸 750x1334 或者 1334 x 750
5.5寸和4寸都可以用 1080x1920 或者 1920 x 1080
App图标:需要1024*1024(像素)的图片

苹果客户电话:中国大陆:400 670 1855
中国香港:21129966
上一篇下一篇

猜你喜欢

热点阅读