2017年5月12日
摘要: LeetCode 9 Palindrome Number Question Determine whether an integer is a palindrome. Do this without extra space. Some hints: Could negative integers b 阅读全文
posted @ 2017-05-12 18:55 Silence_cnblogs 阅读(190) 评论(0) 推荐(0) 编辑
摘要: LeetCode 7 Reverse Integer Question Reverse digits of an integer. Example1: x = 123, return 321 Example2: x = 123, return 321 Have you thought about t 阅读全文
posted @ 2017-05-12 15:18 Silence_cnblogs 阅读(374) 评论(0) 推荐(0) 编辑
  2017年5月9日
摘要: LeetCode 1 Two Sum Question Given an array of integers, return indices of the two numbers such that they add up to a specific target. You may assume t 阅读全文
posted @ 2017-05-09 20:54 Silence_cnblogs 阅读(286) 评论(0) 推荐(0) 编辑
  2017年5月8日
摘要: iOS 使用 UIMenuController 且不隐藏键盘的方法 在键盘显示的时候使用 UIMenuController 弹出菜单,保持键盘显示且可输入的状态。 实现方法有 1. 修改响应链(推荐) 2. 遵循 UIKeyInput 协议 3. 自定义 Menu controller 前两种方法的 阅读全文
posted @ 2017-05-08 18:03 Silence_cnblogs 阅读(3922) 评论(0) 推荐(1) 编辑
  2017年5月6日
摘要: iOS 真机测试错误“The application bundle does not contain a valid identifier” 真机测试的时候报错:“The application bundle does not contain a valid identifier”。在这里找到解决方 阅读全文
posted @ 2017-05-06 15:33 Silence_cnblogs 阅读(3279) 评论(0) 推荐(0) 编辑
  2017年4月27日
摘要: Swift、Objective C 单例模式 (Singleton) 本文的单例模式分为 严格单例模式 和 不严格单例模式 。单例模式要求一个类有一个实例,有公开接口可以访问这个实例。严格单例模式,要求一个类只有一个实例;不严格单例模式,可以创建多个实例。 有的类只能有一个实例,例如 UIAppli 阅读全文
posted @ 2017-04-27 20:02 Silence_cnblogs 阅读(5547) 评论(0) 推荐(0) 编辑
  2017年4月25日
摘要: iOS 相册和网络图片的存取 保存 UIImage 到相册 UIKit UIKit 中一个古老的方法,Objective C 的形式 保存完成后,会调用 completionTarget 的 completionSelector。如果 completionTarget 不为空,completionT 阅读全文
posted @ 2017-04-25 20:03 Silence_cnblogs 阅读(5089) 评论(0) 推荐(0) 编辑
  2017年4月10日
摘要: iOS 字符串 MD5 Objective C 实现 需要引入头文件 这里用方法实现 给 String 添加属性,获取 MD5 值 swift extension String { var md5: String { let str = cString(using: .utf8) let strLe 阅读全文
posted @ 2017-04-10 13:50 Silence_cnblogs 阅读(4023) 评论(0) 推荐(0) 编辑
  2017年4月8日
摘要: 支持 GIF 的图片组件 "BBWebImage" SDWebImage 加载显示 GIF 与性能问题 SDWebImage 4.0 之前,可以用 UIImageView 显示 GIF 图。如果 SDWebImage 4.0 还这么做,只会显示静态图。SDWebImage 4.0 用 FLAnima 阅读全文
posted @ 2017-04-08 20:27 Silence_cnblogs 阅读(18971) 评论(0) 推荐(0) 编辑
摘要: iOS 检测文本中的 URL、电话号码等信息 要检测文本中的 URL、电话号码等,除了用正则表达式,还可以用 NSDataDetector。 1. 用 NSTextCheckingResult.CheckingType 初始化 NSDataDetector 2. 调用 NSDataDetector 阅读全文
posted @ 2017-04-08 17:43 Silence_cnblogs 阅读(2755) 评论(0) 推荐(0) 编辑