Created
March 9, 2016 11:26
-
-
Save gitbricho/0c1fd3504af566bee6eb to your computer and use it in GitHub Desktop.
テンプレート:スプリットビューコントローラ
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 | |
let LWinX = CGFloat(20) | |
let LWinY = CGFloat(20) | |
let LWinW = CGFloat(800) | |
let LWinH = CGFloat(600) | |
let LWinSize = CGSize(width: LWinW, height: LWinH) | |
let LWinTitle = "App Title" |
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 | |
class OutlineViewController: NSViewController { | |
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
import Cocoa | |
class PDFViewController: NSViewController { | |
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
import Cocoa | |
class SplitViewController: NSSplitViewController { | |
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
import Cocoa | |
class WindowController: NSWindowController { | |
override func windowDidLoad() { | |
super.windowDidLoad() | |
//ウィンドウの初期位置、初期サイズ、タイトルを設定する | |
if let window = window, screen = window.screen { | |
let screenRect = screen.visibleFrame | |
let newOriginY = CGRectGetMaxY(screenRect) - | |
window.frame.height - LWinY | |
window.setFrameOrigin( | |
NSPoint(x: LWinX, y: newOriginY)) | |
window.setContentSize(LWinSize) | |
window.title = LWinTitle | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment