diff --git a/ios-offline-maps/ios-offline-maps.xcodeproj/project.pbxproj b/ios-offline-maps/ios-offline-maps.xcodeproj/project.pbxproj new file mode 100644 index 0000000..b6480bd --- /dev/null +++ b/ios-offline-maps/ios-offline-maps.xcodeproj/project.pbxproj @@ -0,0 +1,598 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 77; + objects = { + +/* Begin PBXBuildFile section */ + D34C4E6B2E4CD3B300A2F682 /* MapboxMaps in Frameworks */ = {isa = PBXBuildFile; productRef = D34C4E6A2E4CD3B300A2F682 /* MapboxMaps */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + D34C4E472E4CD31B00A2F682 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = D34C4E312E4CD31900A2F682 /* Project object */; + proxyType = 1; + remoteGlobalIDString = D34C4E382E4CD31900A2F682; + remoteInfo = "ios-offline-maps"; + }; + D34C4E512E4CD31B00A2F682 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = D34C4E312E4CD31900A2F682 /* Project object */; + proxyType = 1; + remoteGlobalIDString = D34C4E382E4CD31900A2F682; + remoteInfo = "ios-offline-maps"; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + D34C4E392E4CD31900A2F682 /* ios-offline-maps.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "ios-offline-maps.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + D34C4E462E4CD31B00A2F682 /* ios-offline-mapsTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "ios-offline-mapsTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; + D34C4E502E4CD31B00A2F682 /* ios-offline-mapsUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "ios-offline-mapsUITests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; +/* End PBXFileReference section */ + +/* Begin PBXFileSystemSynchronizedBuildFileExceptionSet section */ + D34C4E6D2E4CD42100A2F682 /* Exceptions for "ios-offline-maps" folder in "ios-offline-maps" target */ = { + isa = PBXFileSystemSynchronizedBuildFileExceptionSet; + membershipExceptions = ( + Info.plist, + ); + target = D34C4E382E4CD31900A2F682 /* ios-offline-maps */; + }; +/* End PBXFileSystemSynchronizedBuildFileExceptionSet section */ + +/* Begin PBXFileSystemSynchronizedRootGroup section */ + D34C4E3B2E4CD31900A2F682 /* ios-offline-maps */ = { + isa = PBXFileSystemSynchronizedRootGroup; + exceptions = ( + D34C4E6D2E4CD42100A2F682 /* Exceptions for "ios-offline-maps" folder in "ios-offline-maps" target */, + ); + path = "ios-offline-maps"; + sourceTree = ""; + }; + D34C4E492E4CD31B00A2F682 /* ios-offline-mapsTests */ = { + isa = PBXFileSystemSynchronizedRootGroup; + path = "ios-offline-mapsTests"; + sourceTree = ""; + }; + D34C4E532E4CD31B00A2F682 /* ios-offline-mapsUITests */ = { + isa = PBXFileSystemSynchronizedRootGroup; + path = "ios-offline-mapsUITests"; + sourceTree = ""; + }; +/* End PBXFileSystemSynchronizedRootGroup section */ + +/* Begin PBXFrameworksBuildPhase section */ + D34C4E362E4CD31900A2F682 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + D34C4E6B2E4CD3B300A2F682 /* MapboxMaps in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + D34C4E432E4CD31B00A2F682 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + D34C4E4D2E4CD31B00A2F682 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + D34C4E302E4CD31900A2F682 = { + isa = PBXGroup; + children = ( + D34C4E3B2E4CD31900A2F682 /* ios-offline-maps */, + D34C4E492E4CD31B00A2F682 /* ios-offline-mapsTests */, + D34C4E532E4CD31B00A2F682 /* ios-offline-mapsUITests */, + D34C4E3A2E4CD31900A2F682 /* Products */, + ); + sourceTree = ""; + }; + D34C4E3A2E4CD31900A2F682 /* Products */ = { + isa = PBXGroup; + children = ( + D34C4E392E4CD31900A2F682 /* ios-offline-maps.app */, + D34C4E462E4CD31B00A2F682 /* ios-offline-mapsTests.xctest */, + D34C4E502E4CD31B00A2F682 /* ios-offline-mapsUITests.xctest */, + ); + name = Products; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + D34C4E382E4CD31900A2F682 /* ios-offline-maps */ = { + isa = PBXNativeTarget; + buildConfigurationList = D34C4E5A2E4CD31B00A2F682 /* Build configuration list for PBXNativeTarget "ios-offline-maps" */; + buildPhases = ( + D34C4E352E4CD31900A2F682 /* Sources */, + D34C4E362E4CD31900A2F682 /* Frameworks */, + D34C4E372E4CD31900A2F682 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + fileSystemSynchronizedGroups = ( + D34C4E3B2E4CD31900A2F682 /* ios-offline-maps */, + ); + name = "ios-offline-maps"; + packageProductDependencies = ( + D34C4E6A2E4CD3B300A2F682 /* MapboxMaps */, + ); + productName = "ios-offline-maps"; + productReference = D34C4E392E4CD31900A2F682 /* ios-offline-maps.app */; + productType = "com.apple.product-type.application"; + }; + D34C4E452E4CD31B00A2F682 /* ios-offline-mapsTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = D34C4E5D2E4CD31B00A2F682 /* Build configuration list for PBXNativeTarget "ios-offline-mapsTests" */; + buildPhases = ( + D34C4E422E4CD31B00A2F682 /* Sources */, + D34C4E432E4CD31B00A2F682 /* Frameworks */, + D34C4E442E4CD31B00A2F682 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + D34C4E482E4CD31B00A2F682 /* PBXTargetDependency */, + ); + fileSystemSynchronizedGroups = ( + D34C4E492E4CD31B00A2F682 /* ios-offline-mapsTests */, + ); + name = "ios-offline-mapsTests"; + packageProductDependencies = ( + ); + productName = "ios-offline-mapsTests"; + productReference = D34C4E462E4CD31B00A2F682 /* ios-offline-mapsTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; + D34C4E4F2E4CD31B00A2F682 /* ios-offline-mapsUITests */ = { + isa = PBXNativeTarget; + buildConfigurationList = D34C4E602E4CD31B00A2F682 /* Build configuration list for PBXNativeTarget "ios-offline-mapsUITests" */; + buildPhases = ( + D34C4E4C2E4CD31B00A2F682 /* Sources */, + D34C4E4D2E4CD31B00A2F682 /* Frameworks */, + D34C4E4E2E4CD31B00A2F682 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + D34C4E522E4CD31B00A2F682 /* PBXTargetDependency */, + ); + fileSystemSynchronizedGroups = ( + D34C4E532E4CD31B00A2F682 /* ios-offline-mapsUITests */, + ); + name = "ios-offline-mapsUITests"; + packageProductDependencies = ( + ); + productName = "ios-offline-mapsUITests"; + productReference = D34C4E502E4CD31B00A2F682 /* ios-offline-mapsUITests.xctest */; + productType = "com.apple.product-type.bundle.ui-testing"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + D34C4E312E4CD31900A2F682 /* Project object */ = { + isa = PBXProject; + attributes = { + BuildIndependentTargetsInParallel = 1; + LastSwiftUpdateCheck = 1640; + LastUpgradeCheck = 1640; + TargetAttributes = { + D34C4E382E4CD31900A2F682 = { + CreatedOnToolsVersion = 16.4; + }; + D34C4E452E4CD31B00A2F682 = { + CreatedOnToolsVersion = 16.4; + TestTargetID = D34C4E382E4CD31900A2F682; + }; + D34C4E4F2E4CD31B00A2F682 = { + CreatedOnToolsVersion = 16.4; + TestTargetID = D34C4E382E4CD31900A2F682; + }; + }; + }; + buildConfigurationList = D34C4E342E4CD31900A2F682 /* Build configuration list for PBXProject "ios-offline-maps" */; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = D34C4E302E4CD31900A2F682; + minimizedProjectReferenceProxies = 1; + packageReferences = ( + D34C4E692E4CD3B300A2F682 /* XCRemoteSwiftPackageReference "mapbox-maps-ios" */, + ); + preferredProjectObjectVersion = 77; + productRefGroup = D34C4E3A2E4CD31900A2F682 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + D34C4E382E4CD31900A2F682 /* ios-offline-maps */, + D34C4E452E4CD31B00A2F682 /* ios-offline-mapsTests */, + D34C4E4F2E4CD31B00A2F682 /* ios-offline-mapsUITests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + D34C4E372E4CD31900A2F682 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + D34C4E442E4CD31B00A2F682 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + D34C4E4E2E4CD31B00A2F682 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + D34C4E352E4CD31900A2F682 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + D34C4E422E4CD31B00A2F682 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + D34C4E4C2E4CD31B00A2F682 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + D34C4E482E4CD31B00A2F682 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = D34C4E382E4CD31900A2F682 /* ios-offline-maps */; + targetProxy = D34C4E472E4CD31B00A2F682 /* PBXContainerItemProxy */; + }; + D34C4E522E4CD31B00A2F682 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = D34C4E382E4CD31900A2F682 /* ios-offline-maps */; + targetProxy = D34C4E512E4CD31B00A2F682 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin XCBuildConfiguration section */ + D34C4E582E4CD31B00A2F682 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + ENABLE_USER_SCRIPT_SANDBOXING = YES; + GCC_C_LANGUAGE_STANDARD = gnu17; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 18.5; + LOCALIZATION_PREFERS_STRING_CATALOGS = YES; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(inherited)"; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + D34C4E592E4CD31B00A2F682 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_USER_SCRIPT_SANDBOXING = YES; + GCC_C_LANGUAGE_STANDARD = gnu17; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 18.5; + LOCALIZATION_PREFERS_STRING_CATALOGS = YES; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + SDKROOT = iphoneos; + SWIFT_COMPILATION_MODE = wholemodule; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + D34C4E5B2E4CD31B00A2F682 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + ENABLE_PREVIEWS = YES; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_FILE = "ios-offline-maps/Info.plist"; + INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES; + INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; + INFOPLIST_KEY_UILaunchScreen_Generation = YES; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = "me.ios-offline-maps"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + D34C4E5C2E4CD31B00A2F682 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + ENABLE_PREVIEWS = YES; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_FILE = "ios-offline-maps/Info.plist"; + INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES; + INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; + INFOPLIST_KEY_UILaunchScreen_Generation = YES; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = "me.ios-offline-maps"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; + D34C4E5E2E4CD31B00A2F682 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 18.5; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = "me.ios-offline-mapsTests"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_EMIT_LOC_STRINGS = NO; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/ios-offline-maps.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/ios-offline-maps"; + }; + name = Debug; + }; + D34C4E5F2E4CD31B00A2F682 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 18.5; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = "me.ios-offline-mapsTests"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_EMIT_LOC_STRINGS = NO; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/ios-offline-maps.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/ios-offline-maps"; + }; + name = Release; + }; + D34C4E612E4CD31B00A2F682 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = "me.ios-offline-mapsUITests"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_EMIT_LOC_STRINGS = NO; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + TEST_TARGET_NAME = "ios-offline-maps"; + }; + name = Debug; + }; + D34C4E622E4CD31B00A2F682 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = "me.ios-offline-mapsUITests"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_EMIT_LOC_STRINGS = NO; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + TEST_TARGET_NAME = "ios-offline-maps"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + D34C4E342E4CD31900A2F682 /* Build configuration list for PBXProject "ios-offline-maps" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + D34C4E582E4CD31B00A2F682 /* Debug */, + D34C4E592E4CD31B00A2F682 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + D34C4E5A2E4CD31B00A2F682 /* Build configuration list for PBXNativeTarget "ios-offline-maps" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + D34C4E5B2E4CD31B00A2F682 /* Debug */, + D34C4E5C2E4CD31B00A2F682 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + D34C4E5D2E4CD31B00A2F682 /* Build configuration list for PBXNativeTarget "ios-offline-mapsTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + D34C4E5E2E4CD31B00A2F682 /* Debug */, + D34C4E5F2E4CD31B00A2F682 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + D34C4E602E4CD31B00A2F682 /* Build configuration list for PBXNativeTarget "ios-offline-mapsUITests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + D34C4E612E4CD31B00A2F682 /* Debug */, + D34C4E622E4CD31B00A2F682 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + +/* Begin XCRemoteSwiftPackageReference section */ + D34C4E692E4CD3B300A2F682 /* XCRemoteSwiftPackageReference "mapbox-maps-ios" */ = { + isa = XCRemoteSwiftPackageReference; + repositoryURL = "https://github.com/mapbox/mapbox-maps-ios.git"; + requirement = { + kind = upToNextMajorVersion; + minimumVersion = 11.0.0; + }; + }; +/* End XCRemoteSwiftPackageReference section */ + +/* Begin XCSwiftPackageProductDependency section */ + D34C4E6A2E4CD3B300A2F682 /* MapboxMaps */ = { + isa = XCSwiftPackageProductDependency; + package = D34C4E692E4CD3B300A2F682 /* XCRemoteSwiftPackageReference "mapbox-maps-ios" */; + productName = MapboxMaps; + }; +/* End XCSwiftPackageProductDependency section */ + }; + rootObject = D34C4E312E4CD31900A2F682 /* Project object */; +} diff --git a/ios-offline-maps/ios-offline-maps.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/ios-offline-maps/ios-offline-maps.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..919434a --- /dev/null +++ b/ios-offline-maps/ios-offline-maps.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/ios-offline-maps/ios-offline-maps.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/ios-offline-maps/ios-offline-maps.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved new file mode 100644 index 0000000..5fd0eed --- /dev/null +++ b/ios-offline-maps/ios-offline-maps.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -0,0 +1,42 @@ +{ + "originHash" : "c48d77ebe93e854e8e2b4bbddf1d5fe4977e5a87efa4e14ea29c90b3e5919e31", + "pins" : [ + { + "identity" : "mapbox-common-ios", + "kind" : "remoteSourceControl", + "location" : "https://github.com/mapbox/mapbox-common-ios.git", + "state" : { + "revision" : "0777f55b40516d5fd92ca9af980b86503c298df9", + "version" : "24.14.1" + } + }, + { + "identity" : "mapbox-core-maps-ios", + "kind" : "remoteSourceControl", + "location" : "https://github.com/mapbox/mapbox-core-maps-ios.git", + "state" : { + "revision" : "3ffa19caa306ad56b9156d8448b7087129cc1066", + "version" : "11.14.1" + } + }, + { + "identity" : "mapbox-maps-ios", + "kind" : "remoteSourceControl", + "location" : "https://github.com/mapbox/mapbox-maps-ios.git", + "state" : { + "revision" : "79a7e4a6ae885466a0e2e16cfc75cea6a22b1a39", + "version" : "11.14.1" + } + }, + { + "identity" : "turf-swift", + "kind" : "remoteSourceControl", + "location" : "https://github.com/mapbox/turf-swift.git", + "state" : { + "revision" : "bf840e6b9529d105687840fe2c9dcd74197d46d1", + "version" : "4.0.0" + } + } + ], + "version" : 3 +} diff --git a/ios-offline-maps/ios-offline-maps/Assets.xcassets/AccentColor.colorset/Contents.json b/ios-offline-maps/ios-offline-maps/Assets.xcassets/AccentColor.colorset/Contents.json new file mode 100644 index 0000000..eb87897 --- /dev/null +++ b/ios-offline-maps/ios-offline-maps/Assets.xcassets/AccentColor.colorset/Contents.json @@ -0,0 +1,11 @@ +{ + "colors" : [ + { + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/ios-offline-maps/ios-offline-maps/Assets.xcassets/AppIcon.appiconset/Contents.json b/ios-offline-maps/ios-offline-maps/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..2305880 --- /dev/null +++ b/ios-offline-maps/ios-offline-maps/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,35 @@ +{ + "images" : [ + { + "idiom" : "universal", + "platform" : "ios", + "size" : "1024x1024" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "idiom" : "universal", + "platform" : "ios", + "size" : "1024x1024" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "tinted" + } + ], + "idiom" : "universal", + "platform" : "ios", + "size" : "1024x1024" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/ios-offline-maps/ios-offline-maps/Assets.xcassets/Contents.json b/ios-offline-maps/ios-offline-maps/Assets.xcassets/Contents.json new file mode 100644 index 0000000..73c0059 --- /dev/null +++ b/ios-offline-maps/ios-offline-maps/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/ios-offline-maps/ios-offline-maps/Assets.xcassets/map_marker.imageset/Contents.json b/ios-offline-maps/ios-offline-maps/Assets.xcassets/map_marker.imageset/Contents.json new file mode 100644 index 0000000..a5a43a5 --- /dev/null +++ b/ios-offline-maps/ios-offline-maps/Assets.xcassets/map_marker.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "map_marker.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/ios-offline-maps/ios-offline-maps/Assets.xcassets/map_marker.imageset/map_marker.png b/ios-offline-maps/ios-offline-maps/Assets.xcassets/map_marker.imageset/map_marker.png new file mode 100644 index 0000000..be782e1 Binary files /dev/null and b/ios-offline-maps/ios-offline-maps/Assets.xcassets/map_marker.imageset/map_marker.png differ diff --git a/ios-offline-maps/ios-offline-maps/ContentView.swift b/ios-offline-maps/ios-offline-maps/ContentView.swift new file mode 100644 index 0000000..7a62bc9 --- /dev/null +++ b/ios-offline-maps/ios-offline-maps/ContentView.swift @@ -0,0 +1,55 @@ +// Import necessary frameworks for the app +import SwiftUI // For the user interface +import MapboxMaps // For map rendering and interaction +import CoreLocation + +struct ContentView: View { + @State private var showingDownloadView = false + + var body: some View { + ZStack { + // Map takes full screen as the base layer + MapReader { proxy in + Map(initialViewport: .camera( + center: CLLocationCoordinate2D( + latitude: 39.5, + longitude: -98.0 + ), + zoom: 2)) { + + + } + .mapStyle(.standard()) // Use the Mapbox Standard style + .onMapLoaded { event in + // Map is loaded and ready + print("Map loaded successfully") + } + } + + // Download button overlay + VStack { + HStack { + Spacer() + Button(action: { + showingDownloadView = true + }) { + HStack { + Image(systemName: "arrow.down.circle.fill") + Text("Manage Offline Regions") + } + .padding() + .background(Color.blue) + .foregroundColor(.white) + .cornerRadius(10) + .shadow(radius: 3) + } + .padding() + } + Spacer() + } + } + .sheet(isPresented: $showingDownloadView) { + TileRegionDownloadView() + } + } +} diff --git a/ios-offline-maps/ios-offline-maps/Info.plist b/ios-offline-maps/ios-offline-maps/Info.plist new file mode 100644 index 0000000..331db3f --- /dev/null +++ b/ios-offline-maps/ios-offline-maps/Info.plist @@ -0,0 +1,8 @@ + + + + + MBXAccessToken + YOUR_MAPBOX_ACCESS_TOKEN + + diff --git a/ios-offline-maps/ios-offline-maps/OfflineRegionManager.swift b/ios-offline-maps/ios-offline-maps/OfflineRegionManager.swift new file mode 100644 index 0000000..09ed16e --- /dev/null +++ b/ios-offline-maps/ios-offline-maps/OfflineRegionManager.swift @@ -0,0 +1,139 @@ +// +// OfflineRegionManager.swift +// simple-map-swiftui +// +// Created on 8/12/25. +// + +import Foundation +import MapboxMaps + +class OfflineRegionManager { + + private static var hasDownloadedStylePack = false + + static func ensureStylePackDownloaded() { + // Only download once per app session + if hasDownloadedStylePack { + return + } + + let offlineManager = OfflineManager() + + let stylePackLoadOptions = StylePackLoadOptions( + glyphsRasterizationMode: .ideographsRasterizedLocally, + metadata: ["name": "mapbox-standard-stylepack"], + acceptExpired: false + ) + + offlineManager.loadStylePack( + for: .standard, + loadOptions: stylePackLoadOptions! + ) { _ in } completion: { result in + switch result { + case let .success(stylePack): + // Style pack download finishes successfully + print("Downloaded style pack: \(stylePack)") + hasDownloadedStylePack = true + + case let .failure(error): + // Handle error occurred during the style pack download + if case StylePackError.canceled = error { + print("Style pack download cancelled") + } else { + print("Style pack download failed: \(error)") + } + } + } + } + + static func downloadRegion( + region: OfflineRegion, + downloadingRegions: Set, + onDownloadingRegionsUpdate: @escaping (Set) -> Void, + onProgress: @escaping (String, Float) -> Void, + onCompletion: @escaping (String, Result) -> Void + ) { + // Don't start if already downloading + if downloadingRegions.contains(region.id) { + return + } + + let tileStore = TileStore.default + let offlineManager = OfflineManager() + + // Create tileset descriptor + let tilesetDescriptor = offlineManager.createTilesetDescriptor( + for: TilesetDescriptorOptions( + styleURI: .standard, // get tiles for the Mapbox Standard style + zoomRange: 10...14, + tilesets: [] + ) + ) + + // Create load options using the region's polygon and metadata + let loadOptions = TileRegionLoadOptions( + geometry: .polygon(region.polygon), + descriptors: [tilesetDescriptor], + metadata: ["name": region.name], + acceptExpired: true + )! + + // Start downloading - notify UI to add to downloading set + var updatedDownloadingRegions = downloadingRegions + updatedDownloadingRegions.insert(region.id) + onDownloadingRegionsUpdate(updatedDownloadingRegions) + onProgress(region.id, 0.0) + + let _ = tileStore.loadTileRegion( + forId: region.id, + loadOptions: loadOptions + ) { progress in + let totalResources = max(progress.requiredResourceCount, 1) + let progressValue = Float(progress.completedResourceCount) / Float(totalResources) + onProgress(region.id, progressValue) + } completion: { result in + // Remove from downloading set and notify completion + updatedDownloadingRegions.remove(region.id) + onDownloadingRegionsUpdate(updatedDownloadingRegions) + onCompletion(region.id, result) + } + } + + static func clearAllRegions(onCompletion: @escaping () -> Void) { + let tileStore = TileStore.default + + // Get all tile regions from the store + tileStore.allTileRegions { result in + switch result { + case .success(let tileRegions): + // Remove each region found in the store + for tileRegion in tileRegions { + tileStore.removeRegion(forId: tileRegion.id) { removeResult in + switch removeResult { + case .success: + print("Removed region: \(tileRegion.id)") + case .failure(let error): + print("Failed to remove region \(tileRegion.id): \(error)") + } + } + } + + // Clear ambient cache after removing regions + tileStore.clearAmbientCache { cacheResult in + switch cacheResult { + case .success(let bytes): + print("Cleared \(bytes) bytes from cache") + case .failure(let error): + print("Failed to clear cache: \(error)") + } + onCompletion() + } + + case .failure(let error): + print("Failed to get tile regions: \(error)") + onCompletion() + } + } + } +} diff --git a/ios-offline-maps/ios-offline-maps/TileRegionDownloadView.swift b/ios-offline-maps/ios-offline-maps/TileRegionDownloadView.swift new file mode 100644 index 0000000..50246ca --- /dev/null +++ b/ios-offline-maps/ios-offline-maps/TileRegionDownloadView.swift @@ -0,0 +1,252 @@ +// +// TileRegionDownloadView.swift +// simple-map-swiftui +// +// Created on 8/12/25. +// + +import SwiftUI +import MapboxMaps + +// offline region configuration struct +struct OfflineRegion { + let id: String + let name: String + let bounds: CoordinateBounds + + // convert CoordinateBounds to Polygon + var polygon: Polygon { + let coordinates = [ + CLLocationCoordinate2D(latitude: bounds.southwest.latitude, longitude: bounds.southwest.longitude), + CLLocationCoordinate2D(latitude: bounds.southwest.latitude, longitude: bounds.northeast.longitude), + CLLocationCoordinate2D(latitude: bounds.northeast.latitude, longitude: bounds.northeast.longitude), + CLLocationCoordinate2D(latitude: bounds.northeast.latitude, longitude: bounds.southwest.longitude), + CLLocationCoordinate2D(latitude: bounds.southwest.latitude, longitude: bounds.southwest.longitude) + ] + return Polygon([coordinates]) + } +} + +struct TileRegionDownloadView: View { + @Environment(\.dismiss) private var dismiss + + // state to track downloads + @State private var downloadingRegions: Set = [] + @State private var downloadProgress: [String: Float] = [:] + @State private var refreshTrigger = false // Trigger to refresh row views + + // define regions + private let regions = [ + OfflineRegion( + id: "new-york-region", + name: "New York", + bounds: CoordinateBounds( + southwest: CLLocationCoordinate2D( + latitude: 40.48398, + longitude: -74.28127 + ), + northeast: CLLocationCoordinate2D( + latitude: 40.98701, + longitude: -73.58442 + ) + ) + ), + OfflineRegion( + id: "london-region", + name: "London", + bounds: CoordinateBounds( + southwest: CLLocationCoordinate2D(latitude: 51.4874, longitude: -0.1278), + northeast: CLLocationCoordinate2D(latitude: 51.5174, longitude: -0.0978) + ) + ), + OfflineRegion( + id: "paris-region", + name: "Paris", + bounds: CoordinateBounds( + southwest: CLLocationCoordinate2D(latitude: 48.8366, longitude: 2.3522), + northeast: CLLocationCoordinate2D(latitude: 48.8666, longitude: 2.3822) + ) + ) + ] + + var body: some View { + NavigationView { + VStack { + // Header + HStack { + Button(action: { + dismiss() + }) { + HStack { + Image(systemName: "chevron.left") + Text("Back") + } + .foregroundColor(.blue) + } + Spacer() + Text("Offline Regions") + .font(.title2) + .fontWeight(.semibold) + Spacer() + Button(action: { + clearAllRegions() + }) { + Text("Clear All") + .font(.caption) + .foregroundColor(.red) + } + } + .padding() + + // List of regions + List { + ForEach(regions, id: \.id) { region in + RegionRowView( + regionId: region.id, + regionName: region.name, + isDownloading: downloadingRegions.contains(region.id), + progress: downloadProgress[region.id] ?? 0.0, + refreshTrigger: refreshTrigger, + onDownload: { + downloadRegion(region: region) + } + ) + } + } + } + } + .navigationBarHidden(true) + } + + + private func downloadRegion(region: OfflineRegion) { + OfflineRegionManager.downloadRegion( + region: region, + downloadingRegions: downloadingRegions, + onDownloadingRegionsUpdate: { updatedSet in + DispatchQueue.main.async { + self.downloadingRegions = updatedSet + } + }, + onProgress: { regionId, progress in + DispatchQueue.main.async { + self.downloadProgress[regionId] = progress + } + }, + onCompletion: { regionId, result in + DispatchQueue.main.async { + // Remove progress tracking since download is complete + self.downloadProgress.removeValue(forKey: regionId) + + switch result { + case .success(let tileRegion): + print("Downloaded \(region.name): \(tileRegion.completedResourceSize) bytes") + case .failure(let error): + print("Failed to download \(region.name): \(error)") + } + } + } + ) + } + + private func clearAllRegions() { + OfflineRegionManager.clearAllRegions { + DispatchQueue.main.async { + // Reset UI state - this will trigger RegionRowView to refresh + self.downloadingRegions.removeAll() + self.downloadProgress.removeAll() + self.refreshTrigger.toggle() // Trigger refresh of all row views + } + } + } +} + +struct RegionRowView: View { + let regionId: String + let regionName: String + let isDownloading: Bool + let progress: Float + let refreshTrigger: Bool + let onDownload: () -> Void + + @State private var isDownloaded = false + @State private var sizeInMB: Double = 0.0 + + var body: some View { + HStack { + VStack(alignment: .leading, spacing: 4) { + Text(regionName) + .font(.headline) + + if isDownloaded { + Text("Downloaded • \(String(format: "%.1f", sizeInMB)) MB") + .font(.caption) + .foregroundColor(.green) + } else if isDownloading { + Text("Downloading...") + .font(.caption) + .foregroundColor(.blue) + } else { + Text("Not downloaded") + .font(.caption) + .foregroundColor(.gray) + } + } + + Spacer() + + if isDownloading { + VStack { + ProgressView() + .scaleEffect(0.8) + Text("\(Int(progress * 100))%") + .font(.caption2) + .foregroundColor(.blue) + } + } else if isDownloaded { + Image(systemName: "checkmark.circle.fill") + .foregroundColor(.green) + .font(.title2) + } else { + Button(action: onDownload) { + Text("Download") + .font(.caption) + .padding(.horizontal, 12) + .padding(.vertical, 6) + .background(Color.blue) + .foregroundColor(.white) + .cornerRadius(6) + } + } + } + .padding(.vertical, 4) + .onAppear { + checkIfDownloaded() + } + .onChange(of: isDownloading) { downloading in + if !downloading { + checkIfDownloaded() + } + } + .onChange(of: refreshTrigger) { _ in + checkIfDownloaded() + } + } + + private func checkIfDownloaded() { + let tileStore = TileStore.default + tileStore.tileRegion(forId: regionId) { result in + DispatchQueue.main.async { + switch result { + case .success(let tileRegion): + self.isDownloaded = true + self.sizeInMB = Double(tileRegion.completedResourceSize) / (1024 * 1024) + case .failure(_): + self.isDownloaded = false + self.sizeInMB = 0.0 + } + } + } + } +} + diff --git a/ios-offline-maps/ios-offline-maps/ios_offline_mapsApp.swift b/ios-offline-maps/ios-offline-maps/ios_offline_mapsApp.swift new file mode 100644 index 0000000..6dc5e1b --- /dev/null +++ b/ios-offline-maps/ios-offline-maps/ios_offline_mapsApp.swift @@ -0,0 +1,17 @@ +// +// ios_offline_mapsApp.swift +// ios-offline-maps +// +// Created by Chris Whong on 8/13/25. +// + +import SwiftUI + +@main +struct ios_offline_mapsApp: App { + var body: some Scene { + WindowGroup { + ContentView() + } + } +} diff --git a/ios-offline-maps/ios-offline-mapsTests/ios_offline_mapsTests.swift b/ios-offline-maps/ios-offline-mapsTests/ios_offline_mapsTests.swift new file mode 100644 index 0000000..7f9294d --- /dev/null +++ b/ios-offline-maps/ios-offline-mapsTests/ios_offline_mapsTests.swift @@ -0,0 +1,17 @@ +// +// ios_offline_mapsTests.swift +// ios-offline-mapsTests +// +// Created by Chris Whong on 8/13/25. +// + +import Testing +@testable import ios_offline_maps + +struct ios_offline_mapsTests { + + @Test func example() async throws { + // Write your test here and use APIs like `#expect(...)` to check expected conditions. + } + +} diff --git a/ios-offline-maps/ios-offline-mapsUITests/ios_offline_mapsUITests.swift b/ios-offline-maps/ios-offline-mapsUITests/ios_offline_mapsUITests.swift new file mode 100644 index 0000000..f5d0669 --- /dev/null +++ b/ios-offline-maps/ios-offline-mapsUITests/ios_offline_mapsUITests.swift @@ -0,0 +1,41 @@ +// +// ios_offline_mapsUITests.swift +// ios-offline-mapsUITests +// +// Created by Chris Whong on 8/13/25. +// + +import XCTest + +final class ios_offline_mapsUITests: XCTestCase { + + override func setUpWithError() throws { + // Put setup code here. This method is called before the invocation of each test method in the class. + + // In UI tests it is usually best to stop immediately when a failure occurs. + continueAfterFailure = false + + // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this. + } + + override func tearDownWithError() throws { + // Put teardown code here. This method is called after the invocation of each test method in the class. + } + + @MainActor + func testExample() throws { + // UI tests must launch the application that they test. + let app = XCUIApplication() + app.launch() + + // Use XCTAssert and related functions to verify your tests produce the correct results. + } + + @MainActor + func testLaunchPerformance() throws { + // This measures how long it takes to launch your application. + measure(metrics: [XCTApplicationLaunchMetric()]) { + XCUIApplication().launch() + } + } +} diff --git a/ios-offline-maps/ios-offline-mapsUITests/ios_offline_mapsUITestsLaunchTests.swift b/ios-offline-maps/ios-offline-mapsUITests/ios_offline_mapsUITestsLaunchTests.swift new file mode 100644 index 0000000..705b1ba --- /dev/null +++ b/ios-offline-maps/ios-offline-mapsUITests/ios_offline_mapsUITestsLaunchTests.swift @@ -0,0 +1,33 @@ +// +// ios_offline_mapsUITestsLaunchTests.swift +// ios-offline-mapsUITests +// +// Created by Chris Whong on 8/13/25. +// + +import XCTest + +final class ios_offline_mapsUITestsLaunchTests: XCTestCase { + + override class var runsForEachTargetApplicationUIConfiguration: Bool { + true + } + + override func setUpWithError() throws { + continueAfterFailure = false + } + + @MainActor + func testLaunch() throws { + let app = XCUIApplication() + app.launch() + + // Insert steps here to perform after app launch but before taking a screenshot, + // such as logging into a test account or navigating somewhere in the app + + let attachment = XCTAttachment(screenshot: app.screenshot()) + attachment.name = "Launch Screen" + attachment.lifetime = .keepAlways + add(attachment) + } +}