Could somebody explain to me how I can set acceptsFirstResponder on a NSViewController in Swift and xcode 6?
The program doesn't allow any overriding of the function and says it doesn't exist in the superclass but I can also not set it as a variable like:
self.acceptsFirstResponder = true
Anybody know?
I had a similar issue but with a NSView Class. I was able to make this work with the following. I had to put it in the class outside any functions.
import Cocoa
class MyView: NSView, NSDraggingDestination {
//MARK: Variables
override var acceptsFirstResponder: Bool { return true }
override var opaque: Bool { return true }
var bgColor : NSColor = .yellowColor()
var lastString : String = ""
var attributes : NSMutableDictionary = [:]
var highlightNeeded = false
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With