William的个人博客
William的个人博客

iOS Developer.


  • 首页

  • 分类

  • 关于

  • 归档

  • 标签

  • 公益404

使用instancetype取代id的好处

发表于 2016-04-26   |   分类于 技术总结   |  

Would it be beneficial to begin using instancetype instead of id?

There definitely is a benefit. When you use ‘id’, you get essentially no type checking at all. With instancetype, the compiler and IDE know what type of thing is being returned, and can check your code better and autocomplete better.

Here’s what Apple now says on the subject:

In your code, replace occurrences of id as a return value with instancetype where appropriate. This is typically the case for init methods and class factory methods. Even though the compiler automatically converts methods that begin with “alloc,” “init,” or “new” and have a return type of id to return instancetype, it doesn’t convert other methods. Objective-C convention is to write instancetype explicitly for all methods.

Emphasis mine. Source: Adopting Modern Objective-C

With that out of the way, let’s move on and explain why it’s a good idea.

阅读全文 »

GET与POST请求之区别

发表于 2016-04-06   |   分类于 技术总结   |  

不再以讹传讹,GET和POST的真正区别

浅谈HTTP中Get与Post的区别

上面的两个参考文档是同行朋友在问完我GET与POST区别之后发给我的,看完之后一头雾水,原本以为很简单的问题,一下子有点丈二和尚摸不着头脑了。于是乎我就开始查找资料,发现了一个很好的国外网站,专门做对比,名叫 Diffen。
再输入GET和POST之后,答案就出来了,下面我就简单翻译一下。

阅读全文 »

扩展UIAlertView时otherButtonTitles传参问题解决

发表于 2016-03-29   |   分类于 技术总结   |  

img

实现原理

阅读全文 »

Mars首页View视图切换动画效果

发表于 2016-01-29   |   分类于 个人项目   |  

项目名称:WWViewSwitcher

项目地址:https://github.com/WilliamZhangWH/WWViewSwitcher

效果展示

image

阅读全文 »

深度模仿谷歌翻译滑动删除动画效果

发表于 2016-01-27   |   分类于 个人项目   |  

项目名称:WWRemoveAnimation

项目地址:https://github.com/WilliamZhangWH/WWRemoveAnimation

效果展示

image

阅读全文 »

谷歌翻译TabBar点击效果动画复刻

发表于 2016-01-25   |   分类于 个人项目   |  

项目名称:WWAnimationTabbar

项目地址:https://github.com/WilliamZhangWH/WWAnimationTabbar

效果展示

image

阅读全文 »

用hexo搭建个人博客时遇到的坑

发表于 2016-01-23   |   分类于 技术总结   |  
首先,我想说版本很重要,下面我说一下我安装的版本信息:
  • Homebrew 0.9.5
  • node.js v5.5.0
  • npm 3.5.3
  • hexo 3.1.1
使用Homebrew来安装node.js我个人觉得应该是最方便的方法
阅读全文 »
William Zhang

William Zhang

有完美主义的强迫症患者。

7 日志
2 分类
4 标签
RSS
Github Weibo Email

友情链接

煜寒了
© 2016 William Zhang
由 Hexo 强力驱动
主题 - NexT.Muse


本站总访问量     您是第个来到的小伙伴