This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import UIKit | |
| class ViewController: UIViewController { | |
| override func viewDidLoad() { | |
| super.viewDidLoad() | |
| //画面サイズを取得する | |
| let viewWidth:CGFloat = self.view.frame.size.width | |
| let viewHeight:CGFloat = self.view.frame.size.height |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import UIKit | |
| class ViewController: UIViewController { | |
| override func viewDidLoad() { | |
| super.viewDidLoad() | |
| //配列の宣言 | |
| let languages = ["Ruby","C","Swift","Python","Swift"] | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import UIKit | |
| class ViewController: UIViewController { | |
| override func viewDidLoad() { | |
| super.viewDidLoad() | |
| //配列の宣言 | |
| var languages = ["Ruby","C","Swift","Python","Swift"] | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import UIKit | |
| class ViewController: UIViewController { | |
| override func viewDidLoad() { | |
| super.viewDidLoad() | |
| // 初期化 | |
| var personDic: Dictionary<String, String> = ["height": "168", "wheight": "61", "like": "kabigon"] | |
| print(personDic) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import UIKit | |
| class ViewController: UIViewController { | |
| override func viewDidLoad() { | |
| super.viewDidLoad() | |
| // 入れ子にする辞書配列を用意します。 | |
| let person0: Dictionary<String, String> = ["id": "0", "name": "kabigon", "age": "24"] | |
| let person1: Dictionary<String, String> = ["id": "1", "name": "yadon", "age": "23"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import UIKit | |
| class ViewController: UIViewController, UISearchBarDelegate, UITableViewDelegate, UITableViewDataSource { | |
| //SearchBarインスタンス | |
| private var mySearchBar: UISearchBar! | |
| //テーブルビューインスタンス | |
| private var myTableView: UITableView! | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| for num in 1..100 do | |
| #puts(num) | |
| if num%3 == 0 && num%5 == 0 then | |
| puts('Fizz Buzz') | |
| elsif num%3 == 0 then | |
| puts('Fizz') | |
| elsif num%5 == 0 | |
| puts('Buzz') | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'date' | |
| #次の29の日を探します。 | |
| def niku_search() | |
| now_date = Date.today | |
| if now_date.mday == 29 then | |
| #本日が29の日だった時 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'date' | |
| #次の29(肉)の日を検索 | |
| def niku_search() | |
| now = Date.today | |
| nx_29 = now | |
| if now.day==29 then | |
| puts('今日は29の日ですモー') | |
| return |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #要素の作成 | |
| arr = ['apple', 'orange', 'rice','water'] | |
| #二つ目の要素にアクセス -> orange | |
| puts arr[1] | |
| #要素の置換 -> pineapple | |
| arr[2] = "pineapple" | |
| puts arr[2] |