Skip to content

Commit

Permalink
changed toValue / from<T> to public
Browse files Browse the repository at this point in the history
  • Loading branch information
soundflix committed Jan 13, 2023
1 parent 774b789 commit b1d1222
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ZMAX/Sources/Extensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -208,13 +208,13 @@ extension AXUIElement {
// for conversion AXValue (wrapper) <> wrapped value
// from: https://github.com/keith/ModMove/blob/main/ModMove/AXValue%2BHelper.swift
extension AXValue {
func toValue<T>() -> T? {
public func toValue<T>() -> T? {
let pointer = UnsafeMutablePointer<T>.allocate(capacity: 1)
let success = AXValueGetValue(self, AXValueGetType(self), pointer)
return success ? pointer.pointee : nil
}

static func from<T>(value: T, type: AXValueType) -> AXValue? {
public static func from<T>(value: T, type: AXValueType) -> AXValue? {
let pointer = UnsafeMutablePointer<T>.allocate(capacity: 1)
pointer.pointee = value
return AXValueCreate(type, pointer)
Expand Down

0 comments on commit b1d1222

Please sign in to comment.