Skip to content

Commit

Permalink
Fix for Swift 5.6 (#46)
Browse files Browse the repository at this point in the history
Fix for Swift 5.6
  • Loading branch information
gabriellanata committed Mar 24, 2022
1 parent 18afd8d commit 00afd05
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion HammerTests.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |spec|
spec.name = "HammerTests"
spec.version = "0.14.0"
spec.version = "0.14.1"
spec.summary = "iOS touch and keyboard syntheis library for unit tests."
spec.description = "Hammer is a touch and keyboard synthesis library for emulating user interaction events. It enables new ways of triggering UI actions in unit tests, replicating a real world environment as much as possible."
spec.homepage = "https://github.com/lyft/Hammer"
Expand Down
2 changes: 1 addition & 1 deletion Sources/Hammer/AppleInternal/AppleInternal+IOHID.swift
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ struct IOHID {

typealias IOHIDEventCreateVendorDefinedEvent = @convention(c) (
_ allocator: CFAllocator?, _ timestamp: UInt64, _ usagePage: UInt32, _ usage: UInt32,
_ version: UInt32, _ data: [UInt8], _ length: Int, _ options: CFOptionFlags) -> IOHIDEvent
_ version: UInt32, _ data: NSArray, _ length: Int, _ options: CFOptionFlags) -> IOHIDEvent

typealias IOHIDEventSystemClientCreate = @convention(c) (
_ allocator: CFAllocator?) -> IOHIDEventSystemClient
Expand Down
3 changes: 2 additions & 1 deletion Sources/Hammer/EventGenerator/EventGenerator+Marker.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import CoreFoundation
import Darwin
import Foundation

extension EventGenerator {
func sendMarkerEvent(withCompletionBlock completion: @escaping CompletionHandler) throws {
Expand All @@ -11,7 +12,7 @@ extension EventGenerator {
kCFAllocatorDefault, mach_absolute_time(),
IOHID.Page.vendorDefinedStart.rawValue + 100,
0, 1,
eventIdBytes, MemoryLayout.size(ofValue: eventIdBytes),
eventIdBytes as NSArray, MemoryLayout.size(ofValue: eventIdBytes),
kIOHIDEventOptionNone)

// NOTE: This should not be needed. It is a workaround because the previous method doesn't seem to be
Expand Down

0 comments on commit 00afd05

Please sign in to comment.