diff --git a/ios-appleMap-storyboard.xcodeproj/project.pbxproj b/ios-appleMap-storyboard.xcodeproj/project.pbxproj new file mode 100644 index 0000000..29e19c0 --- /dev/null +++ b/ios-appleMap-storyboard.xcodeproj/project.pbxproj @@ -0,0 +1,374 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 56; + objects = { + +/* Begin PBXBuildFile section */ + D32B12912B7A24B300BBC4D8 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = D32B12902B7A24B300BBC4D8 /* AppDelegate.swift */; }; + D32B12932B7A24B300BBC4D8 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = D32B12922B7A24B300BBC4D8 /* SceneDelegate.swift */; }; + D32B12952B7A24B300BBC4D8 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D32B12942B7A24B300BBC4D8 /* ViewController.swift */; }; + D32B12982B7A24B300BBC4D8 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = D32B12962B7A24B300BBC4D8 /* Main.storyboard */; }; + D32B129A2B7A24B400BBC4D8 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = D32B12992B7A24B400BBC4D8 /* Assets.xcassets */; }; + D32B129D2B7A24B400BBC4D8 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = D32B129B2B7A24B400BBC4D8 /* LaunchScreen.storyboard */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + D32B128D2B7A24B300BBC4D8 /* ios-appleMap-storyboard.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "ios-appleMap-storyboard.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + D32B12902B7A24B300BBC4D8 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + D32B12922B7A24B300BBC4D8 /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = ""; }; + D32B12942B7A24B300BBC4D8 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; + D32B12972B7A24B300BBC4D8 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + D32B12992B7A24B400BBC4D8 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + D32B129C2B7A24B400BBC4D8 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + D32B129E2B7A24B400BBC4D8 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + D32B128A2B7A24B300BBC4D8 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + D32B12842B7A24B300BBC4D8 = { + isa = PBXGroup; + children = ( + D32B128F2B7A24B300BBC4D8 /* ios-appleMap-storyboard */, + D32B128E2B7A24B300BBC4D8 /* Products */, + ); + sourceTree = ""; + }; + D32B128E2B7A24B300BBC4D8 /* Products */ = { + isa = PBXGroup; + children = ( + D32B128D2B7A24B300BBC4D8 /* ios-appleMap-storyboard.app */, + ); + name = Products; + sourceTree = ""; + }; + D32B128F2B7A24B300BBC4D8 /* ios-appleMap-storyboard */ = { + isa = PBXGroup; + children = ( + D32B12902B7A24B300BBC4D8 /* AppDelegate.swift */, + D32B12922B7A24B300BBC4D8 /* SceneDelegate.swift */, + D32B12942B7A24B300BBC4D8 /* ViewController.swift */, + D32B12962B7A24B300BBC4D8 /* Main.storyboard */, + D32B12992B7A24B400BBC4D8 /* Assets.xcassets */, + D32B129B2B7A24B400BBC4D8 /* LaunchScreen.storyboard */, + D32B129E2B7A24B400BBC4D8 /* Info.plist */, + ); + path = "ios-appleMap-storyboard"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + D32B128C2B7A24B300BBC4D8 /* ios-appleMap-storyboard */ = { + isa = PBXNativeTarget; + buildConfigurationList = D32B12A12B7A24B400BBC4D8 /* Build configuration list for PBXNativeTarget "ios-appleMap-storyboard" */; + buildPhases = ( + D32B12892B7A24B300BBC4D8 /* Sources */, + D32B128A2B7A24B300BBC4D8 /* Frameworks */, + D32B128B2B7A24B300BBC4D8 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "ios-appleMap-storyboard"; + productName = "ios-appleMap-storyboard"; + productReference = D32B128D2B7A24B300BBC4D8 /* ios-appleMap-storyboard.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + D32B12852B7A24B300BBC4D8 /* Project object */ = { + isa = PBXProject; + attributes = { + BuildIndependentTargetsInParallel = 1; + LastSwiftUpdateCheck = 1500; + LastUpgradeCheck = 1500; + TargetAttributes = { + D32B128C2B7A24B300BBC4D8 = { + CreatedOnToolsVersion = 15.0; + }; + }; + }; + buildConfigurationList = D32B12882B7A24B300BBC4D8 /* Build configuration list for PBXProject "ios-appleMap-storyboard" */; + compatibilityVersion = "Xcode 14.0"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = D32B12842B7A24B300BBC4D8; + productRefGroup = D32B128E2B7A24B300BBC4D8 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + D32B128C2B7A24B300BBC4D8 /* ios-appleMap-storyboard */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + D32B128B2B7A24B300BBC4D8 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + D32B129D2B7A24B400BBC4D8 /* LaunchScreen.storyboard in Resources */, + D32B129A2B7A24B400BBC4D8 /* Assets.xcassets in Resources */, + D32B12982B7A24B300BBC4D8 /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + D32B12892B7A24B300BBC4D8 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + D32B12952B7A24B300BBC4D8 /* ViewController.swift in Sources */, + D32B12912B7A24B300BBC4D8 /* AppDelegate.swift in Sources */, + D32B12932B7A24B300BBC4D8 /* SceneDelegate.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + D32B12962B7A24B300BBC4D8 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + D32B12972B7A24B300BBC4D8 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + D32B129B2B7A24B400BBC4D8 /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + D32B129C2B7A24B400BBC4D8 /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + D32B129F2B7A24B400BBC4D8 /* 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 = 13.0; + 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; + }; + D32B12A02B7A24B400BBC4D8 /* 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 = 13.0; + 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; + }; + D32B12A22B7A24B400BBC4D8 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_TEAM = 5M7PLF7KWB; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_FILE = "ios-appleMap-storyboard/Info.plist"; + INFOPLIST_KEY_NSLocationAlwaysAndWhenInUseUsageDescription = "This app allows to find near by Merchants and Agents."; + INFOPLIST_KEY_NSLocationAlwaysUsageDescription = "This app allows to find near by Merchants and Agents."; + INFOPLIST_KEY_NSLocationWhenInUseUsageDescription = "This app allows to find near by Merchants and Agents."; + INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; + INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen; + INFOPLIST_KEY_UIMainStoryboardFile = Main; + 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 = "Sarbajit-Biswal.ios-appleMap-storyboard"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + D32B12A32B7A24B400BBC4D8 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_TEAM = 5M7PLF7KWB; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_FILE = "ios-appleMap-storyboard/Info.plist"; + INFOPLIST_KEY_NSLocationAlwaysAndWhenInUseUsageDescription = "This app allows to find near by Merchants and Agents."; + INFOPLIST_KEY_NSLocationAlwaysUsageDescription = "This app allows to find near by Merchants and Agents."; + INFOPLIST_KEY_NSLocationWhenInUseUsageDescription = "This app allows to find near by Merchants and Agents."; + INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; + INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen; + INFOPLIST_KEY_UIMainStoryboardFile = Main; + 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 = "Sarbajit-Biswal.ios-appleMap-storyboard"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + D32B12882B7A24B300BBC4D8 /* Build configuration list for PBXProject "ios-appleMap-storyboard" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + D32B129F2B7A24B400BBC4D8 /* Debug */, + D32B12A02B7A24B400BBC4D8 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + D32B12A12B7A24B400BBC4D8 /* Build configuration list for PBXNativeTarget "ios-appleMap-storyboard" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + D32B12A22B7A24B400BBC4D8 /* Debug */, + D32B12A32B7A24B400BBC4D8 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = D32B12852B7A24B300BBC4D8 /* Project object */; +} diff --git a/ios-appleMap-storyboard.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/ios-appleMap-storyboard.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..919434a --- /dev/null +++ b/ios-appleMap-storyboard.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/ios-appleMap-storyboard.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/ios-appleMap-storyboard.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/ios-appleMap-storyboard.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/ios-appleMap-storyboard/AppDelegate.swift b/ios-appleMap-storyboard/AppDelegate.swift new file mode 100644 index 0000000..fa06232 --- /dev/null +++ b/ios-appleMap-storyboard/AppDelegate.swift @@ -0,0 +1,36 @@ +// +// AppDelegate.swift +// ios-appleMap-storyboard +// +// Created by Sarbajit Biswal on 12/02/24. +// + +import UIKit + +@main +class AppDelegate: UIResponder, UIApplicationDelegate { + + + + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { + // Override point for customization after application launch. + return true + } + + // MARK: UISceneSession Lifecycle + + func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration { + // Called when a new scene session is being created. + // Use this method to select a configuration to create the new scene with. + return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role) + } + + func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set) { + // Called when the user discards a scene session. + // If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions. + // Use this method to release any resources that were specific to the discarded scenes, as they will not return. + } + + +} + diff --git a/ios-appleMap-storyboard/Assets.xcassets/AccentColor.colorset/Contents.json b/ios-appleMap-storyboard/Assets.xcassets/AccentColor.colorset/Contents.json new file mode 100644 index 0000000..eb87897 --- /dev/null +++ b/ios-appleMap-storyboard/Assets.xcassets/AccentColor.colorset/Contents.json @@ -0,0 +1,11 @@ +{ + "colors" : [ + { + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/ios-appleMap-storyboard/Assets.xcassets/AppIcon.appiconset/Contents.json b/ios-appleMap-storyboard/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..13613e3 --- /dev/null +++ b/ios-appleMap-storyboard/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,13 @@ +{ + "images" : [ + { + "idiom" : "universal", + "platform" : "ios", + "size" : "1024x1024" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/ios-appleMap-storyboard/Assets.xcassets/Contents.json b/ios-appleMap-storyboard/Assets.xcassets/Contents.json new file mode 100644 index 0000000..73c0059 --- /dev/null +++ b/ios-appleMap-storyboard/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/ios-appleMap-storyboard/Base.lproj/LaunchScreen.storyboard b/ios-appleMap-storyboard/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 0000000..865e932 --- /dev/null +++ b/ios-appleMap-storyboard/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ios-appleMap-storyboard/Base.lproj/Main.storyboard b/ios-appleMap-storyboard/Base.lproj/Main.storyboard new file mode 100644 index 0000000..71d9000 --- /dev/null +++ b/ios-appleMap-storyboard/Base.lproj/Main.storyboard @@ -0,0 +1,65 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ios-appleMap-storyboard/Info.plist b/ios-appleMap-storyboard/Info.plist new file mode 100644 index 0000000..dd3c9af --- /dev/null +++ b/ios-appleMap-storyboard/Info.plist @@ -0,0 +1,25 @@ + + + + + UIApplicationSceneManifest + + UIApplicationSupportsMultipleScenes + + UISceneConfigurations + + UIWindowSceneSessionRoleApplication + + + UISceneConfigurationName + Default Configuration + UISceneDelegateClassName + $(PRODUCT_MODULE_NAME).SceneDelegate + UISceneStoryboardFile + Main + + + + + + diff --git a/ios-appleMap-storyboard/SceneDelegate.swift b/ios-appleMap-storyboard/SceneDelegate.swift new file mode 100644 index 0000000..e1a6c04 --- /dev/null +++ b/ios-appleMap-storyboard/SceneDelegate.swift @@ -0,0 +1,52 @@ +// +// SceneDelegate.swift +// ios-appleMap-storyboard +// +// Created by Sarbajit Biswal on 12/02/24. +// + +import UIKit + +class SceneDelegate: UIResponder, UIWindowSceneDelegate { + + var window: UIWindow? + + + func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { + // Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`. + // If using a storyboard, the `window` property will automatically be initialized and attached to the scene. + // This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead). + guard let _ = (scene as? UIWindowScene) else { return } + } + + func sceneDidDisconnect(_ scene: UIScene) { + // Called as the scene is being released by the system. + // This occurs shortly after the scene enters the background, or when its session is discarded. + // Release any resources associated with this scene that can be re-created the next time the scene connects. + // The scene may re-connect later, as its session was not necessarily discarded (see `application:didDiscardSceneSessions` instead). + } + + func sceneDidBecomeActive(_ scene: UIScene) { + // Called when the scene has moved from an inactive state to an active state. + // Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive. + } + + func sceneWillResignActive(_ scene: UIScene) { + // Called when the scene will move from an active state to an inactive state. + // This may occur due to temporary interruptions (ex. an incoming phone call). + } + + func sceneWillEnterForeground(_ scene: UIScene) { + // Called as the scene transitions from the background to the foreground. + // Use this method to undo the changes made on entering the background. + } + + func sceneDidEnterBackground(_ scene: UIScene) { + // Called as the scene transitions from the foreground to the background. + // Use this method to save data, release shared resources, and store enough scene-specific state information + // to restore the scene back to its current state. + } + + +} + diff --git a/ios-appleMap-storyboard/ViewController.swift b/ios-appleMap-storyboard/ViewController.swift new file mode 100644 index 0000000..c9d00e2 --- /dev/null +++ b/ios-appleMap-storyboard/ViewController.swift @@ -0,0 +1,198 @@ +// +// ViewController.swift +// ios-appleMap-storyboard +// +// Created by Sarbajit Biswal on 12/02/24. +// + +import UIKit +import MapKit +class ViewController: UIViewController, MKMapViewDelegate, CLLocationManagerDelegate, UIGestureRecognizerDelegate { + + @IBOutlet weak var currentBtn: UIButton? + @IBOutlet weak var searchBar: UITextField? + @IBOutlet weak var mapView: MKMapView? + var sourcePostiton: CLLocationCoordinate2D? + var locationManager = CLLocationManager() + var tappedLocation: CLLocationCoordinate2D? + override func viewDidLoad() { + super.viewDidLoad() + let tapRecognizer = UITapGestureRecognizer(target: self, action: #selector(handleMapTap(_:))) + tapRecognizer.delegate = self + mapView?.addGestureRecognizer(tapRecognizer) + self.mapView?.register(CustomAnnotation.self, forAnnotationViewWithReuseIdentifier: "CustomAnnotation") + self.mapView?.delegate = self + self.locationManager.delegate = self + addExamplePoints() + + } + func showLocationPermissionPopUp() { + // Show PopUp that Location services are not enabled and on tap of OK button take user back to previous screen + print("Permisson not granted") + } + func setNavButton() { + self.currentBtn?.setTitle("", for: .normal) + self.currentBtn?.backgroundColor = .white + self.currentBtn?.setImage(UIImage(systemName: ""), for: .normal) + } + + @IBAction func currentBtnTapped(_ sender: Any) { + } + func locationManager(_ manager: CLLocationManager, didUpdateLocations locations: [CLLocation]) { + manager.delegate = nil + manager.stopUpdatingLocation() + guard let latestLocation = locations.first else {return} + sourcePostiton = latestLocation.coordinate + } + func zoomToLatestLocation(coordinate: CLLocationCoordinate2D) { + let zoomRegion = MKCoordinateRegion(center: coordinate, latitudinalMeters: 1000, longitudinalMeters: 1000) + mapView?.setRegion(zoomRegion, animated: true) + } + func beginLocationUpdated(manager: CLLocationManager) { + mapView?.showsUserLocation = true + locationManager.desiredAccuracy = kCLLocationAccuracyBest + locationManager.startUpdatingLocation() + } + public func locationManager(_ manager: CLLocationManager, didChangeAuthorization status: CLAuthorizationStatus) { + switch status { + case .notDetermined: + self.locationManager.requestWhenInUseAuthorization() + case .denied, .restricted: + self.showLocationPermissionPopUp() + case .authorizedWhenInUse, .authorizedAlways: + beginLocationUpdated(manager: manager) + @unknown default: + self.showLocationPermissionPopUp() + } + } + @objc + func handleMapTap(_ gestureReconizer: UITapGestureRecognizer) { + let touchLocation = gestureReconizer.location(in: mapView) + let locationCoordinate = mapView?.convert(touchLocation,toCoordinateFrom: mapView) + if let locationCoordinate = locationCoordinate { + print("Tapped at lat: \(locationCoordinate.latitude) long: \(locationCoordinate.longitude)") + //fetchLocationDetails(latitude: locationCoordinate.latitude, longitude: locationCoordinate.longitude) + let geocoder = CLGeocoder() + geocoder.reverseGeocodeLocation(CLLocation(latitude: locationCoordinate.latitude, longitude: locationCoordinate.longitude)) { (placemarks, error) in + guard let placemark = placemarks?.first else { + print("No placemark found") + return + } + // Use placemark to get the address + if let address = placemark.addressDictionary?["FormattedAddressLines"] as? [String] { + let formattedAddress = address.joined(separator: ", ") + print("Formatted Address: \(formattedAddress)") + } + } + tappedLocation = locationCoordinate + showAnnotation() + } + } + func showAnnotation() { + if let tappedLocation = tappedLocation { + /// Removing existing annotations before adding new ones + let oldAnnotations = self.mapView?.annotations + mapView?.removeAnnotations(oldAnnotations ?? []) + mapView?.addAnnotation(CustomAnnotation(latitude: tappedLocation.latitude, longitude: tappedLocation.longitude)) + mapView?.showAnnotations([CustomAnnotation(latitude: tappedLocation.latitude, longitude: tappedLocation.longitude)], animated: true) + } + } + func mapView(_ mapView: MKMapView, viewFor annotation: MKAnnotation) -> MKAnnotationView? { + guard let customAnnotation = annotation as? CustomAnnotation else { + return nil + } + + let annotationView = MKMarkerAnnotationView(annotation: customAnnotation, reuseIdentifier: "CustomAnnotation") + annotationView.markerTintColor = .blue + annotationView.glyphText = "H" + // Customize annotation view + + return annotationView + } + func gestureRecognizer(_ gestureRecognizer: UIGestureRecognizer, shouldReceive touch: UITouch) -> Bool { + return !(touch.view is MKPinAnnotationView) + } + private func addExamplePoints() { + /// Removing existing annotations before adding new ones + let oldAnnotations = self.mapView?.annotations + mapView?.removeAnnotations(oldAnnotations ?? []) + + /// Generating and adding new annotations to the map + let points = generateExamplePoints() + //mapView?.addAnnotations(points) + mapView?.showAnnotations(points, animated: true) + } + + private func generateExamplePoints() -> [CustomAnnotation] { + var points: [CustomAnnotation] = [] + points = [CustomAnnotation(latitude: 20.31483516799026, longitude: 85.82004622890578), + CustomAnnotation(latitude: 20.310220482804002, longitude: 85.81322691889663), + CustomAnnotation(latitude: 20.3483516799027, longitude: 85.82014622890578), + CustomAnnotation(latitude: 20.31483516799028, longitude: 85.82224622890578)] + + return points + } + func fetchLocationDetails(latitude: Double, longitude: Double) { + // Construct the URL + let apiKey: String = "c10866f456864d1e93d036262d558175" + let urlString = "https://api.geoapify.com/v1/geocode/reverse?lat=\(latitude)&lon=\(longitude)&format=json&apiKey=\(apiKey)" + guard let url = URL(string: urlString) else { + print("Invalid URL") + return + } + + // Create the URLSession + let session = URLSession(configuration: .default) + + // Create the data task + let task = session.dataTask(with: url) { data, response, error in + // Check for errors + if let error = error { + print("Error: \(error)") + return + } + + // Check for response status code + guard let httpResponse = response as? HTTPURLResponse, + (200...299).contains(httpResponse.statusCode) else { + print("Invalid response") + return + } + + // Check if data is available + guard let data = data else { + print("No data received") + return + } + + // Parse the JSON response + do { + let json = try JSONSerialization.jsonObject(with: data, options: []) + if let jsonDictionary = json as? [String: Any], + let results = jsonDictionary["results"] as? [[String: Any]], + let locationDetails = results.first { + // Handle the location details + print(locationDetails) + + + } else { + print("Invalid JSON format") + } + } catch { + print("Error parsing JSON: \(error)") + } + } + + // Start the data task + task.resume() + } +} + +class CustomAnnotation: NSObject, MKAnnotation { + var coordinate: CLLocationCoordinate2D + + init(latitude: Double, longitude: Double){ + self.coordinate = CLLocationCoordinate2DMake(latitude, longitude) + super.init() + } +}