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 Cocoa | |
//青色のオブジェクトを作成 | |
let blue = NSColor.blueColor() | |
blue.setFill() | |
//100x100 の4角形を作成 | |
let r = NSRect(x:0, y:0, width:100, height:100) |
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, UIImagePickerControllerDelegate , UINavigationControllerDelegate { | |
// Mark:プロパティ | |
@IBOutlet weak var photoImageVIew: UIImageView! | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
// Do any additional setup after loading the view, typically from a nib. |
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 MyTableViewController: UITableViewController { | |
// MARK:プロパティ | |
let items:[String] = ["項目1","項目2","項目3"] | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
// プレゼンテーション中に選択を維持するにはコメントを取る |
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
class ViewController: NSViewController { | |
// MARK:プロパティ | |
@IBOutlet weak var vテキスト: NSTextField! | |
@IBOutlet weak var vラベル: NSTextField! | |
@IBOutlet weak var vボタン: NSButton! | |
... | |
} | |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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 | |
//## 予約文字 | |
// [] () \ * + ? {} ^ $ . | / | |
//# 予約文字そのものを探すにはエスケープする | |
// \\[ \\] \\( \\) \\* \\+ \\? \\{ \\} \\^ \\$ \\. \\| \\/ | |
let l検査文字列 = "[] () * + ? {} ^ $ . | /" | |
let lRgxArry = [ | |
"\\[", "\\]", "\\(", "\\)", "\\*", "\\+", "\\?", |
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
[ | |
{ | |
"fPath": "/_contents/video/Music/jazz/artist1-title1.mp4", | |
"group": "artist1", | |
"title": "title1", | |
"fType": "video", | |
"cType": "Music", | |
"zWhen": "", | |
"zWhere": "", | |
"tags": [ "jazz", |
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
//## 文字列 ##### | |
//## 長さ | |
"abcde".characters.count //5 | |
"アイウエオ".characters.count //5 |
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 | |
//## iOS:ファイルシステム ##### | |
//標準ディレクトリ ( Documents/, Library/, tmp/ ... ) | |
//## OS X:ファイルシステム ##### | |
//ローカルドメイン ( Applications/Utilities, Developer/, Library/ ) | |
//ユーザードメイン ( Users/user1, ... ) | |
//ファイルまたはディレクトリのパス |
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 Foundation | |
//## シンタックス: (パラメータリスト) -> (戻り値) | |
//## 定義と呼び出し | |
// 1. (String) -> (String) | |
func f挨拶(名前: String) -> String { | |
let l挨拶 = 名前 + "さん、今日は" | |
return l挨拶 | |
} | |
// 呼び出し |