BluetoothRequiredView.swift 1014 B

123456789101112131415161718192021222324252627282930313233343536
  1. //
  2. // BluetoothRequiredView.swift
  3. // Trio
  4. //
  5. // Created by Cengiz Deniz on 27.04.25.
  6. //
  7. import SwiftUI
  8. public struct BluetoothRequiredView: View {
  9. public var body: some View {
  10. VStack(alignment: .center, spacing: 12) {
  11. HStack {
  12. Image("logo.bluetooth.capsule.portrait.fill")
  13. .foregroundStyle(Color.red)
  14. Text("Bluetooth Required")
  15. }
  16. .font(.headline.bold())
  17. .padding(.vertical, 6)
  18. .padding(.horizontal, 12)
  19. .overlay(
  20. Capsule()
  21. .stroke(Color.red.opacity(0.75), lineWidth: 2)
  22. )
  23. Text("Tap to Enable Bluetooth in iOS Settings")
  24. .font(.subheadline.bold())
  25. .foregroundStyle(Color.primary.opacity(0.8))
  26. }
  27. .onTapGesture {
  28. if let url = URL(string: UIApplication.openSettingsURLString) {
  29. UIApplication.shared.open(url)
  30. }
  31. }
  32. }
  33. }