mirror of
https://github.com/MonitorControl/MonitorControl.git
synced 2026-06-05 06:02:20 -06:00
- Removed whitelist which caused some issues for some people #105 - Added `hide OSD` option to `AdvancedPrefsViewController` - Added `Longer Delay` option to `AdvancedPrefsViewController` - Added `PollingMode` and `PollingCount` to `AdvancedPrefsViewController` (should help #37) - Added option to reset all preferences to `AdvancedPrefsViewController` See the wiki for more info: https://github.com/the0neyouseek/MonitorControl/wiki/Advanced-Preferences
15 lines
429 B
Swift
15 lines
429 B
Swift
import Cocoa
|
|
|
|
class OnlyIntegerValueFormatter: NumberFormatter {
|
|
override func isPartialStringValid(_ partialString: String, newEditingString _: AutoreleasingUnsafeMutablePointer<NSString?>?, errorDescription _: AutoreleasingUnsafeMutablePointer<NSString?>?) -> Bool {
|
|
if partialString.isEmpty {
|
|
return true
|
|
}
|
|
|
|
if partialString.count > 3 {
|
|
return false
|
|
}
|
|
|
|
return Int(partialString) != nil
|
|
}
|
|
}
|