原创 NSCondition
@UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? var pr
原创 iOS 截屏系統通知
class func startMonitorScreenshot() { NSNotificationCenter.defaultCenter().addObserver(self.shared,
原创 Swift 柯里化(currying)和反柯里化(uncurrying)
// Demo of currying func addTwoNums(a: Int)(num: Int) -> Int { return a + num } let addToFour = addTwo
原创 iOS解檔歸檔
NSArray *array = [NSArray arrayWithObjects:@"one", @"two", @"three", nil]; NSString *filePath = [NSHomeDirecto
原创 iOS 打印動態庫加載過程
import UIKit import MachO @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate { var w
原创 Swift開源
Swift於2015年12月4號開源,欣喜之情難以表達,無奈編譯器這種東西感興趣還是小衆,也沒人能分享我的喜悅,故在此記錄一筆,該語言的優秀性只有懂的人才懂。開源地址 https://github.com/apple和https://sw
原创 監測iOS截屏(Swift)
// // ScreenshotManager.swift // ImagePicker // // Created by 成傑 on 15/11/17. // Copyright © 2015年 成傑. All ri
原创 Swift的Debug和Release宏
step a: 在Swift Compiler - Custom Flags的Other Swift Flags的Debug裏添加-DDEBUG 在Release裏添加-DRELEASE step b: 在代碼裏這麼使用
原创 iOS後臺運行
Apple的原版見https://developer.apple.com/library/ios/documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/iPhoneAppProg
原创 AutoLayout Swift demo
import UIKit import Swift class ViewController: UIViewController { override func viewDidLoad() { sup
原创 AVAudioPlayer音頻播放
// ViewController.h @property (nonatomic) AVAudioPlayer *player; @property (weak, nonatomic) IBOutlet UIButton
原创 ios獲取網絡圖片
// ViewController.m - (void)viewDidLoad { [super viewDidLoad]; NSURL * url = [NSURL URLWithString:@"http://
原创 iOS動畫
//動畫 CATransition *transition = [CATransition animation]; transition.duration = 6.0; transition.type
原创 ios解檔歸檔2
NSArray *array = [NSArray arrayWithObjects:@"one", @"two", @"three", nil]; NSString *filePath = [NSHomeDirecto