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…
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…
割りと楽なやり方 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…
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…
実は第4回目になります。 朝活は暫く出来ていなかったので、ちゃんと、ゆる〜くやろうと思います。 以前はスタバでやっていてとっても快適だったのですが、今は自宅で。 今回は↓な感じでログを残しながら進めていきます。 ログ ディレクトリ構成は帰るかも …
Situation Using Wercker for Building and Deploying Rails 4.x application. The Wercker version is Docker. In the build step, Bundler failing with index file .idx too small error error above is occurred so many times. and in the end, Retry e…
状況 普段Rails4系のアプリでWerckerをCIとして使っています。 WerckerはDocker版を使用しています。 そのBuild Stepで Bundler failing with index file .idx too small error といったエラーがたくさんでて、結果的に Retry exceeds max retries といった…
Diff of changed files $ git diff --stat commit-new commit-old $ git diff --stat --name-only commit-new commit-old $ git diff --stat --ignore-blank-lines commit-new commit-old Diff of content of file $ git diff commit-old commit-new -- path…
変更したfileの抽出 $ git diff --stat commit-new commit-old $ git diff --stat --name-only commit-new commit-old $ git diff --stat --ignore-blank-lines commit-new commit-old fileの変更差分 $ git diff commit-old commit-new -- path/to/file 差…
Japanese Here uchinoinu.hatenablog.jp Guideline github.com github.com Platform developer.yahoo.co.jp RESTful Web サービスの基本 Articles qiita.com www.toptal.com 10 Best Practices for Better RESTful API | Thinking Mobile Presentation www.i…
Japanese here uchinoinu.hatenablog.jp Guideline github.com github.com Platform developer.yahoo.co.jp RESTful Web サービスの基本 Articles qiita.com www.toptal.com 10 Best Practices for Better RESTful API | Thinking Mobile Presentation www.i…
Japanese here uchinoinu.hatenablog.jp func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { let tabBar = self.window!.rootViewController as! UITabBarController tabBar.se…
English here uchinoinu.hatenablog.jp func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { let tabBar = self.window!.rootViewController as! UITabBarController tabBar.sel…
Japanese here uchinoinu.hatenablog.jp Situation Rails 4.2 Ruby 2.3 Spring 1.3.5 direnv 2.8.1 Manage environment variables by direnv run rails command using Spring Problem Adding new environment variables, rails c cannot load any environmen…
English here uchinoinu.hatenablog.jp 状況 Rails 4.2 Ruby 2.3 Spring 1.3.5 direnv 2.8.1 direnvで環境変数を管理している Springを使ってrailsコマンドを動かしている 問題 環境変数を追加したら、rails sは通るけど、rails cでは環境変数を読み込めなく…
Japanese here. uchinoinu.hatenablog.jp sass: img width: 100% Write like above, <style type="text/css"> img { width: 100%; } </style> Output html like above. Reference マークアッパー的 Slim 入門21の手引き | e2esound.com業務日誌
English here uchinoinu.hatenablog.jp 簡単でした sass: img width: 100% と書くと <style type="text/css"> img { width: 100%; } </style> と出力されます。 Reference マークアッパー的 Slim 入門21の手引き | e2esound.com業務日誌
Japanese here uchinoinu.hatenablog.jp Standard Way Set title property in NavigationItem of NavigationController self.navigationItem.title = "title" Popular Failure self.navigationController.title = "title" Rapid Way Set title property of U…
English Here. uchinoinu.hatenablog.jp ちゃんとした方法 NavigationControllerのNavigationItemのtitleプロパティに設定する self.navigationItem.title = "title" よくある間違い self.navigationController.title = "title" 手っ取り早い方法 selfがUIVi…
Japanese version is here uchinoinu.hatenablog.jp Env Xcode 8.0 bata Swift 3 Situation Make UI using Storyboard Using IBOutlet Transition by Code Problem 遷移先でIBOutletさんがnilになります Reason I did wrong way to call ViewController to t…
English is here. uchinoinu.hatenablog.jp 環境 Xcode 8.0 bata Swift 3 状況 StoryboardでUIをつくちゃっている IBOutletを使っている せめて遷移にはSegueではなくコードを使う 問題点 遷移先でIBOutletさんがnilになります 原因 Segueを使わないので、遷…
Japanese version is here uchinoinu.hatenablog.jp Env Xcode 8.0 bata Swift 3 Principle to develop Make UI using Storyboard Using IBOutlet Transition by Code Problem 遷移先でIBOutletさんがnilになります Reason I did wrong way to call ViewCont…
状況 環境 Xcode 8.0 bata Swift 3 方針 StoryboardでUIをつくちゃっている IBOutletを使っている せめて遷移にはSegueではなくコードを使う 問題点 遷移先でIBOutletさんがnilになります 原因 Segueを使わないので、遷移にはコードを使っていました。 遷移…
Japanese is here uchinoinu.hatenablog.jp I watched this view often. Now make the manual to localiztion Flow This time, I made localization env like below. - Base is English - add Japanese. 1. Generate Localizable.strings 2. Set up show fil…
English is here uchinoinu.hatenablog.jp Webアプリではやったことあっても、iOSではなかったのですが、 ↓はよく目にしていました。 ちゃんと手順をおってみます。 手順 1. Localizable.stringsを作成 2. Localizeの設定 出来たファイルをinspector表示しま…
Related to uchinoinu.hatenablog.jp Warning “file xxx is missing from working copy” at project building How This time, warning against to deleted file. Maybe cache of git is problem. $ git rm -r --cached .
↓と関連してます uchinoinu.hatenablog.jp Warning(警告) “file xxx is missing from working copy” at project building 対応 実際に存在しないファイルについてこういう警告がでたときは、Gitのcacheを消したらうまくいきました。 $ git rm -r --cached .
Warning The Copy Bundle Resources build phase contains this target's Info.plist file 'Info.plist'. Dealing Remove Info.plist from Copy Bundle Resources in Build Phase Reference Technical Q&A QA1649: WARNING: The Copy Bundle Resources build…
概要 2016年も半年が過ぎて、早7/3。 本当は毎日、毎週、毎月ちゃんと振り返りたかったけど、 まずは今日から始めたいと思います。 簡単なまとめ 心の成長?復活?が出来ました 好きなことを思い出して、またやれるようになった 自分の性質について少し理解で…