mirror of
https://github.com/Toxblh/MTMR.git
synced 2026-01-11 17:38:38 +00:00
removed all warnings
This commit is contained in:
parent
0e07f71458
commit
877c4268fd
@ -25,27 +25,26 @@ class HapticFeedback {
|
|||||||
// you can get a plist `otool -s __TEXT __tpad_act_plist /System/Library/PrivateFrameworks/MultitouchSupport.framework/Versions/Current/MultitouchSupport|tail -n +3|awk -F'\t' '{print $2}'|xxd -r -p`
|
// you can get a plist `otool -s __TEXT __tpad_act_plist /System/Library/PrivateFrameworks/MultitouchSupport.framework/Versions/Current/MultitouchSupport|tail -n +3|awk -F'\t' '{print $2}'|xxd -r -p`
|
||||||
|
|
||||||
func tap(strong:Int32) -> Void {
|
func tap(strong:Int32) -> Void {
|
||||||
let actuatorRef = MTActuatorCreateFromDeviceID(deviceID).takeRetainedValue()
|
actuatorRef = MTActuatorCreateFromDeviceID(deviceID).takeRetainedValue()
|
||||||
|
|
||||||
// TODO: Need to fix warning
|
|
||||||
guard actuatorRef != nil else {
|
guard actuatorRef != nil else {
|
||||||
print("guard actuatorRef == nil")
|
print("guard actuatorRef == nil")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
error = MTActuatorOpen(actuatorRef)
|
error = MTActuatorOpen(actuatorRef!)
|
||||||
guard error == kIOReturnSuccess else {
|
guard error == kIOReturnSuccess else {
|
||||||
print("guard MTActuatorOpen")
|
print("guard MTActuatorOpen")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
error = MTActuatorActuate(actuatorRef, strong, 0, 0.0, 0.0)
|
error = MTActuatorActuate(actuatorRef!, strong, 0, 0.0, 0.0)
|
||||||
guard error == kIOReturnSuccess else {
|
guard error == kIOReturnSuccess else {
|
||||||
print("guard MTActuatorActuate")
|
print("guard MTActuatorActuate")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
error = MTActuatorClose(actuatorRef)
|
error = MTActuatorClose(actuatorRef!)
|
||||||
guard error == kIOReturnSuccess else {
|
guard error == kIOReturnSuccess else {
|
||||||
print("guard MTActuatorClose")
|
print("guard MTActuatorClose")
|
||||||
return
|
return
|
||||||
|
|||||||
@ -4,7 +4,7 @@ class ScrollViewItem: NSCustomTouchBarItem {
|
|||||||
|
|
||||||
init(identifier: NSTouchBarItem.Identifier, items: [NSTouchBarItem]) {
|
init(identifier: NSTouchBarItem.Identifier, items: [NSTouchBarItem]) {
|
||||||
super.init(identifier: identifier)
|
super.init(identifier: identifier)
|
||||||
let views = items.flatMap { $0.view }
|
let views = items.compactMap { $0.view }
|
||||||
let stackView = NSStackView(views: views)
|
let stackView = NSStackView(views: views)
|
||||||
stackView.orientation = .horizontal
|
stackView.orientation = .horizontal
|
||||||
let scrollView = NSScrollView(frame: CGRect(origin: .zero, size: stackView.fittingSize))
|
let scrollView = NSScrollView(frame: CGRect(origin: .zero, size: stackView.fittingSize))
|
||||||
|
|||||||
@ -57,7 +57,7 @@ class TouchBarController: NSObject, NSTouchBarDelegate {
|
|||||||
|
|
||||||
loadItemDefinitions()
|
loadItemDefinitions()
|
||||||
createItems()
|
createItems()
|
||||||
centerItems = self.itemDefinitions.flatMap { (identifier, definition) -> NSTouchBarItem? in
|
centerItems = self.itemDefinitions.compactMap { (identifier, definition) -> NSTouchBarItem? in
|
||||||
return definition.align == .center ? items[identifier] : nil
|
return definition.align == .center ? items[identifier] : nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user