うちのいぬ Tech Blog

Tech Blog of Uchinoinu/My dog

2016-08-01から1ヶ月間の記事一覧

How to execute some methods at regular intervals like clock

Call NSTimer.scheduledTimerWithTimeInterval( 1, // second target: self, selector: #selector(ThisClass.methodName), userInfo: nil, repeats: true ) Execute func methodName() { print("pikachu!") } In UIViewController override func viewDidLoad…

時計の様に、ある関数を定期的に実行する様な仕組み

呼び出し方 NSTimer.scheduledTimerWithTimeInterval( 1, // 単位は秒で間隔を指定 target: self, selector: #selector(ThisClass.methodName), userInfo: nil, repeats: true ) 実行 func methodName() { print("pikachu!") } UIViewControllerでやるなら o…

Get weekday String from NSDate by Swift

Easy way class func weekdayFromNSDate(date: NSDate) -> String { let cal = NSCalendar.currentCalendar() let comp = cal.components(NSCalendarUnit.Weekday, fromDate: date) let weekdayIndex = comp.weekday let formatter: NSDateFormatter = NSDat…

SwiftでNSDateから曜日を求める方法

割りと楽なやり方 class func weekdayFromNSDate(date: NSDate) -> String { let cal = NSCalendar.currentCalendar() let comp = cal.components(NSCalendarUnit.Weekday, fromDate: date) let weekdayIndex = comp.weekday let formatter: NSDateFormatter…

Morning Study Time Again!

This is 4th morning study time of Swift! Morning Study, which is "Asakatsu" in Japanese, is my favorite style of studying. But these days I had not able to have enough time to it. This time, relaxing and studying is my most important conce…

朝活みたいな感じで、Swiftをもくもく勉強するのを再開してみた!

実は第4回目になります。 朝活は暫く出来ていなかったので、ちゃんと、ゆる〜くやろうと思います。 以前はスタバでやっていてとっても快適だったのですが、今は自宅で。 今回は↓な感じでログを残しながら進めていきます。 ログ ディレクトリ構成は帰るかも …