2018-01-02 - 抢玩 修改密码问题

抢玩

  • 个人中心【修改密码】提示验证码失效

  • 个人中心点击【每日签到】报错


    改成这样:

decisionHandler(WKNavigationActionPolicyAllow);
return;
2018/1/2 posted in  工作总结

2017-12-29 - 常用的宏定义

#define WoWWeakSelf __weak __typeof(self) weakSelf = self;
#define WoWStrongSelf __strong __typeof(weakSelf) strongSelf = weakSelf;

//礼包中心上方高度
#define kTopBarHeight  40.0f
/*
 日志输出
 */
#ifdef DEBUG
#define WoWLog(...) NSLog(__VA_ARGS__)
#else
#define WoWLog(...)
#endif

#define WoWColor(r,g,b) [UIColor colorWithRed:(r)/255.0 green:(g)/255.0 blue:(b)/255.0 alpha:1.0]
#define WoWColorWithAl(r,g,b,a) [UIColor colorWithRed:(r)/255.0 green:(g)/255.0 blue:(b)/255.0 alpha:a]
#define WoWColorFromRGB(rgbValue)    [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 green:((float)((rgbValue & 0xFF00) >> 8))/255.0 blue:((float)(rgbValue & 0xFF))/255.0 alpha:1.0]

//----颜色----
//主题色,高亮信息
//#define kWoWThemeColor         WoWColor(222,64,74)
#define kWoWThemeColor         [UIColor colorWithHexString:@"#de162f"]
#define kWoWOrangeColor         [UIColor colorWithHexString:@"#de162f"]
#define kWoWOrangeSelectColor   [UIColor colorWithHexString:@"#cf152c"]
#define kWoWOrangeDisableColor         [UIColor colorWithHexString:@"#f2a6b0"]
#define kWoWOrangeBottomColor   [UIColor colorWithHexString:@"#efc7cc"]
#define kWoWGraySelectColor   [UIColor colorWithHexString:@"#e8ebe8"]
#define kWoWGrayColor   [UIColor colorWithHexString:@"#e8e8e8"]
#define kWoWBlueSelectColor   [UIColor colorWithHexString:@"#3187cf"]
#define kWoWBlueColor   [UIColor colorWithHexString:@"#3f8ed8"]
#define kWoWRedColor   WoWColor(255,6,7)
//窗口透明背景
#define kWoWBackgroundColorWithAl WoWColorWithAl(0,0,0,0.4)

#define kWoWNavigationBarColor WoWColor(254,254,254)
////黑色字体标题颜色,重要信息
#define kWoWDarkTextColor [UIColor colorWithHexString:@"#131313"]
////灰色字体颜色,颜色较淡,辅助信息
#define kWoWLightGrayTextColor [UIColor colorWithHexString:@"#999999"]
////灰色字体颜色,颜色较深,辅助信息
#define kWoWDarkGrayTextColor [UIColor colorWithHexString:@"#666666"]

////背景色
#define kWoWBackgroundColor [UIColor colorWithHexString:@"#f3f3f3"]
//登录注册白色背景
#define kWoWWhiteBackColorWithAl WoWColorWithAl(248,248,248,0.7)
//登录注册大背景
#define kWoWGrayBackColorWithAl WoWColorWithAl(190,190,190,0.7)
//登录注册字体颜色
#define WoW_logintextColor  [UIColor colorWithRed:42/255.0 green:65/255.0 blue:88/255.0 alpha:1.0]
//白色
#define kWoWWhiteColor WoWColor(255,255,255)
//分割线颜色,不可用状态
#define kWoWSeparatorColor [UIColor colorWithHexString:@"#e8ebe8"]
//绿色,按钮
#define kWoWGreenButtonColor WoWColor(0,204,111)

//屏幕大小
/* 当前设备的屏幕尺寸,含状态栏,例如320x480,也即分辨率,ios8以下不随设备方向而变化,ios8及以上是实时尺寸 */
#define kScreenWidth [[UIScreen mainScreen] bounds].size.width
#define kScreenHeight [[UIScreen mainScreen] bounds].size.height
#define kScreenSize [[UIScreen mainScreen] bounds].size

