Wiki(ウィキ)内検索結果
タグ検索で基本技法は7件見つかりました。
グローバル変数
AppDelegate.swift =|BOX| UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? var name : Int = 0;//この変数を他クラスからアクセスする ||= Test.swift //グローバル変数アクセス =|BOX| var app:AppDelegate = (UIApplication.sharedApplication…
https://seesaawiki.jp/xcode/d/%a5%b0%a5%ed%a1%bc%a... - 2014年09月15日更新
アラートの表示
=|BOX| var alert = UIAlertView(); alert.title = "タイトル"; alert.message = "メッセージ"; alert.addButtonWithTitle("OK"); alert.show(); ||= alert.addButtonWithTitle("OK"); これが無いと、消えないアラートとなりますので注意が必要 エラー文サンプル =|BOX| var alert = UIAlertView(); alert.title = "Err…
https://seesaawiki.jp/xcode/d/%a5%a2%a5%e9%a1%bc%a... - 2014年09月06日更新
特定の文字が含まれているか
=|BOX| var range : NSString = "ABCDE"; if(range.rangeOfString("CDE").location != NSNotFound){ //含まれる }else{ //含まれていない } ||=…
https://seesaawiki.jp/xcode/d/%c6%c3%c4%ea%a4%ce%c... - 2014年09月03日更新
オブジェクトの非表示
LabelやButtonなどの非表示、表示のやり方 =|BOX| myLabel.hidden = true; ||= 非表示 =|BOX| myLabel.hidden = false; ||= 表示…
https://seesaawiki.jp/xcode/d/%a5%aa%a5%d6%a5%b8%a... - 2014年09月03日更新
データ型の相互変換
String型をInt型に変換したい、Int型をString型に変換したい時などよくあることだろう =|BOX| var strTest : String = "12345"; var intTest : Int = strTest.toInt()!; ||= というやり方が一般的だ 他にも (Int)strText や strText as Int 等あるが、使い時が難しい…
https://seesaawiki.jp/xcode/d/%a5%c7%a1%bc%a5%bf%b... - 2014年08月29日更新
文字列の文字数を取得
=|BOX| countElements(myTextField.text!); ||= 大文字小文字記号半角全角日本語英語数字、関係なしに入力された文字数を取得します AAA=3 aaa=3 あああ=3 亞亞亞=3 111=3 …
https://seesaawiki.jp/xcode/d/%ca%b8%bb%fa%ce%f3%a... - 2014年08月27日更新
文字列置換
=|BOX| stringByReplacingOccurrencesOfString("A", withString: "B") ||= A・・・置換したい文字 B・・・置換後の文字 例文 =|BOX| myTextField.text = "こんにちは鈴木さん"; myTextField.text = myTextField.text.stringByReplacingOccurrencesOfString("鈴木", withString: "高橋"); myTextField.text = m…
https://seesaawiki.jp/xcode/d/%ca%b8%bb%fa%ce%f3%c... - 2014年08月27日更新