SO answer 48935567 vs 62549061 (re-adding whitespace)

19 lines
-5 Removals
14 lines
0 Additions
import Cocoa
@IBDesignable
@objc(BCLDisablableScrollView)
public class DisablableScrollView: NSScrollView {
public class DisablableScrollView: NSScrollView {
@IBInspectable
@IBInspectable
@objc(enabled)
public var isEnabled: Bool = true
public var isEnabled: Bool = true
public override func scrollWheel(with event: NSEvent) {
public override func scrollWheel(with event: NSEvent) {
if isEnabled {
if isEnabled {
super.scrollWheel(with: event)
super.scrollWheel(with: event)
}
}
else {
else {
nextResponder?.scrollWheel(with: event)
nextResponder?.scrollWheel(with: event)
}
}
}
}
}
}
Editor
Clear
Export as PDF