// 系统控件默认高度
//#define kStatusBarHeight [[UIApplication sharedApplication] statusBarFrame].size.height
#define kNavBarHeight2  self.navigationController.navigationBar.frame.size.height

#define kNavStatusHeight
#define kavStatusHeight1(A,B) ({__typeof(A) __a = (A);__typeof(B) __b = (B); __a > __b ? 32 : 44; })
// 系统控件默认高度
//#define kStatusBarHeight  ((@available(iOS 11.0, *)&&(kScreenHeight>kScreenWidth)) ? 44 : 0)
#define kSafeTopMargin ({CGFloat safeTopMargin = 0;if(isIPhoneX) {if (kScreenWidth>kScreenHeight){safeTopMargin = 0;} else if (kScreenHeight>kScreenWidth) {safeTopMargin = 44;}}else {safeTopMargin = 0;}safeTopMargin;})
#define kSafeLeftRightMargin ({CGFloat safeLeftRightMargin = 0;if(isIPhoneX) {if (kScreenHeight>kScreenWidth){safeLeftRightMargin = 0;} else if (kScreenWidth>kScreenHeight) {safeLeftRightMargin = 44;}}else {safeLeftRightMargin = 0;}safeLeftRightMargin;})

#define kSafeBottomMargin ({CGFloat safeBottomMargin = 0;if(isIPhoneX) {if (kScreenHeight>kScreenWidth){safeBottomMargin = 34;} else if (kScreenWidth>kScreenHeight) {safeBottomMargin = 21;}}else {safeBottomMargin = 0;}safeBottomMargin;})

// 状态栏高度
#define STATUS_BAR_HEIGHT (iPhoneX ? 44.f : 20.f)

#define kStatusBarHeight  ((isIPhoneX&&(kScreenHeight>kScreenWidth)) ? 44 : 0)
////#define kStatusBarHeight kStatusBarHeight1(statusBarHiddenStatus)
////#define kStatusBarHeight1(A) ({__typeof(A) __a = (A); __a  ? 0 : 20; })
#define kNavBarHeight   kNavBarHeight1(kScreenWidth,kScreenHeight)
#define kNavBarHeight1(A,B) ({__typeof(A) __a = (A);__typeof(B) __b = (B); __a > __b ? 32 : 44; })
//#define isVCBasedStatusBarAppearanceNum (NSNumber *)[[NSBundle mainBundle] objectForInfoDictionaryKey:@"UIViewControllerBasedStatusBarAppearance"]
////#define statusBarHiddenStatus [isVCBasedStatusBarAppearanceNum intValue] =1  ? self.prefersStatusBarHidden : [UIApplication sharedApplication].statusBarHidden
//#define statusBarHiddenStatus ({__typeof(isVCBasedStatusBarAppearanceNum) __a = (isVCBasedStatusBarAppearanceNum);  __a ? self.prefersStatusBarHidden : [UIApplication sharedApplication].statusBarHidden; })

#define Interface_Flag              (int)[UIDevice getDeviceOrientation]  //横竖屏方向
/* 判断设备是否横屏 */
#define kIsDeviceLandscape          (Interface_Flag == 1)
/* 判断设备是否竖屏 */
#define kIsDevicePortrait           (Interface_Flag == 0)

//系统版本
#define iOS7Later ([UIDevice currentDevice].systemVersion.floatValue >= 7.0f)
#define iOS8Later ([UIDevice currentDevice].systemVersion.floatValue >= 8.0f)
#define iOS9Later ([UIDevice currentDevice].systemVersion.floatValue >= 9.0f)
#define iOS9_1Later ([UIDevice currentDevice].systemVersion.floatValue >= 9.1f)
#define iOS10Later ([UIDevice currentDevice].systemVersion.floatValue >= 10.0f)
#define iOSVersion [UIDevice currentDevice].systemVersion.floatValue

#define isIPhoneX ((kScreenWidth == 375.f && kScreenHeight == 812.f)||(kScreenWidth == 812.f && kScreenHeight == 375.f) ? YES : NO)
2017/12/29 posted in  工作总结

