原文:Elastic view animation, or how I built DGElasticPullToRefresh 原作者 @gontovnik
DGElasticPullToRefresh 展示了如何实现一个弹性效果。效果如下图所示:
开发环境: Xcode 7 Swift 2.0
Objective-C中的分类(category)是一种编译时的手段,其允许我们通过给某个已知类添加方法来扩充该类的一种方式。当然这其中是有限制的,就是不能给已知类添加新的实例变量。
Objective-C 运行时对于刚刚踏入 Cocoa/Objective 世界的人是很容易忽 略的 Objective-C 语言的特性之一。原因就是尽管 Objective-C 是一门几个小时之内入门的语言,但是投身 Cocoa 的新手们会花费大量时间在 Cocoa 框架中,试图搞清楚他到底是怎么工作的。 我觉得每个开发者都应该对其有深入的了解,明白一些内部的实现细节,而不仅仅只知道代码 [target doMethodWith:var] 会被编译器转换成 objc_msgSend(target,@selector(doMethodWith:),var1); 而已。了解 Objective-C 运行时的原理有助于你对 Objective-C 语言有更深入的理解,清楚你得 App 是怎么运行的。我觉得这对无论是 Mac/iPhone 新手或者老手都会有所帮助。
原文:How We Created Guillotine Menu Animation for iOS 原作者 @johnsundell
你是否曾经有过这样的疑问?为什么app中几乎是清一色的侧边栏(sidebar),为什么不把它做成topBar或者bottomBar,甚至cornerBar呢?
题目:28. Implement strStr() # Implement strStr().
题目:257. Binary Tree Paths # Given a binary tree, return all root-to-leaf paths. For example, given the following binary tree: 1 / 2 3 5 All root-to-leaf paths are: [“1->2->5”, “1->3”]
题目: # Given a string s consists of upper/lower-case alphabets and empty space characters ’ ‘, return the length of last word in the string. If the last word does not exist, return 0. Note: A word is defined as a character sequence consists of non-space characters only. For example, Given s = “Hello World”, return 5.
最近几天被iOS的推送部署给搞懵了,现在特地整理下和大家进行分享。
iOS远端推送机制 # APNS,全称为Apple Push Notification service,是苹果通知推送服务中最重要的一环。它是苹果通知推送服务器,为所有iOS设备以及OS X设备提供强大并且可靠的推送通知服务。每个注册通知服务的设备都会和该服务器进行长连接,从而实时获取推送通知。即使当前APP不在运行状态,当通知到达的时候也会有提示发生,最常见的就是短信服务。
关于有环单链表,即单链表中存在环路,该问题衍生出很多面试题,特在此汇总,方便查阅也帮助自己梳理下思路。
题目:Reverse Words in a String # Given an input string s, reverse the string word by word. For example, given s = “the sky is blue”, return “blue is sky the”.