Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for Swift 5.6 #46

Merged
merged 3 commits into from
Mar 24, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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