Skip to content

Commit

Permalink
🎨 Use withUnsafePointer to make AXValue
Browse files Browse the repository at this point in the history
  • Loading branch information
MrKai77 committed Sep 11, 2023
1 parent 7be2728 commit e7b94b6
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Loop/Extensions/AXUIElement+Extensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ extension NSAccessibility.Attribute {

extension AXValue {
static func from(value: Any, type: AXValueType) -> AXValue? {
var value = value
return AXValueCreate(type, &value)
return withUnsafePointer(to: value) { ptr in
AXValueCreate(type, ptr)
}
}
}

0 comments on commit e7b94b6

Please sign in to comment.