Features.swift 744 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. //
  2. // Features.swift
  3. // LibreTransmitter
  4. //
  5. // Created by Bjørn Inge Berg on 30/08/2021.
  6. // Copyright © 2021 Mark Wilson. All rights reserved.
  7. //
  8. import Foundation
  9. #if canImport(CoreNFC)
  10. import CoreNFC
  11. #endif
  12. public final class Features{
  13. static public var logSubsystem = "no.bjorninge.libre"
  14. static var phoneNFCAvailable: Bool {
  15. #if canImport(CoreNFC)
  16. if NSClassFromString("NFCNDEFReaderSession") == nil {
  17. return false
  18. }
  19. return NFCNDEFReaderSession.readingAvailable
  20. #else
  21. return false
  22. #endif
  23. }
  24. static var supportsLogExport: Bool {
  25. if #available(iOS 15, *) {
  26. return true
  27. }
  28. return false
  29. }
  30. }