from 10.91
2
3if ([[NSProcessInfo processInfo] respondsToSelector:@selector(beginActivityWithOptions:reason:)]) {
[[NSProcessInfo processInfo] beginActivityWithOptions:0x00FFFFFF reason:@"receiving OSC messages"];
}
ios appstore 下载链接 评价链接
1 | //http://itunes.apple.com/us/app/idxxxxxxx |
1 | //跳转到评价页面 |
Core Graphics
画圆
1 | var path = UIBezierPath(ovalInRect: rect) |
创建path
1 | var plusPath = UIBezierPath() |
创建扇形
1 | //2 - draw the outer arc |
角度
顺时针 3点钟是0°角
ios UITextField
1 |
|
UITextfield placeholder color
1 | - (void) drawPlaceholderInRect:(CGRect)rect { |
fieldeditor
TextField 焦点从f0->f1 切换1
2
3
4
5FieldEditor1 resignFirstResponder
FieldEditor1 resignFirstResponder
TextField-f1 becomeFirstResponder
TextField-f1 resignFirstResponder
FieldEditor1 becomeFirstResponder
AXIsProcessTrustedWithOptions
1 | NSDictionary *options = @{(id)kAXTrustedCheckOptionPrompt: @YES}; |
1 | let options:[NSString:NSNumber] = |
NSAlert
1 | NSAlert *alert = [[NSAlert alloc] init]; |
ios lifecycle event
1.启动
application:didFinishLaunchingWithOptions
applicationDidBecomeActive
2.Home键退出/锁屏键退出/电话进来
applicationWillResignActive
applicationDidEnterBackground
3.后台启动
applicationWillEnterForeground
applicationDidBecomeActive
4.前台接收到通知
application:didReceiveLocalNotification 0
(UIApplicationStateActive)
5.前台接收到通知(不会触发回调事件)
此时在notification bar 不会看到记录
5.1点击(通知)
applicationWillEnterForeground
application:didReceiveLocalNotification 1
(UIApplicationStateInactive)
applicationDidBecomeActive
5.2未启动的时候点击通知
application:didFinishLaunchingWithOptions
(UIApplicationLaunchOptionsLocalNotificationKey)
applicationDidBecomeActive
6.前台状态下 下拉通知界面
applicationWillResignActive
Get image type from NSData
1 | + (NSString *)contentTypeForImageData:(NSData *)data { |