From 28dd526cb59fc13204b2df9e6fa7598990615d37 Mon Sep 17 00:00:00 2001 From: Roman Gardukevich Date: Wed, 4 Dec 2024 19:47:19 +0200 Subject: [PATCH] Update examples to the iOS 16+ (#2377) --- Apps/Examples/Examples.xcodeproj/project.pbxproj | 6 ++++++ .../BasicLocationPulsingExample.swift | 1 - .../Examples/All Examples/CameraForExample.swift | 1 - .../CarPlay/ApplicationCarPlaySceneDelegage.swift | 3 +-- .../CarPlay/DashboardCarPlaySceneDelegate.swift | 1 - .../InstrumentClusterCarPlaySceneDelegate.swift | 1 - .../Examples/All Examples/GeofencingExample.swift | 2 +- .../All Examples/Lab/CombineExample.swift | 1 - .../All Examples/Lab/CombineLocationExample.swift | 1 - .../All Examples/OfflineManagerExample.swift | 2 +- .../All Examples/RuntimeSlotsExample.swift | 1 - Apps/Examples/Examples/AppDelegate.swift | 15 ++------------- .../Controllers/ExampleTableViewController.swift | 1 - .../SwiftUI Examples/AnnotationsExample.swift | 1 - .../SwiftUI Examples/ClipLayerExample.swift | 1 - .../SwiftUI Examples/ClusteringExample.swift | 7 ------- .../SwiftUI Examples/DynamicStylingExample.swift | 8 -------- .../SwiftUI Examples/FeaturesQueryExample.swift | 5 ----- .../SwiftUI Examples/GeofencingPlayground.swift | 11 ----------- .../SwiftUI Examples/GeofencingUserLocation.swift | 5 ----- .../SwiftUI Examples/LocateMeExample.swift | 4 ---- .../LocationOverrideExample.swift | 1 - .../SwiftUI Examples/PrecipitationsExample.swift | 2 -- .../SwiftUI Examples/RasterParticleExample.swift | 2 -- .../SwiftUI Examples/SnapshotMapExample.swift | 4 ---- .../StandardInteractiveBuildingsExample.swift | 1 - .../StandardInteractiveFeaturesExample.swift | 1 - .../StandardStyleImportExample.swift | 4 ---- .../StandardStyleLocationsExample.swift | 5 ----- .../Examples/SwiftUI Examples/SwiftUIRoot.swift | 7 ------- .../AnnotationsOrderTestExample.swift | 9 --------- .../AttributionDialogueExamples.swift | 2 -- .../Testing Examples/InteractionsPlayground.swift | 2 -- .../Testing Examples/MapScrollExample.swift | 2 -- .../Testing Examples/MapSettingsExample.swift | 4 ---- .../Testing Examples/PuckPlayground.swift | 5 ----- .../Testing Examples/SimpleMapExample.swift | 2 -- .../Testing Examples/ViewportPlayground.swift | 4 ---- .../SwiftUI Examples/Util/ButtonStyle.swift | 5 ----- .../SwiftUI Examples/Util/CalloutView.swift | 3 --- .../Examples/SwiftUI Examples/Util/PinView.swift | 1 - .../SwiftUI Examples/Util/View+OnShake.swift | 2 -- .../SwiftUI Examples/Util/ViewExtensions.swift | 7 ------- .../SwiftUI Examples/ViewAnnotationsExample.swift | 4 ---- .../WeatherAnnotationExample.swift | 3 --- xcodegen/Examples.yml | 3 +++ 46 files changed, 14 insertions(+), 149 deletions(-) diff --git a/Apps/Examples/Examples.xcodeproj/project.pbxproj b/Apps/Examples/Examples.xcodeproj/project.pbxproj index d2687ced001b..7dd15c0a8cce 100644 --- a/Apps/Examples/Examples.xcodeproj/project.pbxproj +++ b/Apps/Examples/Examples.xcodeproj/project.pbxproj @@ -990,6 +990,7 @@ APPLICATION_EXTENSION_API_ONLY = NO; BUNDLE_LOADER = "$(TEST_HOST)"; GENERATE_INFOPLIST_FILE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 16.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks $(PROJECT_DIR)/../lib"; PRODUCT_BUNDLE_IDENTIFIER = com.mapbox.MapboxTests; SDKROOT = auto; @@ -1099,6 +1100,7 @@ APPLICATION_EXTENSION_API_ONLY = NO; BUNDLE_LOADER = "$(TEST_HOST)"; GENERATE_INFOPLIST_FILE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 16.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks $(PROJECT_DIR)/../lib"; PRODUCT_BUNDLE_IDENTIFIER = mapbox.ExamplesUITests; SDKROOT = auto; @@ -1123,6 +1125,7 @@ INFOPLIST_FILE = Examples/Info.plist; INFOPLIST_PREFIX_HEADER = "$(DERIVED_FILE_DIR)/InfoPlist.Prefix.h"; INFOPLIST_PREPROCESS = YES; + IPHONEOS_DEPLOYMENT_TARGET = 16.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -1238,6 +1241,7 @@ INFOPLIST_FILE = Examples/Info.plist; INFOPLIST_PREFIX_HEADER = "$(DERIVED_FILE_DIR)/InfoPlist.Prefix.h"; INFOPLIST_PREPROCESS = YES; + IPHONEOS_DEPLOYMENT_TARGET = 16.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -1262,6 +1266,7 @@ APPLICATION_EXTENSION_API_ONLY = NO; BUNDLE_LOADER = "$(TEST_HOST)"; GENERATE_INFOPLIST_FILE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 16.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks $(PROJECT_DIR)/../lib"; PRODUCT_BUNDLE_IDENTIFIER = com.mapbox.MapboxTests; SDKROOT = auto; @@ -1280,6 +1285,7 @@ APPLICATION_EXTENSION_API_ONLY = NO; BUNDLE_LOADER = "$(TEST_HOST)"; GENERATE_INFOPLIST_FILE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 16.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks $(PROJECT_DIR)/../lib"; PRODUCT_BUNDLE_IDENTIFIER = mapbox.ExamplesUITests; SDKROOT = auto; diff --git a/Apps/Examples/Examples/All Examples/BasicLocationPulsingExample.swift b/Apps/Examples/Examples/All Examples/BasicLocationPulsingExample.swift index 6ace3497e9e1..442639fb724d 100644 --- a/Apps/Examples/Examples/All Examples/BasicLocationPulsingExample.swift +++ b/Apps/Examples/Examples/All Examples/BasicLocationPulsingExample.swift @@ -105,7 +105,6 @@ final class BasicLocationPulsingExample: UIViewController, ExampleProtocol { present(controller, animated: true) } - @available(iOS 14.0, *) private func updateMenu() { let state = mapView.location.options.puckType.map { type -> PuckCircle? in if case PuckType.puck2D(let config) = type { diff --git a/Apps/Examples/Examples/All Examples/CameraForExample.swift b/Apps/Examples/Examples/All Examples/CameraForExample.swift index 86ad65b23afb..e09eb835e220 100644 --- a/Apps/Examples/Examples/All Examples/CameraForExample.swift +++ b/Apps/Examples/Examples/All Examples/CameraForExample.swift @@ -1,7 +1,6 @@ import UIKit import MapboxMaps -@available(iOS 13.0, *) final class CameraForExample: UIViewController, ExampleProtocol { private var mapView: MapView! private var cancelables = Set() diff --git a/Apps/Examples/Examples/All Examples/CarPlay/ApplicationCarPlaySceneDelegage.swift b/Apps/Examples/Examples/All Examples/CarPlay/ApplicationCarPlaySceneDelegage.swift index 0f84ebd03e73..dab749aea50d 100644 --- a/Apps/Examples/Examples/All Examples/CarPlay/ApplicationCarPlaySceneDelegage.swift +++ b/Apps/Examples/Examples/All Examples/CarPlay/ApplicationCarPlaySceneDelegage.swift @@ -1,6 +1,5 @@ import CarPlay -@available(iOS 13.0, *) class ApplicationCarPlaySceneDelegage: NSObject, CPTemplateApplicationSceneDelegate { let applicationVC = CarPlayRootVC() @@ -19,7 +18,7 @@ class ApplicationCarPlaySceneDelegage: NSObject, CPTemplateApplicationSceneDeleg } ] } - interfaceController.setRootTemplate(mapTemplate, animated: false) + interfaceController.setRootTemplate(mapTemplate, animated: false, completion: nil) } func sceneWillEnterForeground(_ scene: UIScene) { diff --git a/Apps/Examples/Examples/All Examples/CarPlay/DashboardCarPlaySceneDelegate.swift b/Apps/Examples/Examples/All Examples/CarPlay/DashboardCarPlaySceneDelegate.swift index bed60143ac49..22fdb89851ca 100644 --- a/Apps/Examples/Examples/All Examples/CarPlay/DashboardCarPlaySceneDelegate.swift +++ b/Apps/Examples/Examples/All Examples/CarPlay/DashboardCarPlaySceneDelegate.swift @@ -1,6 +1,5 @@ import CarPlay -@available(iOS 13.4, *) class DashboardCarPlaySceneDelegate: NSObject, CPTemplateApplicationSceneDelegate, CPTemplateApplicationDashboardSceneDelegate { let dashboardVC = CarPlayRootVC() diff --git a/Apps/Examples/Examples/All Examples/CarPlay/InstrumentClusterCarPlaySceneDelegate.swift b/Apps/Examples/Examples/All Examples/CarPlay/InstrumentClusterCarPlaySceneDelegate.swift index d8f3c8d5559e..36fc683c45ce 100644 --- a/Apps/Examples/Examples/All Examples/CarPlay/InstrumentClusterCarPlaySceneDelegate.swift +++ b/Apps/Examples/Examples/All Examples/CarPlay/InstrumentClusterCarPlaySceneDelegate.swift @@ -1,7 +1,6 @@ import CarPlay import MapboxMaps -@available(iOS 15.4, *) class InstrumentClusterCarPlaySceneDelegate: NSObject, CPTemplateApplicationInstrumentClusterSceneDelegate, CPInstrumentClusterControllerDelegate { diff --git a/Apps/Examples/Examples/All Examples/GeofencingExample.swift b/Apps/Examples/Examples/All Examples/GeofencingExample.swift index ebf9f632fce0..aa497cc80eb3 100644 --- a/Apps/Examples/Examples/All Examples/GeofencingExample.swift +++ b/Apps/Examples/Examples/All Examples/GeofencingExample.swift @@ -296,7 +296,7 @@ extension GeofencingExample { private func showSpinnerIfNeeded() { if geofencingSpinner == nil { - let spinner = UIActivityIndicatorView(style: .whiteLarge) + let spinner = UIActivityIndicatorView(style: .large) spinner.translatesAutoresizingMaskIntoConstraints = false spinner.startAnimating() diff --git a/Apps/Examples/Examples/All Examples/Lab/CombineExample.swift b/Apps/Examples/Examples/All Examples/Lab/CombineExample.swift index b57ee750f332..7cd4cbf7b6da 100644 --- a/Apps/Examples/Examples/All Examples/Lab/CombineExample.swift +++ b/Apps/Examples/Examples/All Examples/Lab/CombineExample.swift @@ -3,7 +3,6 @@ import MapboxMaps import Combine /// This examples shows how to use Map events with Combine framework. -@available(iOS 13.0, *) final class CombineExample: UIViewController, ExampleProtocol { private var mapView: MapView! private var tokens = Set() diff --git a/Apps/Examples/Examples/All Examples/Lab/CombineLocationExample.swift b/Apps/Examples/Examples/All Examples/Lab/CombineLocationExample.swift index cfd702470659..b9a8d0503e20 100644 --- a/Apps/Examples/Examples/All Examples/Lab/CombineLocationExample.swift +++ b/Apps/Examples/Examples/All Examples/Lab/CombineLocationExample.swift @@ -4,7 +4,6 @@ import Combine import Turf /// This examples shows how to use Combine framework to drive the Puck's location and heading. -@available(iOS 13.0, *) final class CombineLocationExample: UIViewController, ExampleProtocol { @Published private var location = Location(coordinate: CLLocationCoordinate2D(latitude: 60.17195694011002, longitude: 24.945389069265598)) diff --git a/Apps/Examples/Examples/All Examples/OfflineManagerExample.swift b/Apps/Examples/Examples/All Examples/OfflineManagerExample.swift index 8c733edab0bb..d761e0945718 100644 --- a/Apps/Examples/Examples/All Examples/OfflineManagerExample.swift +++ b/Apps/Examples/Examples/All Examples/OfflineManagerExample.swift @@ -311,7 +311,7 @@ final class OfflineManagerExample: UIViewController, NonMapViewExampleProtocol { private func resetUI() { logger?.reset() logView.textContainerInset.bottom = view.safeAreaInsets.bottom - logView.scrollIndicatorInsets.bottom = view.safeAreaInsets.bottom + logView.verticalScrollIndicatorInsets.bottom = view.safeAreaInsets.bottom progressContainer.isHidden = false stylePackProgressView.progress = 0.0 diff --git a/Apps/Examples/Examples/All Examples/RuntimeSlotsExample.swift b/Apps/Examples/Examples/All Examples/RuntimeSlotsExample.swift index f152d9b62693..6a73561c1fd9 100644 --- a/Apps/Examples/Examples/All Examples/RuntimeSlotsExample.swift +++ b/Apps/Examples/Examples/All Examples/RuntimeSlotsExample.swift @@ -3,7 +3,6 @@ import MapboxMaps /// This example shows how to use a slot from the Standard style and use another custom slot added at runtime /// to split the former into two parts. -@available(iOS 13.0, *) final class RuntimeSlotsExample: UIViewController, ExampleProtocol { private var mapView: MapView! diff --git a/Apps/Examples/Examples/AppDelegate.swift b/Apps/Examples/Examples/AppDelegate.swift index 1bfecbbf4508..093bdd40dd97 100644 --- a/Apps/Examples/Examples/AppDelegate.swift +++ b/Apps/Examples/Examples/AppDelegate.swift @@ -28,17 +28,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate { let appearance = UINavigationBar.appearance() appearance.prefersLargeTitles = true - - if #available(iOS 13.0, *) { - appearance.scrollEdgeAppearance = UINavigationBarAppearance() - } - - if #unavailable(iOS 13.0) { - let examplesTableViewController = ExampleTableViewController() - let navigationController = UINavigationController(rootViewController: examplesTableViewController) - window?.rootViewController = navigationController - window?.makeKeyAndVisible() - } + appearance.scrollEdgeAppearance = UINavigationBarAppearance() return true } @@ -97,7 +87,7 @@ extension AppDelegate: UNUserNotificationCenterDelegate { // This function will be called when the app receive notification func userNotificationCenter(_ center: UNUserNotificationCenter, willPresent notification: UNNotification, withCompletionHandler completionHandler: @escaping (UNNotificationPresentationOptions) -> Void) { // show the notification alert (banner), and with sound - completionHandler([.alert, .sound]) + completionHandler([.banner, .sound]) } // This function will be called right after user tap on the notification @@ -120,7 +110,6 @@ extension AppDelegate: UNUserNotificationCenterDelegate { } } -@available(iOS 13.0, *) final class SceneDelegate: NSObject, UISceneDelegate { var windows: [UIWindow] = [] diff --git a/Apps/Examples/Examples/Controllers/ExampleTableViewController.swift b/Apps/Examples/Examples/Controllers/ExampleTableViewController.swift index 861ca8a22e90..026af1337112 100644 --- a/Apps/Examples/Examples/Controllers/ExampleTableViewController.swift +++ b/Apps/Examples/Examples/Controllers/ExampleTableViewController.swift @@ -52,7 +52,6 @@ final class ExampleTableViewController: UITableViewController { UserDefaults.standard.removeObject(forKey: startingExampleTitleKey) } - @available(iOS 14.0, *) @objc func openSwiftUI() { present(createSwiftUIExamplesController(), animated: true) } diff --git a/Apps/Examples/Examples/SwiftUI Examples/AnnotationsExample.swift b/Apps/Examples/Examples/SwiftUI Examples/AnnotationsExample.swift index 68c55b599a99..746fcd599e47 100644 --- a/Apps/Examples/Examples/SwiftUI Examples/AnnotationsExample.swift +++ b/Apps/Examples/Examples/SwiftUI Examples/AnnotationsExample.swift @@ -1,7 +1,6 @@ import MapboxMaps import SwiftUI -@available(iOS 14.0, *) struct AnnotationsExample: View { struct Tap: Identifiable { var coordinate: CLLocationCoordinate2D diff --git a/Apps/Examples/Examples/SwiftUI Examples/ClipLayerExample.swift b/Apps/Examples/Examples/SwiftUI Examples/ClipLayerExample.swift index 635dce7b0b08..49d2d09dd92d 100644 --- a/Apps/Examples/Examples/SwiftUI Examples/ClipLayerExample.swift +++ b/Apps/Examples/Examples/SwiftUI Examples/ClipLayerExample.swift @@ -2,7 +2,6 @@ import Foundation import SwiftUI @_spi(Experimental) import MapboxMaps -@available(iOS 14.0, *) struct ClipLayerExample: View { @State private var settings = ClipLayerSettings() diff --git a/Apps/Examples/Examples/SwiftUI Examples/ClusteringExample.swift b/Apps/Examples/Examples/SwiftUI Examples/ClusteringExample.swift index 19aa4c91a420..29904a6ff9d5 100644 --- a/Apps/Examples/Examples/SwiftUI Examples/ClusteringExample.swift +++ b/Apps/Examples/Examples/SwiftUI Examples/ClusteringExample.swift @@ -8,7 +8,6 @@ private enum Id { static let source = "fire-hydrant-source" } -@available(iOS 14.0, *) struct ClusteringExample: View { struct Detail: Identifiable { var id = UUID() @@ -47,7 +46,6 @@ struct ClusteringExample: View { } } -@available(iOS 14.0, *) extension ClusteringExample.Detail { init(title: String, message: String) { self.title = title @@ -71,7 +69,6 @@ extension ClusteringExample.Detail { } } -@available(iOS 14.0, *) private func setupClusteringLayer(_ map: MapboxMap) throws { // The image named `fire-station-11` is included in the app's Assets.xcassets bundle. // In order to recolor an image, you need to add a template image to the map's style. @@ -109,7 +106,6 @@ private func setupClusteringLayer(_ map: MapboxMap) throws { try map.addLayer(clusterCountLayer) } -@available(iOS 14.0, *) private func createClusteredLayer() -> CircleLayer { // Create a symbol layer to represent the clustered points. var clusteredLayer = CircleLayer(id: Id.clusterCircle, source: Id.source) @@ -136,7 +132,6 @@ private func createClusteredLayer() -> CircleLayer { return clusteredLayer } -@available(iOS 14.0, *) private func createUnclusteredLayer() -> SymbolLayer { // Create a symbol layer to represent the points that aren't clustered. var unclusteredLayer = SymbolLayer(id: Id.point, source: Id.source) @@ -159,7 +154,6 @@ private func createUnclusteredLayer() -> SymbolLayer { return unclusteredLayer } -@available(iOS 14.0, *) private func createNumberLayer() -> SymbolLayer { var numberLayer = SymbolLayer(id: Id.count, source: Id.source) @@ -172,7 +166,6 @@ private func createNumberLayer() -> SymbolLayer { return numberLayer } -@available(iOS 14.0, *) struct ClusteringExample_Preview: PreviewProvider { static var previews: some View { ClusteringExample() diff --git a/Apps/Examples/Examples/SwiftUI Examples/DynamicStylingExample.swift b/Apps/Examples/Examples/SwiftUI Examples/DynamicStylingExample.swift index ea56c94b4394..1e3f29b6fc92 100644 --- a/Apps/Examples/Examples/SwiftUI Examples/DynamicStylingExample.swift +++ b/Apps/Examples/Examples/SwiftUI Examples/DynamicStylingExample.swift @@ -1,7 +1,6 @@ import SwiftUI @_spi(Experimental) import MapboxMaps -@available(iOS 14.0, *) struct DynamicStylingExample: View { enum CityCollection: CaseIterable { case northern @@ -157,7 +156,6 @@ struct DynamicStylingExample: View { } } -@available(iOS 13.0, *) struct ConnectionComponent: MapStyleContent { enum Kind: String, CaseIterable { case line @@ -203,7 +201,6 @@ struct ConnectionComponent: MapStyleContent { } /// Implements the route line component -@available(iOS 13.0, *) struct RouteLine: MapStyleContent { var id: String var featureRef: FeaturesRef @@ -236,7 +233,6 @@ struct RouteLine: MapStyleContent { } /// Implements a GeoJSON source that is updated when the reference to features is changed. -@available(iOS 13.0, *) struct LazyGeoJSON: MapStyleContent { let id: String let features: FeaturesRef @@ -254,7 +250,6 @@ class FeaturesRef { init(_ features: [Feature]) { self.features = features } } -@available(iOS 13.0, *) struct ModelsComponent: MapStyleContent { var body: some MapStyleContent { /// Add models @@ -292,7 +287,6 @@ struct ModelsComponent: MapStyleContent { } } -@available(iOS 14.0, *) extension DynamicStylingExample.CityCollection { var pinFeatures: FeaturesRef { switch self { @@ -321,7 +315,6 @@ extension DynamicStylingExample.CityCollection { } } -@available(iOS 13.0, *) private struct RadioButtonSettingView: View where Value: CaseIterable, Value: Hashable, Value.AllCases: RandomAccessCollection { var title: String @@ -339,7 +332,6 @@ where Value: CaseIterable, Value: Hashable, Value.AllCases: RandomAccessCollecti } } -@available(iOS 13.0, *) private extension Viewport { static var exampleOverview: Viewport = .camera(center: .init(latitude: 46.80, longitude: 11.18), zoom: 3, pitch: 45) static var modelsOverview: Viewport = .camera(center: .init(latitude: 60.172, longitude: 24.94), zoom: 13.32, pitch: 45) diff --git a/Apps/Examples/Examples/SwiftUI Examples/FeaturesQueryExample.swift b/Apps/Examples/Examples/SwiftUI Examples/FeaturesQueryExample.swift index 77ef6ae6b1ae..f7fd3c0ec76d 100644 --- a/Apps/Examples/Examples/SwiftUI Examples/FeaturesQueryExample.swift +++ b/Apps/Examples/Examples/SwiftUI Examples/FeaturesQueryExample.swift @@ -2,7 +2,6 @@ import SwiftUI import MapboxMaps /// This example shows how to use `MapReader` in order to access underlying `MapboxMap` API in SwiftUI. -@available(iOS 14.0, *) struct FeaturesQueryExample: View { @StateObject private var model = Model() var body: some View { @@ -32,7 +31,6 @@ struct FeaturesQueryExample: View { } } -@available(iOS 14.0, *) private class Model: ObservableObject { struct Location: Identifiable { var id = UUID() @@ -73,7 +71,6 @@ private class Model: ObservableObject { } } -@available(iOS 14.0, *) struct QueryResult: Identifiable { struct Feature: Identifiable { var id = UUID() @@ -105,7 +102,6 @@ struct QueryResult: Identifiable { } } -@available(iOS 14.0, *) struct ResultView: View { let result: QueryResult var body: some View { @@ -125,7 +121,6 @@ struct ResultView: View { } } -@available(iOS 14.0, *) struct FeaturesQueryExample_Preview: PreviewProvider { static var previews: some View { FeaturesQueryExample() diff --git a/Apps/Examples/Examples/SwiftUI Examples/GeofencingPlayground.swift b/Apps/Examples/Examples/SwiftUI Examples/GeofencingPlayground.swift index 8838ba971f9b..f214d66da670 100644 --- a/Apps/Examples/Examples/SwiftUI Examples/GeofencingPlayground.swift +++ b/Apps/Examples/Examples/SwiftUI Examples/GeofencingPlayground.swift @@ -4,7 +4,6 @@ import SwiftUI @_spi(Experimental) import MapboxCommon /// This is an Example for Experimental API that is subject to change. -@available(iOS 14.0, *) struct GeofencingPlayground: View { @State private var showInfoSheet = false @State private var isochrone: Turf.Feature? @@ -42,7 +41,6 @@ struct GeofencingPlayground: View { } } -@available(iOS 14.0, *) private struct Isochrone: MapStyleContent { var id: String var feature: Turf.Feature @@ -58,7 +56,6 @@ private struct Isochrone: MapStyleContent { } } -@available(iOS 14.0, *) private struct LoggingView: View { var hasUserConsent: Bool var lastEvent: GeofenceEvent? @@ -92,7 +89,6 @@ private struct LoggingView: View { } } -@available(iOS 14.0, *) private struct InfoView: View { var body: some View { VStack(alignment: .leading, spacing: 0) { @@ -118,7 +114,6 @@ private struct InfoView: View { } } -@available(iOS 14.0, *) private final class InitialLocationProvider { private var cancellables = Set() @@ -134,7 +129,6 @@ private final class InitialLocationProvider { } } -@available(iOS 14.0, *) private final class Geofencing: ObservableObject { @Published var lastEvent: GeofenceEvent? @Published var hasUserConsent: Bool = GeofencingUtils.getUserConsent() @@ -187,7 +181,6 @@ private extension GeoJSONSourceData { } } -@available(iOS 14.0, *) extension Geofencing: GeofencingObserver { func onEntry(event: GeofencingEvent) { DispatchQueue.main.async { self.lastEvent = GeofenceEvent(type: .entry, feature: event.feature) } @@ -208,7 +201,6 @@ extension Geofencing: GeofencingObserver { func onError(error: GeofencingError) {} } -@available(iOS 14.0, *) private struct GeofenceEvent { enum GeofenceEventType { case entry @@ -286,7 +278,6 @@ private extension Turf.Feature { } } -@available(iOS 14.0, *) struct InfoButton: View { var action: () -> Void @@ -302,7 +293,6 @@ struct InfoButton: View { } } -@available(iOS 14.0, *) struct OvalButton: View { var title: String var action: () -> Void @@ -319,7 +309,6 @@ struct OvalButton: View { } } -@available(iOS 14.0, *) struct IndicativeLog: View { var color: Color var text: String diff --git a/Apps/Examples/Examples/SwiftUI Examples/GeofencingUserLocation.swift b/Apps/Examples/Examples/SwiftUI Examples/GeofencingUserLocation.swift index b6300dc80729..c86bf675160e 100644 --- a/Apps/Examples/Examples/SwiftUI Examples/GeofencingUserLocation.swift +++ b/Apps/Examples/Examples/SwiftUI Examples/GeofencingUserLocation.swift @@ -4,7 +4,6 @@ import SwiftUI @_spi(Experimental) import MapboxCommon /// This is an Example for Experimental API that is subject to change. -@available(iOS 14.0, *) struct GeofencingUserLocation: View { @State private var initialLocation: CLLocationCoordinate2D? @ObservedObject private var geofencing = Geofencing() @@ -35,7 +34,6 @@ struct GeofencingUserLocation: View { } } -@available(iOS 14.0, *) private struct GeofenceCircle: MapStyleContent { var id: String var location: CLLocationCoordinate2D @@ -64,7 +62,6 @@ private struct GeofenceCircle: MapStyleContent { } } -@available(iOS 14.0, *) private final class InitialLocationProvider { private var cancellables = Set() @@ -80,7 +77,6 @@ private final class InitialLocationProvider { } } -@available(iOS 14.0, *) private final class Geofencing: ObservableObject { @Published var lastEvent: GeofenceEvent? @@ -115,7 +111,6 @@ private final class Geofencing: ObservableObject { } } -@available(iOS 14.0, *) extension Geofencing: GeofencingObserver { func onEntry(event: GeofencingEvent) { DispatchQueue.main.async { self.lastEvent = GeofenceEvent(type: .entry, feature: event.feature) } diff --git a/Apps/Examples/Examples/SwiftUI Examples/LocateMeExample.swift b/Apps/Examples/Examples/SwiftUI Examples/LocateMeExample.swift index a61b298b92e1..e54e3e9a6ad4 100644 --- a/Apps/Examples/Examples/SwiftUI Examples/LocateMeExample.swift +++ b/Apps/Examples/Examples/SwiftUI Examples/LocateMeExample.swift @@ -1,7 +1,6 @@ import SwiftUI import MapboxMaps -@available(iOS 14.0, *) struct LocateMeExample: View { @State var viewport: Viewport = .followPuck(zoom: 13, bearing: .constant(0)) @@ -17,7 +16,6 @@ struct LocateMeExample: View { } } -@available(iOS 14.0, *) struct LocateMeButton: View { @Binding var viewport: Viewport @@ -59,7 +57,6 @@ struct LocateMeButton: View { } } -@available(iOS 13.0, *) private extension View { func safeContentTransition() -> some View { if #available(iOS 17, *) { @@ -69,7 +66,6 @@ private extension View { } } -@available(iOS 14.0, *) struct LocateMeExample_Preview: PreviewProvider { static var previews: some View { LocateMeExample() diff --git a/Apps/Examples/Examples/SwiftUI Examples/LocationOverrideExample.swift b/Apps/Examples/Examples/SwiftUI Examples/LocationOverrideExample.swift index 363bbffb750a..d14b7a7bb40b 100644 --- a/Apps/Examples/Examples/SwiftUI Examples/LocationOverrideExample.swift +++ b/Apps/Examples/Examples/SwiftUI Examples/LocationOverrideExample.swift @@ -2,7 +2,6 @@ import SwiftUI import MapboxMaps /// The example demonstrates how to override the default location provider using SwiftUI and Combine. -@available(iOS 14.0, *) struct LocationOverrideExample: View { private class LocationProvider { @Published var location = Location(coordinate: .zero) diff --git a/Apps/Examples/Examples/SwiftUI Examples/PrecipitationsExample.swift b/Apps/Examples/Examples/SwiftUI Examples/PrecipitationsExample.swift index 879a6c03358c..f7b0a4fca090 100644 --- a/Apps/Examples/Examples/SwiftUI Examples/PrecipitationsExample.swift +++ b/Apps/Examples/Examples/SwiftUI Examples/PrecipitationsExample.swift @@ -1,7 +1,6 @@ import SwiftUI @_spi(Experimental) import MapboxMaps -@available(iOS 14.0, *) struct PrecipitationExample: View { @State var viewport: Viewport = .camera(center: CLLocationCoordinate2D(latitude: 37.33464837343596, longitude: -122.00896178062911), zoom: 18, pitch: 80) @@ -93,7 +92,6 @@ struct PrecipitationExample: View { } } -@available(iOS 14.0, *) struct PrecipitationExample_Preview: PreviewProvider { static var previews: some View { PrecipitationExample() diff --git a/Apps/Examples/Examples/SwiftUI Examples/RasterParticleExample.swift b/Apps/Examples/Examples/SwiftUI Examples/RasterParticleExample.swift index e96f6adf1e1b..bc70ccc7f195 100644 --- a/Apps/Examples/Examples/SwiftUI Examples/RasterParticleExample.swift +++ b/Apps/Examples/Examples/SwiftUI Examples/RasterParticleExample.swift @@ -1,7 +1,6 @@ import SwiftUI @_spi(Experimental) import MapboxMaps -@available(iOS 14.0, *) struct RasterParticleExample: View { @State var mapStyle = MapStyle.dark @State var rasterParticleCount: Double = 2048 @@ -43,7 +42,6 @@ struct RasterParticleExample: View { } } -@available(iOS 13.0, *) private struct SliderSettingView: View { var title: String @Binding var value: Double diff --git a/Apps/Examples/Examples/SwiftUI Examples/SnapshotMapExample.swift b/Apps/Examples/Examples/SwiftUI Examples/SnapshotMapExample.swift index 72703650774b..1890ab4b34d7 100644 --- a/Apps/Examples/Examples/SwiftUI Examples/SnapshotMapExample.swift +++ b/Apps/Examples/Examples/SwiftUI Examples/SnapshotMapExample.swift @@ -1,7 +1,6 @@ import SwiftUI import MapboxMaps -@available(iOS 14.0, *) struct SnapshotMapExample: View { @State var image: UIImage? @@ -54,7 +53,6 @@ struct SnapshotMapExample: View { } } -@available(iOS 14.0, *) struct SnapshotView: View { var snapshot: UIImage? @@ -67,12 +65,10 @@ struct SnapshotView: View { } } -@available(iOS 13.0, *) private extension Viewport { static let helsinkiOverview = Self.overview(geometry: Polygon(center: .helsinki, radius: 10000, vertices: 30)) } -@available(iOS 14.0, *) struct SnapshotMapExample_Preview: PreviewProvider { static var previews: some View { SnapshotMapExample() diff --git a/Apps/Examples/Examples/SwiftUI Examples/StandardInteractiveBuildingsExample.swift b/Apps/Examples/Examples/SwiftUI Examples/StandardInteractiveBuildingsExample.swift index 157839dbe7c8..38910b3e1a4f 100644 --- a/Apps/Examples/Examples/SwiftUI Examples/StandardInteractiveBuildingsExample.swift +++ b/Apps/Examples/Examples/SwiftUI Examples/StandardInteractiveBuildingsExample.swift @@ -1,7 +1,6 @@ import SwiftUI @_spi(Experimental) import MapboxMaps -@available(iOS 14, *) struct StandardInteractiveBuildingsExample: View { @State var selectedBuildings = [StandardBuildingsFeature]() @State var lightPreset = StandardLightPreset.day diff --git a/Apps/Examples/Examples/SwiftUI Examples/StandardInteractiveFeaturesExample.swift b/Apps/Examples/Examples/SwiftUI Examples/StandardInteractiveFeaturesExample.swift index f9d7edc6913e..860668fe54e8 100644 --- a/Apps/Examples/Examples/SwiftUI Examples/StandardInteractiveFeaturesExample.swift +++ b/Apps/Examples/Examples/SwiftUI Examples/StandardInteractiveFeaturesExample.swift @@ -1,7 +1,6 @@ import SwiftUI @_spi(Experimental) import MapboxMaps -@available(iOS 14, *) struct StandardInteractiveFeaturesExample: View { @State var selectedPoi: StandardPoiFeature? @State var selectedBuildings = [StandardBuildingsFeature]() diff --git a/Apps/Examples/Examples/SwiftUI Examples/StandardStyleImportExample.swift b/Apps/Examples/Examples/SwiftUI Examples/StandardStyleImportExample.swift index 5c844e414929..a110f57d2df0 100644 --- a/Apps/Examples/Examples/SwiftUI Examples/StandardStyleImportExample.swift +++ b/Apps/Examples/Examples/SwiftUI Examples/StandardStyleImportExample.swift @@ -1,7 +1,6 @@ import SwiftUI @_spi(Experimental) import MapboxMaps -@available(iOS 14.0, *) struct StandardStyleImportExample: View { @State private var lightPreset: StandardLightPreset? = .night @State private var theme: StandardTheme? = .default @@ -101,7 +100,6 @@ struct StandardStyleImportExample: View { } } -@available(iOS 14.0, *) private struct HotelCallout: View { var feature: FeaturesetFeature @@ -128,7 +126,6 @@ private struct HotelCallout: View { } } -@available(iOS 13.0, *) private struct NYNJBorder: MapContent { var body: some MapContent { GeoJSONSource(id: "border") @@ -155,7 +152,6 @@ private extension FeaturesetFeature { private let styleURL = Bundle.main.url(forResource: "fragment-realestate-NY", withExtension: "json")! -@available(iOS 14.0, *) struct StandardStyleImportExample_Previews: PreviewProvider { static var previews: some View { StandardStyleImportExample() diff --git a/Apps/Examples/Examples/SwiftUI Examples/StandardStyleLocationsExample.swift b/Apps/Examples/Examples/SwiftUI Examples/StandardStyleLocationsExample.swift index e858a02dd957..93be39466936 100644 --- a/Apps/Examples/Examples/SwiftUI Examples/StandardStyleLocationsExample.swift +++ b/Apps/Examples/Examples/SwiftUI Examples/StandardStyleLocationsExample.swift @@ -1,7 +1,6 @@ import MapboxMaps import SwiftUI -@available(iOS 14.0, *) struct StandardStyleLocationsExample: View { /// This model is created in root application views for each platform: /// @@ -70,7 +69,6 @@ struct StandardStyleLocationsExample: View { } } -@available(iOS 14.0, *) class StandardStyleLocationsModel: ObservableObject { @Published var lightPreset: StandardLightPreset = .day @Published var poi = true @@ -112,7 +110,6 @@ class StandardStyleLocationsModel: ObservableObject { } } -@available(iOS 14.0, *) struct StandardStyleLocationsSettings: View { @EnvironmentObject var model: StandardStyleLocationsModel var body: some View { @@ -204,7 +201,6 @@ struct StandardStyleLocationsSettings: View { } -@available(iOS 13.0, *) private struct SelectorView: View where T: RandomAccessCollection, T.Element: Identifiable, Content: View { var data: T @Binding @@ -247,7 +243,6 @@ private struct Pair { } extension Pair: Equatable where First: Equatable, Second: Equatable {} -@available(iOS 14.0, *) struct StandardStyleLocationsExample_Previews: PreviewProvider { static var previews: some View { StandardStyleLocationsExample() diff --git a/Apps/Examples/Examples/SwiftUI Examples/SwiftUIRoot.swift b/Apps/Examples/Examples/SwiftUI Examples/SwiftUIRoot.swift index c6747a854ef9..cccfd6f0aef9 100644 --- a/Apps/Examples/Examples/SwiftUI Examples/SwiftUIRoot.swift +++ b/Apps/Examples/Examples/SwiftUI Examples/SwiftUIRoot.swift @@ -2,7 +2,6 @@ import SwiftUI import UIKit import MapboxMaps -@available(iOS 14.0, *) struct SwiftUIRoot: View { var body: some View { ExamplesNavigationView { @@ -66,7 +65,6 @@ struct SwiftUIRoot: View { } } -@available(iOS 14.0, *) struct ExampleLink: View where S: StringProtocol, Destination: View { var title: S var note: S? @@ -90,7 +88,6 @@ struct ExampleLink: View where S: StringProtocol, Destination: V } } -@available(iOS 14.0, *) private struct ToolbarContentWhenPresented: ViewModifier { @Environment(\.presentationMode) var presentationMode var toolbarContent: (@escaping () -> Void) -> T @@ -105,7 +102,6 @@ private struct ToolbarContentWhenPresented: ViewModifier { } } -@available(iOS 14.0, *) struct SwiftUIWrapper: View { // A model for StandardStyleLocationsExample. @StateObject var locationsModel = StandardStyleLocationsModel() @@ -115,7 +111,6 @@ struct SwiftUIWrapper: View { } } -@available(iOS 14.0, *) func createSwiftUIExamplesController() -> UIViewController { let controller = UIHostingController(rootView: SwiftUIWrapper()) controller.title = title @@ -123,7 +118,6 @@ func createSwiftUIExamplesController() -> UIViewController { return controller } -@available(iOS 14.0, *) struct ExamplesNavigationView: View where Content: View { let content: Content @@ -146,7 +140,6 @@ struct ExamplesNavigationView: View where Content: View { } } -@available(iOS 14.0, *) struct ExampleView: View where Content: View { @State private var isNavigationBarHidden = false let content: Content diff --git a/Apps/Examples/Examples/SwiftUI Examples/Testing Examples/AnnotationsOrderTestExample.swift b/Apps/Examples/Examples/SwiftUI Examples/Testing Examples/AnnotationsOrderTestExample.swift index 7876c44413cb..b8a08e795f4e 100644 --- a/Apps/Examples/Examples/SwiftUI Examples/Testing Examples/AnnotationsOrderTestExample.swift +++ b/Apps/Examples/Examples/SwiftUI Examples/Testing Examples/AnnotationsOrderTestExample.swift @@ -1,7 +1,6 @@ @_spi(Experimental) import MapboxMaps import SwiftUI -@available(iOS 14.0, *) struct AnnotationsOrderTestExample: View { @State var bluePolygon = true @State var greenPolygon = true @@ -96,7 +95,6 @@ struct AnnotationsOrderTestExample: View { } } -@available(iOS 14.0, *) struct AnnotationsContent: MapContent { let bluePolygon: Bool let greenPolygon: Bool @@ -142,7 +140,6 @@ struct AnnotationsContent: MapContent { } } -@available(iOS 14.0, *) struct TestContent: MapContent { let redPolygon: Bool @@ -163,7 +160,6 @@ struct TestContent: MapContent { } } -@available(iOS 14.0, *) struct PolygonContent: MapContent { let polygon: Polygon let color: UIColor @@ -187,13 +183,11 @@ struct PolygonContent: MapContent { } } -@available(iOS 13.0, *) private struct Tap: Equatable, Identifiable { var id = UUID() var coordinate: CLLocationCoordinate2D } -@available(iOS 14.0, *) private struct TapsContent: MapContent { var taps: [Tap] @@ -214,7 +208,6 @@ private struct TapsContent: MapContent { } } -@available(iOS 13.0, *) private struct TestLayer: MapStyleContent { var id: String var radius: LocationDistance @@ -235,7 +228,6 @@ private struct TestLayer: MapStyleContent { } } -@available(iOS 13.0, *) private struct FadingCircle: MapStyleContent { var body: some MapStyleContent { GeoJSONSource(id: "source-id") @@ -254,7 +246,6 @@ private func gestureMessage(_ label: String, context: InteractionContext) -> Str return "\(label) (\(coordinate))" } -@available(iOS 14.0, *) private struct ColorButton: View { let color1: UIColor let color2: UIColor diff --git a/Apps/Examples/Examples/SwiftUI Examples/Testing Examples/AttributionDialogueExamples.swift b/Apps/Examples/Examples/SwiftUI Examples/Testing Examples/AttributionDialogueExamples.swift index 4ba925755c70..bb7502745495 100644 --- a/Apps/Examples/Examples/SwiftUI Examples/Testing Examples/AttributionDialogueExamples.swift +++ b/Apps/Examples/Examples/SwiftUI Examples/Testing Examples/AttributionDialogueExamples.swift @@ -1,7 +1,6 @@ import SwiftUI import MapboxMaps -@available(iOS 15, *) struct AttributionEnvironmentURLOpen: View { @State private var alert: String? var body: some View { @@ -31,7 +30,6 @@ struct AttributionDialogueWithSheet: View { } } -@available(iOS 13, *) struct AttributionManualURLOpen: View { @State private var alert: String? var body: some View { diff --git a/Apps/Examples/Examples/SwiftUI Examples/Testing Examples/InteractionsPlayground.swift b/Apps/Examples/Examples/SwiftUI Examples/Testing Examples/InteractionsPlayground.swift index 6cea7bc2fa71..34b09107586d 100644 --- a/Apps/Examples/Examples/SwiftUI Examples/Testing Examples/InteractionsPlayground.swift +++ b/Apps/Examples/Examples/SwiftUI Examples/Testing Examples/InteractionsPlayground.swift @@ -1,7 +1,6 @@ @_spi(Experimental) import MapboxMaps import SwiftUI -@available(iOS 14.0, *) struct InteractionsPlayground: View { @State private var text: String? @State private var tap: Tap? @@ -140,7 +139,6 @@ private struct Tap { var radius: Double? } -@available(iOS 14.0, *) private struct TapView: View { var tap: Tap var color: Color diff --git a/Apps/Examples/Examples/SwiftUI Examples/Testing Examples/MapScrollExample.swift b/Apps/Examples/Examples/SwiftUI Examples/Testing Examples/MapScrollExample.swift index 35bb6901c0d0..f5ee46943d82 100644 --- a/Apps/Examples/Examples/SwiftUI Examples/Testing Examples/MapScrollExample.swift +++ b/Apps/Examples/Examples/SwiftUI Examples/Testing Examples/MapScrollExample.swift @@ -2,7 +2,6 @@ import Foundation import SwiftUI import MapboxMaps -@available(iOS 14.0, *) struct MapScrollExample: View { var body: some View { List { @@ -20,7 +19,6 @@ struct MapScrollExample: View { } } -@available(iOS 14.0, *) struct MapScrollExample_Previews: PreviewProvider { static var previews: some View { MapScrollExample() diff --git a/Apps/Examples/Examples/SwiftUI Examples/Testing Examples/MapSettingsExample.swift b/Apps/Examples/Examples/SwiftUI Examples/Testing Examples/MapSettingsExample.swift index 067b73cb8741..07fb081790b2 100644 --- a/Apps/Examples/Examples/SwiftUI Examples/Testing Examples/MapSettingsExample.swift +++ b/Apps/Examples/Examples/SwiftUI Examples/Testing Examples/MapSettingsExample.swift @@ -27,7 +27,6 @@ struct Settings { } } -@available(iOS 14.0, *) struct MapSettingsExample: View { @State private var settingsOpened = false @State private var settings = Settings() @@ -82,7 +81,6 @@ struct MapSettingsExample: View { } } -@available(iOS 14.0, *) struct SettingsView: View { @Binding var settings: Settings #if os(visionOS) @@ -175,7 +173,6 @@ struct SettingsView: View { } } -@available(iOS 13.0, *) private extension Binding where Value: OptionSet { func contains(option: Value.Element) -> Binding { Binding { @@ -191,7 +188,6 @@ private extension Binding where Value: OptionSet { } } -@available(iOS 15.0, *) struct MapSettingsExample_Preveiw: PreviewProvider { static var previews: some View { NavigationView { diff --git a/Apps/Examples/Examples/SwiftUI Examples/Testing Examples/PuckPlayground.swift b/Apps/Examples/Examples/SwiftUI Examples/Testing Examples/PuckPlayground.swift index d56653e6a40f..ccbe66b6a319 100644 --- a/Apps/Examples/Examples/SwiftUI Examples/Testing Examples/PuckPlayground.swift +++ b/Apps/Examples/Examples/SwiftUI Examples/Testing Examples/PuckPlayground.swift @@ -1,7 +1,6 @@ import SwiftUI import MapboxMaps -@available(iOS 14.0, *) struct PuckPlayground: View { enum PuckType: String, CaseIterable, CustomStringConvertible { case d2 @@ -120,7 +119,6 @@ struct PuckPlayground: View { } } -@available(iOS 13.0, *) private struct RadioButtonSettingView: View where Value: CaseIterable, Value: Hashable, Value.AllCases: RandomAccessCollection { var title: String @@ -138,7 +136,6 @@ private struct RadioButtonSettingView: View } } -@available(iOS 13.0, *) private struct SliderSettingView: View { var title: String @Binding var value: Double @@ -237,14 +234,12 @@ private extension Model { ) } -@available(iOS 14.0, *) struct PuckPlayground_Preview: PreviewProvider { static var previews: some View { PuckPlayground() } } -@available(iOS 13.0, *) private struct TestLayer: MapStyleContent { var id: String var radius: LocationDistance diff --git a/Apps/Examples/Examples/SwiftUI Examples/Testing Examples/SimpleMapExample.swift b/Apps/Examples/Examples/SwiftUI Examples/Testing Examples/SimpleMapExample.swift index d0be80de5fec..462b1b4d41d1 100644 --- a/Apps/Examples/Examples/SwiftUI Examples/Testing Examples/SimpleMapExample.swift +++ b/Apps/Examples/Examples/SwiftUI Examples/Testing Examples/SimpleMapExample.swift @@ -1,7 +1,6 @@ import SwiftUI import MapboxMaps -@available(iOS 14.0, *) struct SimpleMapExample: View { @Environment(\.colorScheme) var colorScheme @@ -13,7 +12,6 @@ struct SimpleMapExample: View { } } -@available(iOS 14.0, *) struct SimpleMapExample_Previews: PreviewProvider { static var previews: some View { SimpleMapExample() diff --git a/Apps/Examples/Examples/SwiftUI Examples/Testing Examples/ViewportPlayground.swift b/Apps/Examples/Examples/SwiftUI Examples/Testing Examples/ViewportPlayground.swift index 44ba225c2b6a..901cbfd3ee21 100644 --- a/Apps/Examples/Examples/SwiftUI Examples/Testing Examples/ViewportPlayground.swift +++ b/Apps/Examples/Examples/SwiftUI Examples/Testing Examples/ViewportPlayground.swift @@ -1,7 +1,6 @@ import SwiftUI import MapboxMaps -@available(iOS 14.0, *) struct ViewportPlayground: View { @State var viewport: Viewport = .styleDefault @State var mapStyle: MapStyle = .standard @@ -101,7 +100,6 @@ struct ViewportPlayground: View { } } -@available(iOS 13.0, *) private struct MiniToggle: View { var title: String @Binding var isOn: Bool @@ -116,7 +114,6 @@ private struct MiniToggle: View { } } -@available(iOS 14.0, *) private struct ViewportMenu: View { @Binding var viewport: Viewport @@ -232,7 +229,6 @@ private let maineBoundaries = Polygon([[ CLLocationCoordinate2D(latitude: 45.13745, longitude: -67.13734) ]]) -@available(iOS 14.0, *) struct MapViewportExample_Previews: PreviewProvider { static var previews: some View { NavigationView { diff --git a/Apps/Examples/Examples/SwiftUI Examples/Util/ButtonStyle.swift b/Apps/Examples/Examples/SwiftUI Examples/Util/ButtonStyle.swift index f2e72fab5ea2..3b699da1614a 100644 --- a/Apps/Examples/Examples/SwiftUI Examples/Util/ButtonStyle.swift +++ b/Apps/Examples/Examples/SwiftUI Examples/Util/ButtonStyle.swift @@ -1,7 +1,6 @@ import SwiftUI import MapboxMaps -@available(iOS 14.0, *) struct MapFloatingButtonStyle: ButtonStyle { @ViewBuilder func makeBody(configuration: Configuration) -> some View { @@ -14,7 +13,6 @@ struct MapFloatingButtonStyle: ButtonStyle { } } -@available(iOS 14.0, *) struct FloatingStyle : ViewModifier { var padding: CGFloat var shape: S @@ -28,7 +26,6 @@ struct FloatingStyle : ViewModifier { } } -@available(iOS 13.0, *) extension View { @ViewBuilder func regularMaterialBackground() -> some View { @@ -40,7 +37,6 @@ extension View { } } -@available(iOS 14.0, *) extension View { func floating(padding: CGFloat = 5, _ shape: S) -> some View where S: Shape { modifier(FloatingStyle(padding: padding, shape: shape)) @@ -51,7 +47,6 @@ extension View { } } -@available(iOS 14.0, *) struct MapStyleSelectorButton: View { @Binding var mapStyle: MapStyle var styles: [(String, MapStyle)] = [ diff --git a/Apps/Examples/Examples/SwiftUI Examples/Util/CalloutView.swift b/Apps/Examples/Examples/SwiftUI Examples/Util/CalloutView.swift index fdfb4d194cd7..78bf52f270ba 100644 --- a/Apps/Examples/Examples/SwiftUI Examples/Util/CalloutView.swift +++ b/Apps/Examples/Examples/SwiftUI Examples/Util/CalloutView.swift @@ -1,14 +1,12 @@ import SwiftUI import MapboxMaps -@available(iOS 14.0, *) extension View { func callout(anchor: ViewAnnotationAnchor, color: Color, tailSize: Double = 8.0) -> some View { modifier(CalloutViewModifier(anchor: anchor, color: color, tailSize: tailSize)) } } -@available(iOS 14.0, *) struct CalloutViewModifier: ViewModifier { var anchor: ViewAnnotationAnchor var color: Color @@ -26,7 +24,6 @@ struct CalloutViewModifier: ViewModifier { } } -@available(iOS 14.0, *) struct CalloutShape: Shape { var anchor: ViewAnnotationAnchor var tailSize: CGFloat diff --git a/Apps/Examples/Examples/SwiftUI Examples/Util/PinView.swift b/Apps/Examples/Examples/SwiftUI Examples/Util/PinView.swift index b1bead5f3ac7..d96466225bfd 100644 --- a/Apps/Examples/Examples/SwiftUI Examples/Util/PinView.swift +++ b/Apps/Examples/Examples/SwiftUI Examples/Util/PinView.swift @@ -1,6 +1,5 @@ import SwiftUI -@available(iOS 13.0, *) struct PinView: View { var text: String var type: String? diff --git a/Apps/Examples/Examples/SwiftUI Examples/Util/View+OnShake.swift b/Apps/Examples/Examples/SwiftUI Examples/Util/View+OnShake.swift index 8f3bccb32811..024e485e377d 100644 --- a/Apps/Examples/Examples/SwiftUI Examples/Util/View+OnShake.swift +++ b/Apps/Examples/Examples/SwiftUI Examples/Util/View+OnShake.swift @@ -9,7 +9,6 @@ extension UIWindow { } } -@available(iOS 13.0, *) struct DeviceShakeViewModifier: ViewModifier { let action: () -> Void @@ -22,7 +21,6 @@ struct DeviceShakeViewModifier: ViewModifier { } } -@available(iOS 13.0, *) extension View { func onShake(perform action: @escaping () -> Void) -> some View { modifier(DeviceShakeViewModifier(action: action)) diff --git a/Apps/Examples/Examples/SwiftUI Examples/Util/ViewExtensions.swift b/Apps/Examples/Examples/SwiftUI Examples/Util/ViewExtensions.swift index 22ee44f00b3e..4dc0ad9c34d6 100644 --- a/Apps/Examples/Examples/SwiftUI Examples/Util/ViewExtensions.swift +++ b/Apps/Examples/Examples/SwiftUI Examples/Util/ViewExtensions.swift @@ -1,6 +1,5 @@ import SwiftUI -@available(iOS 14.0, *) extension View { @ViewBuilder func safeOverlay(alignment: Alignment, @ViewBuilder content: () -> V) -> some View { @@ -60,12 +59,10 @@ extension View { } } -@available(iOS 14.0, *) extension Font { static let safeMonospaced: Font = .system(.footnote, design: .monospaced) } -@available(iOS 13.0, *) extension Color { /// Utility helper for visually debug SwiftUI's draw calls. /// @@ -76,7 +73,6 @@ extension Color { } } -@available(iOS 13.0, *) extension View { func fixedMenuOrder() -> some View { if #available(iOS 16.0, *) { @@ -87,7 +83,6 @@ extension View { } } -@available(iOS 13.0, *) extension View { func simpleAlert(message: Binding, title: String = "Alert") -> some View { return alert(item: message) { item in @@ -100,14 +95,12 @@ extension String: Identifiable { public var id: String { self } } -@available(iOS 13.0, *) extension View { func onChangeOfSize(perform action: @escaping (CGSize) -> Void) -> some View { modifier(OnSizeChangeModifier(action: action)) } } -@available(iOS 13.0, *) private struct OnSizeChangeModifier: ViewModifier { let action: (CGSize) -> Void diff --git a/Apps/Examples/Examples/SwiftUI Examples/ViewAnnotationsExample.swift b/Apps/Examples/Examples/SwiftUI Examples/ViewAnnotationsExample.swift index 64e3a82a659e..0436d8e13783 100644 --- a/Apps/Examples/Examples/SwiftUI Examples/ViewAnnotationsExample.swift +++ b/Apps/Examples/Examples/SwiftUI Examples/ViewAnnotationsExample.swift @@ -2,7 +2,6 @@ import SwiftUI import Turf import MapboxMaps -@available(iOS 14.0, *) struct ViewAnnotationsExample: View { @State private var taps: [Tap] = [] @State private var allowOverlap: Bool = false @@ -105,7 +104,6 @@ struct ViewAnnotationsExample: View { } } -@available(iOS 13.0, *) private struct Tap: Equatable, Identifiable { var id = UUID() var coordinate: CLLocationCoordinate2D @@ -113,7 +111,6 @@ private struct Tap: Equatable, Identifiable { var selectedAnchor: ViewAnnotationAnchorConfig? } -@available(iOS 14.0, *) private struct ViewAnnotationContent: View { var tap: Tap var onRemove: () -> Void @@ -164,7 +161,6 @@ private let routeCoordinates: [CLLocationCoordinate2D] = [ .init(latitude: 60.4538050749446, longitude: 22.270812516066485) ] -@available(iOS 14.0, *) struct ViewAnnotationsExample_Previews: PreviewProvider { static var previews: some View { ViewAnnotationsExample() diff --git a/Apps/Examples/Examples/SwiftUI Examples/WeatherAnnotationExample.swift b/Apps/Examples/Examples/SwiftUI Examples/WeatherAnnotationExample.swift index b057508a618b..2b4fd3511649 100644 --- a/Apps/Examples/Examples/SwiftUI Examples/WeatherAnnotationExample.swift +++ b/Apps/Examples/Examples/SwiftUI Examples/WeatherAnnotationExample.swift @@ -8,7 +8,6 @@ private struct WeatherData: Identifiable, Equatable { let iconName: String } -@available(iOS 14.0, *) struct WeatherAnnotationExample: View { @State private var viewport: Viewport = .camera(center: .berlin, zoom: 1.5) @@ -38,7 +37,6 @@ struct WeatherAnnotationExample: View { } } -@available(iOS 14.0, *) private struct WeatherIconView: View { var data: WeatherData @Binding var selectedData: WeatherData? @@ -75,7 +73,6 @@ private struct WeatherIconView: View { } } } -@available(iOS 14.0, *) struct WeatherAnnotationExample_Preview: PreviewProvider { static var previews: some View { diff --git a/xcodegen/Examples.yml b/xcodegen/Examples.yml index 84a97745e29d..ba8bfa668972 100644 --- a/xcodegen/Examples.yml +++ b/xcodegen/Examples.yml @@ -13,6 +13,7 @@ targets: settings: base: PRODUCT_BUNDLE_IDENTIFIER: com.mapbox.examples + IPHONEOS_DEPLOYMENT_TARGET: 16.0 SWIFT_OBJC_BRIDGING_HEADER: $(MAPBOXMAPS_PATH)/Apps/Examples/Examples/Examples-Bridging-Header.h sources: - path: ../Apps/Examples/Examples @@ -55,6 +56,7 @@ targets: base: GENERATE_INFOPLIST_FILE: YES PRODUCT_BUNDLE_IDENTIFIER: "com.mapbox.MapboxTests" + IPHONEOS_DEPLOYMENT_TARGET: 16.0 sources: - path: ../Tests/ExamplesTests destinationFilters: [iOS] # no-op on visionOS @@ -69,6 +71,7 @@ targets: base: GENERATE_INFOPLIST_FILE: YES PRODUCT_BUNDLE_IDENTIFIER: "mapbox.ExamplesUITests" + IPHONEOS_DEPLOYMENT_TARGET: 16.0 sources: - path: ../Tests/ExamplesUITests destinationFilters: [iOS] # no-op on visionOS