SO answer 48935567 vs 62549061 (re-adding whitespace)

Créé Le diff n'expire jamais
5 suppressions
19 lignes
0 ajouts
14 lignes
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)
}
}
}
}
}
}