From 9bf036baea080f7713bfce321ce605b61d8fe975 Mon Sep 17 00:00:00 2001 From: Sami Samhuri Date: Sun, 1 Dec 2024 14:26:33 -0800 Subject: [PATCH] First commit --- NavigationFreeze.xcodeproj/project.pbxproj | 331 ++++++++++++++++++ .../contents.xcworkspacedata | 7 + .../AccentColor.colorset/Contents.json | 11 + .../AppIcon.appiconset/Contents.json | 35 ++ .../Assets.xcassets/Contents.json | 6 + NavigationFreeze/ContentView.swift | 81 +++++ NavigationFreeze/NavigationFreezeApp.swift | 17 + .../Preview Assets.xcassets/Contents.json | 6 + 8 files changed, 494 insertions(+) create mode 100644 NavigationFreeze.xcodeproj/project.pbxproj create mode 100644 NavigationFreeze.xcodeproj/project.xcworkspace/contents.xcworkspacedata create mode 100644 NavigationFreeze/Assets.xcassets/AccentColor.colorset/Contents.json create mode 100644 NavigationFreeze/Assets.xcassets/AppIcon.appiconset/Contents.json create mode 100644 NavigationFreeze/Assets.xcassets/Contents.json create mode 100644 NavigationFreeze/ContentView.swift create mode 100644 NavigationFreeze/NavigationFreezeApp.swift create mode 100644 NavigationFreeze/Preview Content/Preview Assets.xcassets/Contents.json diff --git a/NavigationFreeze.xcodeproj/project.pbxproj b/NavigationFreeze.xcodeproj/project.pbxproj new file mode 100644 index 0000000..180852b --- /dev/null +++ b/NavigationFreeze.xcodeproj/project.pbxproj @@ -0,0 +1,331 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 77; + objects = { + +/* Begin PBXFileReference section */ + 7B1FED6C2CFD0F230035A057 /* NavigationFreeze.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = NavigationFreeze.app; sourceTree = BUILT_PRODUCTS_DIR; }; +/* End PBXFileReference section */ + +/* Begin PBXFileSystemSynchronizedRootGroup section */ + 7B1FED6E2CFD0F230035A057 /* NavigationFreeze */ = { + isa = PBXFileSystemSynchronizedRootGroup; + path = NavigationFreeze; + sourceTree = ""; + }; +/* End PBXFileSystemSynchronizedRootGroup section */ + +/* Begin PBXFrameworksBuildPhase section */ + 7B1FED692CFD0F230035A057 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 7B1FED632CFD0F230035A057 = { + isa = PBXGroup; + children = ( + 7B1FED6E2CFD0F230035A057 /* NavigationFreeze */, + 7B1FED6D2CFD0F230035A057 /* Products */, + ); + sourceTree = ""; + }; + 7B1FED6D2CFD0F230035A057 /* Products */ = { + isa = PBXGroup; + children = ( + 7B1FED6C2CFD0F230035A057 /* NavigationFreeze.app */, + ); + name = Products; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 7B1FED6B2CFD0F230035A057 /* NavigationFreeze */ = { + isa = PBXNativeTarget; + buildConfigurationList = 7B1FED7A2CFD0F240035A057 /* Build configuration list for PBXNativeTarget "NavigationFreeze" */; + buildPhases = ( + 7B1FED682CFD0F230035A057 /* Sources */, + 7B1FED692CFD0F230035A057 /* Frameworks */, + 7B1FED6A2CFD0F230035A057 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + fileSystemSynchronizedGroups = ( + 7B1FED6E2CFD0F230035A057 /* NavigationFreeze */, + ); + name = NavigationFreeze; + packageProductDependencies = ( + ); + productName = NavigationFreeze; + productReference = 7B1FED6C2CFD0F230035A057 /* NavigationFreeze.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 7B1FED642CFD0F230035A057 /* Project object */ = { + isa = PBXProject; + attributes = { + BuildIndependentTargetsInParallel = 1; + LastSwiftUpdateCheck = 1620; + LastUpgradeCheck = 1620; + TargetAttributes = { + 7B1FED6B2CFD0F230035A057 = { + CreatedOnToolsVersion = 16.2; + }; + }; + }; + buildConfigurationList = 7B1FED672CFD0F230035A057 /* Build configuration list for PBXProject "NavigationFreeze" */; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 7B1FED632CFD0F230035A057; + minimizedProjectReferenceProxies = 1; + preferredProjectObjectVersion = 77; + productRefGroup = 7B1FED6D2CFD0F230035A057 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 7B1FED6B2CFD0F230035A057 /* NavigationFreeze */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 7B1FED6A2CFD0F230035A057 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 7B1FED682CFD0F230035A057 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin XCBuildConfiguration section */ + 7B1FED782CFD0F240035A057 /* 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.2; + 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; + }; + 7B1FED792CFD0F240035A057 /* 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.2; + 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; + }; + 7B1FED7B2CFD0F240035A057 /* 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_ASSET_PATHS = "\"NavigationFreeze/Preview Content\""; + DEVELOPMENT_TEAM = X45WPY5JFZ; + ENABLE_PREVIEWS = YES; + GENERATE_INFOPLIST_FILE = YES; + 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"; + IPHONEOS_DEPLOYMENT_TARGET = 18.0; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = ca.gurulogic.NavigationFreeze; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 7B1FED7C2CFD0F240035A057 /* 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_ASSET_PATHS = "\"NavigationFreeze/Preview Content\""; + DEVELOPMENT_TEAM = X45WPY5JFZ; + ENABLE_PREVIEWS = YES; + GENERATE_INFOPLIST_FILE = YES; + 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"; + IPHONEOS_DEPLOYMENT_TARGET = 18.0; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = ca.gurulogic.NavigationFreeze; + 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 */ + 7B1FED672CFD0F230035A057 /* Build configuration list for PBXProject "NavigationFreeze" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 7B1FED782CFD0F240035A057 /* Debug */, + 7B1FED792CFD0F240035A057 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 7B1FED7A2CFD0F240035A057 /* Build configuration list for PBXNativeTarget "NavigationFreeze" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 7B1FED7B2CFD0F240035A057 /* Debug */, + 7B1FED7C2CFD0F240035A057 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 7B1FED642CFD0F230035A057 /* Project object */; +} diff --git a/NavigationFreeze.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/NavigationFreeze.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..919434a --- /dev/null +++ b/NavigationFreeze.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/NavigationFreeze/Assets.xcassets/AccentColor.colorset/Contents.json b/NavigationFreeze/Assets.xcassets/AccentColor.colorset/Contents.json new file mode 100644 index 0000000..eb87897 --- /dev/null +++ b/NavigationFreeze/Assets.xcassets/AccentColor.colorset/Contents.json @@ -0,0 +1,11 @@ +{ + "colors" : [ + { + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/NavigationFreeze/Assets.xcassets/AppIcon.appiconset/Contents.json b/NavigationFreeze/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..2305880 --- /dev/null +++ b/NavigationFreeze/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/NavigationFreeze/Assets.xcassets/Contents.json b/NavigationFreeze/Assets.xcassets/Contents.json new file mode 100644 index 0000000..73c0059 --- /dev/null +++ b/NavigationFreeze/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/NavigationFreeze/ContentView.swift b/NavigationFreeze/ContentView.swift new file mode 100644 index 0000000..be851e3 --- /dev/null +++ b/NavigationFreeze/ContentView.swift @@ -0,0 +1,81 @@ +// +// ContentView.swift +// NavigationFreeze +// +// Created by Sami Samhuri on 2024-12-01. +// + +import SwiftUI + +struct ContentView: View { + var body: some View { + NavigationStack { + VStack { + NavigationLink(destination: RecipesView()) { + Label("Show Recipes (freezes)", systemImage: "books.vertical") + .padding(.vertical) + } + + NavigationLink(destination: RecipesViewWithoutOpenURL()) { + Label("Show Recipes (no freeze)", systemImage: "books.vertical") + .padding(.vertical) + } + + NavigationLink(destination: RecipesViewWithInlineDestination()) { + Label("Show Recipes (also no freeze)", systemImage: "books.vertical") + .padding(.vertical) + } + } + .buttonStyle(.borderedProminent) + } + } +} + +struct RecipesView: View { + // This only happens when we have openURL in the environment. + @Environment(\.openURL) private var openURL + + var body: some View { + // Changing this to an inline view expression also makes it work for some reason. + NavigationLink(destination: recipeView) { + Text("Mom's Secret Pasta Sauce (will freeze)") + .padding(.vertical) + } + .buttonStyle(.borderedProminent) + } + + private var recipeView: some View { + Text("") + } +} + +struct RecipesViewWithoutOpenURL: View { + var body: some View { + NavigationLink(destination: recipeView) { + Text("Mom's Secret Pasta Sauce (will not freeze)") + .padding(.vertical) + } + .buttonStyle(.borderedProminent) + } + + private var recipeView: some View { + Text("") + } +} + +struct RecipesViewWithInlineDestination: View { + // This only happens when we have openURL in the environment. + @Environment(\.openURL) private var openURL + + var body: some View { + NavigationLink(destination: Text("")) { + Text("Mom's Secret Pasta Sauce (will not freeze)") + .padding(.vertical) + } + .buttonStyle(.borderedProminent) + } +} + +#Preview { + ContentView() +} diff --git a/NavigationFreeze/NavigationFreezeApp.swift b/NavigationFreeze/NavigationFreezeApp.swift new file mode 100644 index 0000000..076638a --- /dev/null +++ b/NavigationFreeze/NavigationFreezeApp.swift @@ -0,0 +1,17 @@ +// +// NavigationFreezeApp.swift +// NavigationFreeze +// +// Created by Sami Samhuri on 2024-12-01. +// + +import SwiftUI + +@main +struct NavigationFreezeApp: App { + var body: some Scene { + WindowGroup { + ContentView() + } + } +} diff --git a/NavigationFreeze/Preview Content/Preview Assets.xcassets/Contents.json b/NavigationFreeze/Preview Content/Preview Assets.xcassets/Contents.json new file mode 100644 index 0000000..73c0059 --- /dev/null +++ b/NavigationFreeze/Preview Content/Preview Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +}