うちのいぬ Tech Blog

Tech Blog of Uchinoinu/My dog

2015-01-01から1年間の記事一覧

XCode 6.4 の Build (Swift source file の Compile) や Indexing あたりがすごく遅くなる原因と対応 - Dictionary編

この状況に対して、この方法をとったらなんとかなりましたという備忘録です。 別の方法や見解もあるようなのでそちらも参考にしてください。 環境 XCode 6.4 Swift 1.2 状況 TableViewを実装していて、Realmと絡めたり、SectionやらIndexやらSearchやら色々…

XCode 6.4 の Build (Swift source file の Compile) や Indexing あたりがすごく遅くなる原因と対応 - Dictionary編

この状況に対して、この方法をとったらなんとかなりましたという備忘録です。 別の方法や見解もあるようなのでそちらも参考にしてください。 環境 XCode 6.4 Swift 1.2 状況 TableViewを実装していて、Realmと絡めたり、SectionやらIndexやらSearchやら色々…

Convert NSDate to String

let date:NSDate = fooDate // 例. 2015-03-16 00:00:00 +0000 let formatter = NSDateFormatter() formatter.dateFormat = "yyyy-MM-dd" // ここでフォーマットを選択 let dateString = formatter.stringFromDate(date)

String から NSDate へ変換

let dateString = dateStringFoo // 例. "2015-03-16 00:00:00" let formatter = NSDateFormatter() formatter.dateFormat = "yyyy-MM-dd HH-mm-ss zzz" // Choose format let date = dateFormatter.dateFromString(dateString)

Custom Cell を使って TableView をいい感じに実装する - 最初の一歩

はじめに TableViewをいい感じに作りたいので、いい感じにカスタムしたいと思い、Custom Cellを扱ってみることにしました。 Swift幼稚園児の備忘録です。 手順 1. StoryboardでTableViewを設置 2. Prototype CellsにTitleとSubTitleのlabelを設置 ここで好き…

Custom Cell を使って TableView をいい感じに実装する - 最初の一歩

はじめに TableViewをいい感じに作りたいので、いい感じにカスタムしたいと思い、Custom Cellを扱ってみることにしました。 Swift幼稚園児の備忘録です。 手順 1. StoryboardでTableViewを設置 2. Prototype CellsにTitleとSubTitleのlabelを設置 ここで好き…

FacebookSDK iOS 4.4 で logout した後に loginViewControllerに戻って再度loginしても画面遷移が行われない場合

TDLR 作業メモ・備忘録なので状況がよくわからないかもしれません。 モーダルを出したらちゃんと消そうということ。 状況 Storyboardを2つ用意しています。 Login周り その他メイン用 FacebookSDK iOS 4.4を使ってログインして、メインのStoryboardに遷移 fu…

FacebookSDK iOS 4.4 で logout した後に loginViewControllerに戻って再度loginしても画面遷移が行われない場合

TDLR 作業メモ・備忘録なので状況がよくわからないかもしれません。 モーダルを出したらちゃんと消そうということ。 状況 Storyboardを2つ用意しています。 Login周り その他メイン用 FacebookSDK iOS 4.4を使ってログインして、メインのStoryboardに遷移 fu…

NavigationItemをNavigationBarの右側にコードで設定する方法

