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 CustomWindow: NSWindowController { | |
| // This variable will hold our colours | |
| var windowColor = NSColor(named: "WindowColor") { | |
| didSet { | |
| configureWindowAppearance() | |
| } | |
| } |
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 CustomWindow: NSWindowController { | |
| override func windowDidLoad() { | |
| super.windowDidLoad() | |
| self.configureWindowAppearance() | |
| } | |
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 ViewController: NSViewController { | |
| @IBOutlet var tableView: NSTableView! | |
| var data: [[String: String]]? | |
| 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
| require 'mandrill' | |
| m = Mandrill::API.new 'myAPIKey' | |
| message = { | |
| :subject=> "Hello from the Mandrill API", | |
| :from_name=> "Your name", | |
| :text=>"Hi message, how are you?", | |
| :to=>[ | |
| { | |
| :email=> "recipient@theirdomain.com", | |
| :name=> "Recipient1" |
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
| MKMapRect zoomRect = MKMapRectNull; | |
| for (id <MKAnnotation> annotation in mapView.annotations) { | |
| MKMapPoint annotationPoint = MKMapPointForCoordinate(annotation.coordinate); | |
| MKMapRect pointRect = MKMapRectMake(annotationPoint.x, annotationPoint.y, 0, 0); | |
| if (MKMapRectIsNull(zoomRect)) { | |
| zoomRect = pointRect; | |
| } else { | |
| zoomRect = MKMapRectUnion(zoomRect, pointRect); | |
| } | |
| } |
NewerOlder