UILabel - 显示换行的方法
变更记录
序号
录入时间
录入人
备注
1
2015-03-31
Alfred Jiang
-
2
2015-12-23
Alfred Jiang
-
方案名称UILabel - 显示换行的方法
关键字UILabel \ 换行
需求场景
需要对 UILable 中字符串进行换行显示时
参考链接
CocoaChina - UILabel显示换行的方法
详细内容12345678UILabel*label;//设置换行label.lineBreakMode = UILineBreakModeWordWrap;label.numberOfLines = 0;//换行符还是\n比如NSString * xstring=@"lineone\nlinetwo"
效果图(无)
备注(无)
UDID - 解决方案介绍与比较
变更记录
序号
录入时间
录入人
备注
1
2015-03-31
Alfred Jiang
-
2
2015-12-23
Alfred Jiang
-
方案名称UDID - 解决方案介绍与比较
关键字UDID \ UUID \ 设备唯一标识符
需求场景
需要设备唯一标识符的场景
参考链接
CSDN - IOS7开发~UDID解决方法
现有IOS设备唯一标示符的方案比较
详细内容#####1. UDID
1[[UIDevice currentDevice] uniqueIdentfier]
iOS 官方最早提供的 UDID 方案,根据某一公式,使用设备序列号、网卡地址等信息作为参数计算而来, iOS6 之后该计算公式发生了改变。
该方法返回的结果在所有应用中都相同,并且卸载应用、刷机、还原设备均不会发生改变,是最为准确的设备唯一标示符。
iOS5 之后,该方法被标记为废弃!最终,在 2013 年 5 月 1 号之后, AppStore 禁止任何使用该方法的应用上架。
iOS7 中对外公开的 API 中已经移除了该方法!
#####2. 网卡地址
通过 Unix 级 ...
UINavigationBar - 自定义按钮和标题
变更记录
序号
录入时间
录入人
备注
1
2015-03-23
Alfred Jiang
-
2
2015-03-31
Alfred Jiang
更新注意问题1
3
2015-12-23
Alfred Jiang
-
方案名称UINavigationBar - 自定义按钮和标题
关键字UINavigationBar \ navigationItem \ titleView
需求场景
需要自定义 UINavigationBar 的按钮和标题等
参考链接
博客园 - 学习笔记:UINavigationbar的背景修改方法集合
CSDN - 自定义UINavigationBar的属性
详细内容Swift 版本#####1. 通过 xib 文件自定义 navigationItem 的 titleView
实例化自定义对象
1var menuTitle : REXMenuBtnView = REXMenuBtnView.loadFromNibNamed("REXMenuBtnView", bundle: nil) as REXMenuBtnVie ...
UITableView \ UIScrollView - 通过 contentInset 属性设置周边间距
变更记录
序号
录入时间
录入人
备注
1
2015-03-24
Alfred Jiang
-
2
2015-12-23
Alfred Jiang
-
方案名称UITableView \ UIScrollView - 通过 contentInset 属性设置周边间距
关键字UITableView \ UIScrollView \ contentInset \ 边距 \ 间距
需求场景
UITableView 中第一个 cell 和最后一个 cell 距离顶部和底部距离差异
参考链接
CocoaChina - tableView的第一个cell到背景顶部的距离
详细内容设置方法如下
1self.tableView.contentInset = UIEdgeInsets(top: 8, left: 0, bottom: 8, right: 0)
未设置效果
设置后效果
效果图(无)
备注(无)
时间 - 倒计时器的实现
变更记录
序号
录入时间
录入人
备注
1
2015-03-25
Alfred Jiang
-
2
2015-12-23
Alfred Jiang
-
2
2016-01-10
Alfred Jiang
更新 TTGCDTimerWrapper 实现方式
方案名称时间 - 倒计时器的实现
关键字时间 \ 倒计时 \ 计时器 \ 延时执行
需求场景
倒计时
延时执行
参考链接
GitHub - TTGCDTimerWrapper
详细内容#####1. 方法定义(注:对 TTGCDTimerWrapper 源代码做了少许修改)
TTGCDTimerWrapper.h
12345678910111213141516#import <Foundation/Foundation.h>@interface TTGCDTimerWrapper : NSObject//Either a dispatch queue is provided or a default dispatch queue//will be used. (dispatch_get_globa ...
NSArray - 对自定义对象的数组进行排序
变更记录
序号
录入时间
录入人
备注
1
2015-03-25
Alfred Jiang
-
2
2015-12-23
Alfred Jiang
-
方案名称NSArray - 对自定义对象的数组进行排序
关键字NSArray \ 自定义对象数组 \ 数组排序 \ 排序
需求场景
需要对自定义对象的数组进行排序时
参考链接
GitHub - Cocoa Extensions in Swift
CSDN - NSString的常用用法
详细内容#####1. Swift 使用示例
示例一
1234567891011self.allList.sortUsingComparator( { (s1:AnyObject!,s2:AnyObject!)->NSComparisonResult in var obj1=s1 as CareerCheck var obj2=s2 as CareerCheck if obj ...
UIButton - 避免多次重复点击
变更记录
序号
录入时间
录入人
备注
1
2015-03-01
Alfred Jiang
-
2
2015-12-23
Alfred Jiang
-
方案名称UIButton - 避免多次重复点击
关键字UIButton \ 多次重复点击 \ 延时操作
需求场景
避免短时间内多次重复点击按钮造成的响应错误
参考链接(无)
详细内容
Swift 解决方案
123456789101112131415161718192021222324252627//// UIButtonExtension.swift// GrandJustice//// Created by Alfred Jiang on 1/29/15.// Copyright (c) 2015 FYH. All rights reserved.//import Foundationextension UIButton{ func antiMultiplyTouch(delay : NSTimeInterval, closure:()->()) { ...
语法 - 开发常用宏定义
变更记录
序号
录入时间
录入人
备注
1
2015-03-26
Alfred Jiang
-
2
2015-12-23
Alfred Jiang
-
3
2016-11-16
Alfred Jiang
-
方案名称语法 - 开发常用宏定义
关键字语法 \ 宏定义 \ 工具类
需求场景
简化代码,提高统一,避免出错
参考链接
掘金 - iOS 日常工作之常用宏定义大全
详细内容#####1. Objective-C 版本
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271 ...
语法 - ID类字段生成实现
变更记录
序号
录入时间
录入人
备注
1
2015-03-26
Alfred Jiang
-
2
2015-12-23
Alfred Jiang
-
方案名称语法 - ID类字段生成实现
关键字语法 \ 唯一ID \ ID \ 不重复ID
需求场景
需要生成不重复的ID类字段时
参考链接(无)
详细内容12345+ (NSString *)randomId{ NSString *strId = [[NSString stringWithFormat:@"%f",[[NSDate date] timeIntervalSince1970]] stringByReplacingOccurrencesOfString:@"." withString:@""]; return [strId stringByAppendingString:[NSString stringWithFormat:@"%u",arc4random_uniform(10000)]];}
...
特殊控件 - 钟表效果实现
变更记录
序号
录入时间
录入人
备注
1
2015-03-26
Alfred Jiang
-
2
2015-12-23
Alfred Jiang
-
方案名称特殊控件 - 钟表效果实现
关键字特殊控件 \ 时间 \ 表盘 \ 钟面 \ 时钟
需求场景
需要时钟效果的页面
参考链接
Code4app - Clock View
GitHub - BEMAnalogClock
GitHub - EZClockView
详细内容#####1. Swift 版本 EZClockView
静态表盘,需要使用类似倒计时器来不断刷新赋值
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101 ...