You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert
「そんなん簡単やろ」と思いますよね。 たとえば、「UITextField 文字数制限」でググれば山のようにブログ記事やらコードが出てくるし、Stack Overflow に載ってるコードのコピペ一発で解決しそうに思えませんか? 実は文字数制限をつけたテキストフィールドはそんなに簡単な話ではないのです。 shouldChangeCharactersInRange:replacementString: は使えない子 今回はこれに尽きます。 UITextField や UITextView のデリゲートで呼ばれる textField:shouldChangeCharactersInRange:replacementString: やtextView:shouldChangeCharactersInRange:replacementString: は使ってはいけません。 より正確に言うと、使うとき
さきほどWWDCにて新言語 Swiftが発表されました。 The Swift Programming Language (iBooks Store) で言語ガイドが公開されていたのでザッと目を通してみました。 Objecitve-Cと比較してSwiftがイケてそうなところをパッと気になったところだけ書いていってみます。 変数/定数の型推論がある Objective-Cのように明示的に型を書かなくても型を推論してくれます。 推論で問題ないケースも多いと思うのでタイプ数がかなり減らせそうですね。 ( 変数を宣言する際はvar、定数を宣言する際はletで宣言します。 ) // 型推論 var name = "Shinji Ikari" // 変数の型は推論によりString型になる var age = 14 // 変数の型は推論によりInteger型になる let height = 141.5
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く