虫眼鏡アイコンを追加してみます overrided func viewDidLoad() { // show search button and set action var rightSearchBarButtonItem:UIBarButtonItem = UIBarButtonItem(barButtonSystemItem: UIBarButtonSystemItem.Search, target: self, action: "sea…

TableViewのセルの右端に">"みたいな右矢印を出したいとき (Storyboardを使って)

状況 iOS開発未熟者がTableViewにとりかかり始めました。 StoryboardでTable View Controllerを設置して、Prototype Cellsをあちゃこちゃしてます。 そこでとりあえず右矢印を出したいとなりました。 やりかた identifierを設定していればその名前になってい…

TableViewのセルの右端に > みたいな右矢印を出したいとき (Storyboardを使って)

状況 iOS開発未熟者がTableViewにとりかかり始めました。 StoryboardでTable View Controllerを設置して、Prototype Cellsをあちゃこちゃしてます。 そこでとりあえず右矢印を出したいとなりました。 やりかた identifierを設定していればその名前になってい…

NavigationItemをNavigationBarの右側にコードで設定する方法

虫眼鏡アイコンを追加してみます overrided func viewDidLoad() { // show search button and set action var rightSearchBarButtonItem:UIBarButtonItem = UIBarButtonItem(barButtonSystemItem: UIBarButtonSystemItem.Search, target: self, action: "sea…

画面サイズの変更とショートカットキーについて

Xcodeで開発して、iOSシミュレーターを使っていたらあるとき、途端に画面サイズが変更されました。 なんでだろと思ったら、不意に触りかねない...かもしれない...ショートカットキーがふられていました。 これ↓ 気をつければ済みそうなので、特にいじろうと…

Storyboardを使わずに画面遷移をすると、遷移先が黒画面になるときやstoryboard doesn't contain a view controller with identifier 'って言われるとき。

iOSアプリで画面遷移を行う方法はたくさんあります。storyboardでやったり、コードでやったり。 // set next VC let nextVC: UIViewController = FooVC() // set animation nextVC.modalTransitionStyle = UIModalTransitionStyle.PartialCurl // transition…

Storyboardを使わずに画面遷移をすると、遷移先が黒画面になるときやstoryboard does not contain a view controller with identifierって言われるとき。

iOSアプリで画面遷移を行う方法はたくさんあります。storyboardでやったり、コードでやったり。 // set next VC let nextVC: UIViewController = FooVC() // set animation nextVC.modalTransitionStyle = UIModalTransitionStyle.PartialCurl // transition…

画面サイズの変更とショートカットキーについて

Xcodeで開発して、iOSシミュレーターを使っていたらあるとき、途端に画面サイズが変更されました。 なんでだろと思ったら、不意に触りかねない...かもしれない...ショートカットキーがふられていました。 これ↓ 気をつければ済みそうなので、特にいじろうと…

difference between namespace and scope at config/routes.rb

memo namespace namespace :api do get '/test' => 'tests#index' end => GET /api/test(.:format) api/tests#index scope scope :api do get '/test' => 'tests#index' end => GET /api/test(.:format) tests#index

difference between namespace and scope at config/routes.rb

memo namespace namespace :api do get '/test' => 'tests#index' end => GET /api/test(.:format) api/tests#index scope scope :api do get '/test' => 'tests#index' end => GET /api/test(.:format) tests#index

422 error at creating User record in User Model using Devise

症状 RailsでJSON API用のバックエンド(管理画面はactive adminを利用し、そこだけはhtmlを利用)を作っています。 認証周りにDeviseを利用しました。 Routingは↓な感じで。 # config/routes.rb namespace :api, format: 'json' do namespace :v1 do devise…

401 when access to /admin with JSON-API backend by Rails

症状 何事も無ければ、active_adminを使っている場合、/adminにアクセスしたら、以下の様な画面が見れるはずです。 しかし、今回こんな感じになりました。 Started GET "/admin" for ::1 at 2015-05-12 18:06:23 +0900 Processing by Admin::DashboardContro…

401 when access to /admin with JSON-API backend by Rails

症状 何事も無ければ、active_adminを使っている場合、/adminにアクセスしたら、以下の様な画面が見れるはずです。 しかし、今回こんな感じになりました。 Started GET "/admin" for ::1 at 2015-05-12 18:06:23 +0900 Processing by Admin::DashboardContro…

422 error at creating User record in User Model using Devise

症状 RailsでJSON API用のバックエンド(管理画面はactive adminを利用し、そこだけはhtmlを利用)を作っています。 認証周りにDeviseを利用しました。 Routingは↓な感じで。 # config/routes.rb namespace :api, format: 'json' do namespace :v1 do devise…

Line Developer Day 2015 に行ってきたよ (OvO)

Lineの裏側を知るカンファレンスに行ってきました!簡単なメモというか、感想をつらつらと残します。抽選だったので行けるかわからなかったですが、開催数日前に当選通知が来て、慌てて航空券をとりました!渋谷ならヒカリエで行われたのですが、入り口から…

Line Developer Day 2015 に行ってきたよ (OvO)

Lineの裏側を知るカンファレンスに行ってきました! 簡単なメモというか、感想をつらつらと残します。 抽選だったので行けるかわからなかったですが、開催数日前に当選通知が来て、慌てて航空券をとりました! 渋谷ならヒカリエで行われたのですが、入り口か…

Crafting Rails 4 Applications - capter 2. Building Models with Active Model

こちらの記事の続きです。 Crafting Rails 4 Applications - capter 1-5 - Wrapping Up - SatomisaTo - life with Tech and Dogtsumekoara.hateblo.jp 第二章 ActiveModelでモデルを構築する 前章では、AbstractControllerについてと、ActionMailerやActionC…

Crafting Rails 4 Applications - capter 2. Building Models with Active Model

こちらの記事の続きです。 Crafting Rails 4 Applications - capter 1-5 - Wrapping Up - SatomisaTo - life with Tech and Dogtsumekoara.hateblo.jp 第二章 ActiveModelでモデルを構築する 前章では、AbstractControllerについてと、ActionMailerやActionC…

Introduction: PART 1: Generate Project using template. Watch app at localhost, iOS simulator, heroku

Condition Yosemite Install read: http://ionicframework.com/getting-started/ $ npm install -g cordova ionic Select Project Template read: http://ionicframework.com/getting-started/ $ ionic start myApp sidemenu run ionic command localhost $ …

Crafting Rails 4 Applications - capter 1-5 - Wrapping Up

こちらの記事の続きです。 Crafting Rails 4 Applications - capter 1-4 - Talking It to the Next Level - Satomi's Daily Notestsumekoara.hateblo.jp 1.5 まとめ この章ではPDFフォーマット用のrendererを作りました。このアイデアを使えば、csvやatomと…

Crafting Rails 4 Applications - capter 1-4 - Talking It to the Next Level

こちらの記事の続きです。 Crafting Rails 4 Applications - capter 1-3 - Understanding the Rails Rendering Stack - Satomi's Daily Notestsumekoara.hateblo.jp 1.4 次のレベルへ rendererの実装に話を戻します。以下の様なcontrollerでないが起きるか勉…

Crafting Rails 4 Applications - capter 1-3 - Understanding the Rails Rendering Stack

こちらの続きです。 Crafting Rails 4 Applications - capter 1-2 - Writing the Renderer - Satomi's Daily Notestsumekoara.hateblo.jp 1-3. Rails Rendering Stackを理解する Action MailerとAction Controller はいくつかの共通機能を持っています。例え…