2017-12-28 - iPhone X 适配问题

  • 1. Safe Area
  • 2. table
  • 3. Navigation
    • Navigation 集成 UISearchController
    • UINavigationController和滚动交互
    1. UIScrollView and UITableView的新特性
    • 如果有一些文本位于UI滚动视图的内部,并包含在导航控制器中,现在一般 navigationContollers 会传入一个 contentInset 给其最顶层的viewControllerscrollView,在iOS11中进行了一个很大的改变,不再通过 scrollViewcontentInset 属性了,而是新增了一个属性: adjustedContentInset,通过下面两种图的对比,能够表示 adjustContentInset 表示的区域:

  • 新增的contentInsetAdjustmentBehavior属性用来配置adjustedContentInset的行为,该结构体有以下几种类型:

typedef NS_ENUM(NSInteger, UIScrollViewContentInsetAdjustmentBehavior) {  
    UIScrollViewContentInsetAdjustmentAutomatic, 
    UIScrollViewContentInsetAdjustmentScrollableAxes,
    UIScrollViewContentInsetAdjustmentNever,
    UIScrollViewContentInsetAdjustmentAlways,
}

@property(nonatomic) UIScrollViewContentInsetAdjustmentBehavior contentInsetAdjustmentBehavior;
@property(nonatomic, readonly) UIEdgeInsets adjustedContentInset;

//adjustedContentInset值被改变的delegate
- (void)adjustedContentInsetDidChange; 
- (void)scrollViewDidChangeAdjustedContentInset:(UIScrollView *)scrollView;
2017/12/28 posted in  工作总结

2017-12-27 - 抢玩的 BUG

抢玩遇到的 BUG

  • BUG 1

  • BUG 2

    D117E2E0D13D7949FCE2D72115F1B5B2

2017/12/27 posted in  工作总结

2017-12-26 - 遇到问题如何解决

其一

  • 在刚遇到未知的问题时,我竟然会想着逃避、放弃

    • 害怕担心时间规定内没法完成

    • 害怕因为能力不足引发的一系列反应。还不了贷款,工作问题,生活问题,等等。

    • 最后发现这都是目前不该操心的事

  • 静下心后发现,没有什么事是解决不了的

  • 接着我会想着怎么去解决这个问题

    • 例如:今天这个导入【审核包】

    • 首先,我备份一遍,直接将其拖入到项目当中,遇到【报错 - 全红】一个一个的改,浪费了一上午的时间

    • 接着,改好了【报错】后,我一测试,似乎没有反应,想想会不会是因为网络的问题,关闭网络后测试,也没反应。我就开始找问题

    • 然后,我心想会不会是没有把【根控制器】设置对,灵光一闪,有种方法似乎可行。

    • 最后,我考虑把这个【审核包】单独提取出来,独立成一个程序。让其能成功运行后,再把这个独立出来的【审核包】导入到【我玩】里,似乎也可行,就差实现。

其二

总结:

  • 在遇到问题的第一反应,不该是惊慌失措,而是第一反应该是【如何去解决这个问题】

  • 不要去想一些没有发生以及无关紧要的事情,虽然有可能这些事会发生,但目前最重要的还是解决眼前的问题

  • 冷静下,你会发现你解决的能力超强

  • 自信点,没有什么事是解决不了的

There are only two hard things in Computer Science: cache invalidation and naming things.
在计算机科学中只有两件难事:缓存失效和命名。 

                                                                     — Phil Karlton
  • 对于不是自己技术领域的人,所表达的方式也需要更简单明了,一定要准确到位
2017/12/26 posted in  生活总结

2017-12-26 - PCH 文件问题

  • 苹果不提倡 PCH 文件

  • 原因可能是因为大家把大量的头文件和宏定义放到pch里边,导致编译时间过长。

  • 苹果去掉他可能是要加快编译时间增加用户体验。

  • 虽然失去了编程的便利性,但还是不得不佩服苹果的以用户为中心的思考方式。

2017/12/26 posted in  工作总结