Skip to content

Commit

Permalink
Merge pull request #115 from pvieito/master
Browse files Browse the repository at this point in the history
feat: Added visionOS support
  • Loading branch information
tikhop authored Jan 29, 2024
2 parents 4d5fd80 + 2115236 commit c65a8b5
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions Sources/Validation.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,17 @@
// Copyright © 2017-2021 Pavel Tikhonenko. All rights reserved.
//

#if os(iOS) || os(tvOS)
import UIKit
#elseif os(watchOS)
#if canImport(UIKit)
import UIKit
#endif

#if os(watchOS)
import WatchKit
#elseif os(macOS)
import IOKit
#endif

#if canImport(Cocoa)
import Cocoa
import IOKit
#endif

import CommonCrypto
Expand Down Expand Up @@ -287,9 +290,6 @@ fileprivate func guid() -> Data
#if os(watchOS)
var uuidBytes = WKInterfaceDevice.current().identifierForVendor!.uuid
return Data(bytes: &uuidBytes, count: MemoryLayout.size(ofValue: uuidBytes))
#elseif !targetEnvironment(macCatalyst) && (os(iOS) || os(tvOS))
var uuidBytes = UIDevice.current.identifierForVendor!.uuid
return Data(bytes: &uuidBytes, count: MemoryLayout.size(ofValue: uuidBytes))
#elseif targetEnvironment(macCatalyst) || os(macOS)

if let guid = getMacAddress()
Expand All @@ -300,6 +300,9 @@ fileprivate func guid() -> Data
}

return Data() // Never get called
#elseif canImport(UIKit)
var uuidBytes = UIDevice.current.identifierForVendor!.uuid
return Data(bytes: &uuidBytes, count: MemoryLayout.size(ofValue: uuidBytes))
#endif
}

Expand Down

0 comments on commit c65a8b5

Please sign in to comment.