From 0234f2c8ff847c6f03a27e2a8d213c142cbed2c5 Mon Sep 17 00:00:00 2001 From: Vegard Matthey Date: Fri, 27 Feb 2026 00:01:11 +0100 Subject: [PATCH] initial: old xcode --- ExportOptions.plist | 2 +- ImageViewer.xcodeproj/project.pbxproj | 415 +++++------------- .../xcshareddata/IDEWorkspaceChecks.plist} | 10 +- .../xcschemes/ImageViewer.xcscheme | 85 ++++ .../AppIcon.appiconset/Contents.json | 22 - ImageViewer/ViewController.swift | 112 ++--- ImageViewerTests/ImageViewerTests.swift | 9 - ImageViewerUITests/ImageViewerUITests.swift | 24 - .../ImageViewerUITestsLaunchTests.swift | 23 - run.sh | 2 +- 10 files changed, 252 insertions(+), 452 deletions(-) rename ImageViewer.xcodeproj/{xcuserdata/cb.xcuserdatad/xcschemes/xcschememanagement.plist => project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist} (54%) create mode 100644 ImageViewer.xcodeproj/xcshareddata/xcschemes/ImageViewer.xcscheme delete mode 100644 ImageViewerTests/ImageViewerTests.swift delete mode 100644 ImageViewerUITests/ImageViewerUITests.swift delete mode 100644 ImageViewerUITests/ImageViewerUITestsLaunchTests.swift diff --git a/ExportOptions.plist b/ExportOptions.plist index 1822c54..11526e8 100644 --- a/ExportOptions.plist +++ b/ExportOptions.plist @@ -4,7 +4,7 @@ method - debugging + development signingStyle automatic destination diff --git a/ImageViewer.xcodeproj/project.pbxproj b/ImageViewer.xcodeproj/project.pbxproj index 7a3a434..044788c 100644 --- a/ImageViewer.xcodeproj/project.pbxproj +++ b/ImageViewer.xcodeproj/project.pbxproj @@ -3,320 +3,142 @@ archiveVersion = 1; classes = { }; - objectVersion = 90; + objectVersion = 56; objects = { -/* Begin PBXContainerItemProxy section */ - 22FB3BA32E18135B00A9B407 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 22FB3B842E18135A00A9B407 /* Project object */; - proxyType = 1; - remoteGlobalIDString = 22FB3B8B2E18135A00A9B407; - remoteInfo = ImageViewer; - }; - 22FB3BAD2E18135B00A9B407 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 22FB3B842E18135A00A9B407 /* Project object */; - proxyType = 1; - remoteGlobalIDString = 22FB3B8B2E18135A00A9B407; - remoteInfo = ImageViewer; - }; -/* End PBXContainerItemProxy section */ +/* Begin PBXBuildFile section */ + 840F62692E7B65B700C8A64A /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 840F62682E7B65B700C8A64A /* AppDelegate.swift */; }; + 840F626D2E7B65B700C8A64A /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 840F626C2E7B65B700C8A64A /* ViewController.swift */; }; + 840F62722E7B65B900C8A64A /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 840F62712E7B65B900C8A64A /* Assets.xcassets */; }; +/* End PBXBuildFile section */ /* Begin PBXFileReference section */ - 22FB3B8C2E18135A00A9B407 /* ImageViewer.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ImageViewer.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 22FB3BA22E18135B00A9B407 /* ImageViewerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ImageViewerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; - 22FB3BAC2E18135B00A9B407 /* ImageViewerUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ImageViewerUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 840F62652E7B65B700C8A64A /* ImageViewer.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ImageViewer.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 840F62682E7B65B700C8A64A /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 840F626C2E7B65B700C8A64A /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; + 840F62712E7B65B900C8A64A /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 840F62762E7B65B900C8A64A /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; /* End PBXFileReference section */ -/* Begin PBXFileSystemSynchronizedBuildFileExceptionSet section */ - 22FB3BB42E18135B00A9B407 /* Exceptions for "ImageViewer" folder in "ImageViewer" target */ = { - isa = PBXFileSystemSynchronizedBuildFileExceptionSet; - membershipExceptions = ( - Info.plist, - ); - target = 22FB3B8B2E18135A00A9B407 /* ImageViewer */; - }; -/* End PBXFileSystemSynchronizedBuildFileExceptionSet section */ - -/* Begin PBXFileSystemSynchronizedRootGroup section */ - 22FB3B8E2E18135A00A9B407 /* ImageViewer */ = { - isa = PBXFileSystemSynchronizedRootGroup; - exceptions = ( - 22FB3BB42E18135B00A9B407 /* Exceptions for "ImageViewer" folder in "ImageViewer" target */, - ); - path = ImageViewer; - sourceTree = ""; - }; - 22FB3BA52E18135B00A9B407 /* ImageViewerTests */ = { - isa = PBXFileSystemSynchronizedRootGroup; - path = ImageViewerTests; - sourceTree = ""; - }; - 22FB3BAF2E18135B00A9B407 /* ImageViewerUITests */ = { - isa = PBXFileSystemSynchronizedRootGroup; - path = ImageViewerUITests; - sourceTree = ""; - }; -/* End PBXFileSystemSynchronizedRootGroup section */ - /* Begin PBXFrameworksBuildPhase section */ - 22FB3B892E18135A00A9B407 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - files = ( - ); - }; - 22FB3B9F2E18135B00A9B407 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - files = ( - ); - }; - 22FB3BA92E18135B00A9B407 /* Frameworks */ = { + 840F62622E7B65B700C8A64A /* Frameworks */ = { isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; files = ( ); + runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ - 22FB3B832E18135A00A9B407 = { + 840F625C2E7B65B700C8A64A = { isa = PBXGroup; children = ( - 22FB3B8E2E18135A00A9B407 /* ImageViewer */, - 22FB3BA52E18135B00A9B407 /* ImageViewerTests */, - 22FB3BAF2E18135B00A9B407 /* ImageViewerUITests */, - 22FB3B8D2E18135A00A9B407 /* Products */, + 840F62672E7B65B700C8A64A /* ImageViewer */, + 840F62662E7B65B700C8A64A /* Products */, ); sourceTree = ""; }; - 22FB3B8D2E18135A00A9B407 /* Products */ = { + 840F62662E7B65B700C8A64A /* Products */ = { isa = PBXGroup; children = ( - 22FB3B8C2E18135A00A9B407 /* ImageViewer.app */, - 22FB3BA22E18135B00A9B407 /* ImageViewerTests.xctest */, - 22FB3BAC2E18135B00A9B407 /* ImageViewerUITests.xctest */, + 840F62652E7B65B700C8A64A /* ImageViewer.app */, ); name = Products; sourceTree = ""; }; + 840F62672E7B65B700C8A64A /* ImageViewer */ = { + isa = PBXGroup; + children = ( + 840F62682E7B65B700C8A64A /* AppDelegate.swift */, + 840F626C2E7B65B700C8A64A /* ViewController.swift */, + 840F62712E7B65B900C8A64A /* Assets.xcassets */, + 840F62762E7B65B900C8A64A /* Info.plist */, + ); + path = ImageViewer; + sourceTree = ""; + }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ - 22FB3B8B2E18135A00A9B407 /* ImageViewer */ = { + 840F62642E7B65B700C8A64A /* ImageViewer */ = { isa = PBXNativeTarget; - buildConfigurationList = 22FB3BB52E18135B00A9B407 /* Build configuration list for PBXNativeTarget "ImageViewer" */; + buildConfigurationList = 840F62792E7B65B900C8A64A /* Build configuration list for PBXNativeTarget "ImageViewer" */; buildPhases = ( - 22FB3B882E18135A00A9B407 /* Sources */, - 22FB3B892E18135A00A9B407 /* Frameworks */, - 22FB3B8A2E18135A00A9B407 /* Resources */, + 840F62612E7B65B700C8A64A /* Sources */, + 840F62622E7B65B700C8A64A /* Frameworks */, + 840F62632E7B65B700C8A64A /* Resources */, ); buildRules = ( ); - fileSystemSynchronizedGroups = ( - 22FB3B8E2E18135A00A9B407 /* ImageViewer */, + dependencies = ( ); name = ImageViewer; productName = ImageViewer; - productReference = 22FB3B8C2E18135A00A9B407 /* ImageViewer.app */; + productReference = 840F62652E7B65B700C8A64A /* ImageViewer.app */; productType = "com.apple.product-type.application"; }; - 22FB3BA12E18135B00A9B407 /* ImageViewerTests */ = { - isa = PBXNativeTarget; - buildConfigurationList = 22FB3BBA2E18135B00A9B407 /* Build configuration list for PBXNativeTarget "ImageViewerTests" */; - buildPhases = ( - 22FB3B9E2E18135B00A9B407 /* Sources */, - 22FB3B9F2E18135B00A9B407 /* Frameworks */, - 22FB3BA02E18135B00A9B407 /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - 22FB3BA42E18135B00A9B407 /* PBXTargetDependency */, - ); - fileSystemSynchronizedGroups = ( - 22FB3BA52E18135B00A9B407 /* ImageViewerTests */, - ); - name = ImageViewerTests; - productName = ImageViewerTests; - productReference = 22FB3BA22E18135B00A9B407 /* ImageViewerTests.xctest */; - productType = "com.apple.product-type.bundle.unit-test"; - }; - 22FB3BAB2E18135B00A9B407 /* ImageViewerUITests */ = { - isa = PBXNativeTarget; - buildConfigurationList = 22FB3BBD2E18135B00A9B407 /* Build configuration list for PBXNativeTarget "ImageViewerUITests" */; - buildPhases = ( - 22FB3BA82E18135B00A9B407 /* Sources */, - 22FB3BA92E18135B00A9B407 /* Frameworks */, - 22FB3BAA2E18135B00A9B407 /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - 22FB3BAE2E18135B00A9B407 /* PBXTargetDependency */, - ); - fileSystemSynchronizedGroups = ( - 22FB3BAF2E18135B00A9B407 /* ImageViewerUITests */, - ); - name = ImageViewerUITests; - productName = ImageViewerUITests; - productReference = 22FB3BAC2E18135B00A9B407 /* ImageViewerUITests.xctest */; - productType = "com.apple.product-type.bundle.ui-testing"; - }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ - 22FB3B842E18135A00A9B407 /* Project object */ = { + 840F625D2E7B65B700C8A64A /* Project object */ = { isa = PBXProject; attributes = { BuildIndependentTargetsInParallel = 1; - LastSwiftUpdateCheck = 1640; - LastUpgradeCheck = 1640; + LastSwiftUpdateCheck = 1420; + LastUpgradeCheck = 1420; TargetAttributes = { - 22FB3B8B2E18135A00A9B407 = { - CreatedOnToolsVersion = 16.4; - }; - 22FB3BA12E18135B00A9B407 = { - CreatedOnToolsVersion = 16.4; - TestTargetID = 22FB3B8B2E18135A00A9B407; - }; - 22FB3BAB2E18135B00A9B407 = { - CreatedOnToolsVersion = 16.4; - TestTargetID = 22FB3B8B2E18135A00A9B407; + 840F62642E7B65B700C8A64A = { + CreatedOnToolsVersion = 14.2; }; }; }; - buildConfigurationList = 22FB3B872E18135A00A9B407 /* Build configuration list for PBXProject "ImageViewer" */; + buildConfigurationList = 840F62602E7B65B700C8A64A /* Build configuration list for PBXProject "ImageViewer" */; + compatibilityVersion = "Xcode 14.0"; developmentRegion = en; hasScannedForEncodings = 0; knownRegions = ( en, Base, ); - mainGroup = 22FB3B832E18135A00A9B407; - minimizedProjectReferenceProxies = 1; - preferredProjectObjectVersion = 90; - productRefGroup = 22FB3B8D2E18135A00A9B407 /* Products */; + mainGroup = 840F625C2E7B65B700C8A64A; + productRefGroup = 840F62662E7B65B700C8A64A /* Products */; projectDirPath = ""; projectRoot = ""; targets = ( - 22FB3B8B2E18135A00A9B407 /* ImageViewer */, - 22FB3BA12E18135B00A9B407 /* ImageViewerTests */, - 22FB3BAB2E18135B00A9B407 /* ImageViewerUITests */, + 840F62642E7B65B700C8A64A /* ImageViewer */, ); }; /* End PBXProject section */ /* Begin PBXResourcesBuildPhase section */ - 22FB3B8A2E18135A00A9B407 /* Resources */ = { - isa = PBXResourcesBuildPhase; - files = ( - ); - }; - 22FB3BA02E18135B00A9B407 /* Resources */ = { - isa = PBXResourcesBuildPhase; - files = ( - ); - }; - 22FB3BAA2E18135B00A9B407 /* Resources */ = { + 840F62632E7B65B700C8A64A /* Resources */ = { isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; files = ( + 840F62722E7B65B900C8A64A /* Assets.xcassets in Resources */, ); + runOnlyForDeploymentPostprocessing = 0; }; /* End PBXResourcesBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ - 22FB3B882E18135A00A9B407 /* Sources */ = { - isa = PBXSourcesBuildPhase; - files = ( - ); - }; - 22FB3B9E2E18135B00A9B407 /* Sources */ = { - isa = PBXSourcesBuildPhase; - files = ( - ); - }; - 22FB3BA82E18135B00A9B407 /* Sources */ = { + 840F62612E7B65B700C8A64A /* Sources */ = { isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; files = ( + 840F626D2E7B65B700C8A64A /* ViewController.swift in Sources */, + 840F62692E7B65B700C8A64A /* AppDelegate.swift in Sources */, ); + runOnlyForDeploymentPostprocessing = 0; }; /* End PBXSourcesBuildPhase section */ -/* Begin PBXTargetDependency section */ - 22FB3BA42E18135B00A9B407 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 22FB3B8B2E18135A00A9B407 /* ImageViewer */; - targetProxy = 22FB3BA32E18135B00A9B407 /* PBXContainerItemProxy */; - }; - 22FB3BAE2E18135B00A9B407 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 22FB3B8B2E18135A00A9B407 /* ImageViewer */; - targetProxy = 22FB3BAD2E18135B00A9B407 /* PBXContainerItemProxy */; - }; -/* End PBXTargetDependency section */ - /* Begin XCBuildConfiguration section */ - 22FB3BB62E18135B00A9B407 /* Debug configuration for PBXNativeTarget "ImageViewer" */ = { - 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 = U5B4RH73LN; - GENERATE_INFOPLIST_FILE = YES; - INFOPLIST_FILE = ImageViewer/Info.plist; - INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; - INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen; - INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; - INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; - IPHONEOS_DEPLOYMENT_TARGET = 12.4; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - ); - MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = ImageViewer.ImageViewer; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_EMIT_LOC_STRINGS = YES; - SWIFT_VERSION = 5.0; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Debug; - }; - 22FB3BB72E18135B00A9B407 /* Release configuration for PBXNativeTarget "ImageViewer" */ = { - 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 = U5B4RH73LN; - GENERATE_INFOPLIST_FILE = YES; - INFOPLIST_FILE = ImageViewer/Info.plist; - INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; - INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen; - INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; - INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; - IPHONEOS_DEPLOYMENT_TARGET = 12.4; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - ); - MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = ImageViewer.ImageViewer; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_EMIT_LOC_STRINGS = YES; - SWIFT_VERSION = 5.0; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Release; - }; - 22FB3BB82E18135B00A9B407 /* Debug configuration for PBXProject "ImageViewer" */ = { + 840F62772E7B65B900C8A64A /* 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"; @@ -349,8 +171,7 @@ DEBUG_INFORMATION_FORMAT = dwarf; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; - ENABLE_USER_SCRIPT_SANDBOXING = YES; - GCC_C_LANGUAGE_STANDARD = gnu17; + GCC_C_LANGUAGE_STANDARD = gnu11; GCC_DYNAMIC_NO_PIC = NO; GCC_NO_COMMON_BLOCKS = YES; GCC_OPTIMIZATION_LEVEL = 0; @@ -364,22 +185,20 @@ 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; + IPHONEOS_DEPLOYMENT_TARGET = 12.4; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; - SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(inherited)"; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; }; name = Debug; }; - 22FB3BB92E18135B00A9B407 /* Release configuration for PBXProject "ImageViewer" */ = { + 840F62782E7B65B900C8A64A /* 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"; @@ -412,8 +231,7 @@ 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_C_LANGUAGE_STANDARD = gnu11; GCC_NO_COMMON_BLOCKS = YES; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; @@ -421,120 +239,91 @@ 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; + IPHONEOS_DEPLOYMENT_TARGET = 12.4; MTL_ENABLE_DEBUG_INFO = NO; MTL_FAST_MATH = YES; SDKROOT = iphoneos; SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; VALIDATE_PRODUCT = YES; }; name = Release; }; - 22FB3BBB2E18135B00A9B407 /* Debug configuration for PBXNativeTarget "ImageViewerTests" */ = { + 840F627A2E7B65B900C8A64A /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - BUNDLE_LOADER = "$(TEST_HOST)"; + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; GENERATE_INFOPLIST_FILE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 18.5; + INFOPLIST_FILE = ImageViewer/Info.plist; + INFOPLIST_KEY_LSSupportsOpeningDocumentsInPlace = YES; + INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = 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 = ImageViewer.ImageViewerTests; + PRODUCT_BUNDLE_IDENTIFIER = ImageViewer.ImageViewer; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_EMIT_LOC_STRINGS = NO; + SWIFT_EMIT_LOC_STRINGS = YES; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/ImageViewer.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/ImageViewer"; }; name = Debug; }; - 22FB3BBC2E18135B00A9B407 /* Release configuration for PBXNativeTarget "ImageViewerTests" */ = { + 840F627B2E7B65B900C8A64A /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - BUNDLE_LOADER = "$(TEST_HOST)"; + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_TEAM = U5B4RH73LN; GENERATE_INFOPLIST_FILE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 18.5; + INFOPLIST_FILE = ImageViewer/Info.plist; + INFOPLIST_KEY_LSSupportsOpeningDocumentsInPlace = YES; + INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = 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 = ImageViewer.ImageViewerTests; + PRODUCT_BUNDLE_IDENTIFIER = ImageViewer.ImageViewer; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_EMIT_LOC_STRINGS = NO; + SWIFT_EMIT_LOC_STRINGS = YES; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/ImageViewer.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/ImageViewer"; - }; - name = Release; - }; - 22FB3BBE2E18135B00A9B407 /* Debug configuration for PBXNativeTarget "ImageViewerUITests" */ = { - isa = XCBuildConfiguration; - buildSettings = { - CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 1; - GENERATE_INFOPLIST_FILE = YES; - MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = ImageViewer.ImageViewerUITests; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_EMIT_LOC_STRINGS = NO; - SWIFT_VERSION = 5.0; - TARGETED_DEVICE_FAMILY = "1,2"; - TEST_TARGET_NAME = ImageViewer; - }; - name = Debug; - }; - 22FB3BBF2E18135B00A9B407 /* Release configuration for PBXNativeTarget "ImageViewerUITests" */ = { - isa = XCBuildConfiguration; - buildSettings = { - CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 1; - GENERATE_INFOPLIST_FILE = YES; - MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = ImageViewer.ImageViewerUITests; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_EMIT_LOC_STRINGS = NO; - SWIFT_VERSION = 5.0; - TARGETED_DEVICE_FAMILY = "1,2"; - TEST_TARGET_NAME = ImageViewer; }; name = Release; }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ - 22FB3B872E18135A00A9B407 /* Build configuration list for PBXProject "ImageViewer" */ = { + 840F62602E7B65B700C8A64A /* Build configuration list for PBXProject "ImageViewer" */ = { isa = XCConfigurationList; buildConfigurations = ( - 22FB3BB82E18135B00A9B407 /* Debug configuration for PBXProject "ImageViewer" */, - 22FB3BB92E18135B00A9B407 /* Release configuration for PBXProject "ImageViewer" */, + 840F62772E7B65B900C8A64A /* Debug */, + 840F62782E7B65B900C8A64A /* Release */, ); + defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - 22FB3BB52E18135B00A9B407 /* Build configuration list for PBXNativeTarget "ImageViewer" */ = { + 840F62792E7B65B900C8A64A /* Build configuration list for PBXNativeTarget "ImageViewer" */ = { isa = XCConfigurationList; buildConfigurations = ( - 22FB3BB62E18135B00A9B407 /* Debug configuration for PBXNativeTarget "ImageViewer" */, - 22FB3BB72E18135B00A9B407 /* Release configuration for PBXNativeTarget "ImageViewer" */, - ); - defaultConfigurationName = Release; - }; - 22FB3BBA2E18135B00A9B407 /* Build configuration list for PBXNativeTarget "ImageViewerTests" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 22FB3BBB2E18135B00A9B407 /* Debug configuration for PBXNativeTarget "ImageViewerTests" */, - 22FB3BBC2E18135B00A9B407 /* Release configuration for PBXNativeTarget "ImageViewerTests" */, - ); - defaultConfigurationName = Release; - }; - 22FB3BBD2E18135B00A9B407 /* Build configuration list for PBXNativeTarget "ImageViewerUITests" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 22FB3BBE2E18135B00A9B407 /* Debug configuration for PBXNativeTarget "ImageViewerUITests" */, - 22FB3BBF2E18135B00A9B407 /* Release configuration for PBXNativeTarget "ImageViewerUITests" */, + 840F627A2E7B65B900C8A64A /* Debug */, + 840F627B2E7B65B900C8A64A /* Release */, ); + defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; /* End XCConfigurationList section */ }; - rootObject = 22FB3B842E18135A00A9B407 /* Project object */; + rootObject = 840F625D2E7B65B700C8A64A /* Project object */; } diff --git a/ImageViewer.xcodeproj/xcuserdata/cb.xcuserdatad/xcschemes/xcschememanagement.plist b/ImageViewer.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist similarity index 54% rename from ImageViewer.xcodeproj/xcuserdata/cb.xcuserdatad/xcschemes/xcschememanagement.plist rename to ImageViewer.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist index f14c396..18d9810 100644 --- a/ImageViewer.xcodeproj/xcuserdata/cb.xcuserdatad/xcschemes/xcschememanagement.plist +++ b/ImageViewer.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -2,13 +2,7 @@ - SchemeUserState - - ImageViewer.xcscheme_^#shared#^_ - - orderHint - 0 - - + IDEDidComputeMac32BitWarning + diff --git a/ImageViewer.xcodeproj/xcshareddata/xcschemes/ImageViewer.xcscheme b/ImageViewer.xcodeproj/xcshareddata/xcschemes/ImageViewer.xcscheme new file mode 100644 index 0000000..d075589 --- /dev/null +++ b/ImageViewer.xcodeproj/xcshareddata/xcschemes/ImageViewer.xcscheme @@ -0,0 +1,85 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ImageViewer/Assets.xcassets/AppIcon.appiconset/Contents.json b/ImageViewer/Assets.xcassets/AppIcon.appiconset/Contents.json index c68da6c..a657e33 100644 --- a/ImageViewer/Assets.xcassets/AppIcon.appiconset/Contents.json +++ b/ImageViewer/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -5,28 +5,6 @@ "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" : { diff --git a/ImageViewer/ViewController.swift b/ImageViewer/ViewController.swift index 09a0630..7bddb81 100644 --- a/ImageViewer/ViewController.swift +++ b/ImageViewer/ViewController.swift @@ -232,7 +232,8 @@ class ViewController: UIViewController, UIGestureRecognizerDelegate { cover: UIImage( contentsOfFile: dir.appendingPathComponent("cover.jpg").path)!, - metadata: try JSONDecoder().decode( + metadata: + try JSONDecoder().decode( Metadata.self, from: Data( @@ -241,9 +242,9 @@ class ViewController: UIViewController, UIGestureRecognizerDelegate { "metadata.json" ) .path - ).utf8), + ).utf8) ), - path: dir, + path: dir )) } } catch { @@ -261,25 +262,29 @@ class ViewController: UIViewController, UIGestureRecognizerDelegate { } func convertColorToString(color: UIColor) -> String { - return switch color { - case .white: "white" - case .gray: "gray" - case .black: "black" - case .red: "red" - case .blue: "blue" - default: "black" + let r: String! + switch color { + case .white: r = "white" + case .gray: r = "gray" + case .black: r = "black" + case .red: r = "red" + case .blue: r = "blue" + default: r = "black" } + return r } func convertStringToColor(str: String) -> UIColor { - return switch str { - case "white": .white - case "gray": .gray - case "black": .black - case "red": .red - case "blue": .blue - default: .black + let r: UIColor! + switch str { + case "white": r = .white + case "gray": r = .gray + case "black": r = .black + case "red": r = .red + case "blue": r = .blue + default: r = .black } + return r } func getMetadataFromFileName(path: URL) { @@ -426,23 +431,26 @@ class ViewController: UIViewController, UIGestureRecognizerDelegate { if screenSize.width > screenSize.height { scrollOffset.y *= (screenSize.height / screenSize.width) } - let progress: ReadProgress = - switch mode { - case .leftToRight: + var newProgress: ReadProgress = ReadProgress.leftToRight( volumeIndex: progress.v, chapterIndex: progress.c, imageIndex: progress.i) - case .rightToLeft: - ReadProgress.rightToLeft( + + switch mode { + case .leftToRight: + newProgress = ReadProgress.leftToRight( volumeIndex: progress.v, chapterIndex: progress.c, imageIndex: progress.i) - case .scroll: ReadProgress.scroll(scrollOffset) - } + case .rightToLeft: newProgress = ReadProgress.rightToLeft( + volumeIndex: progress.v, chapterIndex: progress.c, + imageIndex: progress.i) + case .scroll: newProgress = ReadProgress.scroll(scrollOffset) + } queue.async { do { try JSONEncoder().encode( LocalState( - progress: progress, backgroundColor: self.convertColorToString(color: color) + progress: newProgress, backgroundColor: self.convertColorToString(color: color) ) ).write( to: self.currentPath.appendingPathComponent("state.json")) @@ -1060,11 +1068,13 @@ class ViewController: UIViewController, UIGestureRecognizerDelegate { } func metaValueToString(m: MetaValue) -> String { + var r = "" if let bonus = m.bonus { - String(m.main) + "." + String(bonus) + r = String(m.main) + "." + String(bonus) } else { - String(m.main) + r = String(m.main) } + return r } func updateInfo() { @@ -1094,20 +1104,20 @@ class ViewController: UIViewController, UIGestureRecognizerDelegate { let lastImage = metadata.volumes[progress.v].chapters[lastChapterIndex].images[ lastImageIndex] - let lastPageString = - if lastImage.doublePage { - String(lastImage.firstPage + 1) - } else { - String(lastImage.firstPage) - } + var lastPageString = "" + if lastImage.doublePage { + lastPageString = String(lastImage.firstPage + 1) + } else { + lastPageString = String(lastImage.firstPage) + } let currentImage = metadata.volumes[progress.v].chapters[progress.c].images[progress.i] - let pageString = - if currentImage.doublePage { - String(currentImage.firstPage) + "-" + String(currentImage.firstPage + 1) - } else { - String(currentImage.firstPage) - } + var pageString = "" + if currentImage.doublePage { + pageString = String(currentImage.firstPage) + "-" + String(currentImage.firstPage + 1) + } else { + pageString = String(currentImage.firstPage) + } text += """ @@ -1194,10 +1204,10 @@ class ViewController: UIViewController, UIGestureRecognizerDelegate { } func setImages(path: URL) { - let scaling: UIView.ContentMode = + let scaling: UIView.ContentMode! if mode == .scroll { - .scaleAspectFill - } else { .scaleAspectFit } + scaling = UIView.ContentMode.scaleAspectFill + } else { scaling = UIView.ContentMode.scaleAspectFit } imageLoader.loadImage( at: getImagePath(progress: progress), @@ -1420,10 +1430,10 @@ class ImageLoader { completion: ((UIImage?) -> Void)? ) { let screenSize = UIScreen.main.bounds.size - let rotation: Rotation = + let rotation: Rotation! if screenSize.width > screenSize.height { - .horizontal - } else { .vertical } + rotation = Rotation.horizontal + } else { rotation = Rotation.vertical } if rotation == .vertical { if let cached = cache.object(forKey: path.path as NSString) { @@ -1510,12 +1520,12 @@ func aspectSize(for imageSize: CGSize, in boundingSize: CGSize, scaling: UIView. { let widthRatio = boundingSize.width / imageSize.width let heightRatio = boundingSize.height / imageSize.height - let scale: CGFloat = - switch scaling { - case .scaleAspectFit: min(widthRatio, heightRatio) - case .scaleAspectFill: max(widthRatio, heightRatio) - default: 1 - } + var scale = CGFloat() + switch scaling { + case .scaleAspectFit: scale = min(widthRatio, heightRatio) + case .scaleAspectFill: scale = max(widthRatio, heightRatio) + default: scale = 1 + } return CGSize( width: imageSize.width * scale, diff --git a/ImageViewerTests/ImageViewerTests.swift b/ImageViewerTests/ImageViewerTests.swift deleted file mode 100644 index 9a731bb..0000000 --- a/ImageViewerTests/ImageViewerTests.swift +++ /dev/null @@ -1,9 +0,0 @@ -import Testing -@testable import ImageViewer - -struct ImageViewerTests { - - @Test func example() async throws { - } - -} diff --git a/ImageViewerUITests/ImageViewerUITests.swift b/ImageViewerUITests/ImageViewerUITests.swift deleted file mode 100644 index e8b171b..0000000 --- a/ImageViewerUITests/ImageViewerUITests.swift +++ /dev/null @@ -1,24 +0,0 @@ -import XCTest - -final class ImageViewerUITests: XCTestCase { - - override func setUpWithError() throws { - continueAfterFailure = false - } - - override func tearDownWithError() throws { - } - - @MainActor - func testExample() throws { - let app = XCUIApplication() - app.launch() - } - - @MainActor - func testLaunchPerformance() throws { - measure(metrics: [XCTApplicationLaunchMetric()]) { - XCUIApplication().launch() - } - } -} diff --git a/ImageViewerUITests/ImageViewerUITestsLaunchTests.swift b/ImageViewerUITests/ImageViewerUITestsLaunchTests.swift deleted file mode 100644 index 1d5d363..0000000 --- a/ImageViewerUITests/ImageViewerUITestsLaunchTests.swift +++ /dev/null @@ -1,23 +0,0 @@ -import XCTest - -final class ImageViewerUITestsLaunchTests: XCTestCase { - - override class var runsForEachTargetApplicationUIConfiguration: Bool { - true - } - - override func setUpWithError() throws { - continueAfterFailure = false - } - - @MainActor - func testLaunch() throws { - let app = XCUIApplication() - app.launch() - - let attachment = XCTAttachment(screenshot: app.screenshot()) - attachment.name = "Launch Screen" - attachment.lifetime = .keepAlways - add(attachment) - } -} diff --git a/run.sh b/run.sh index 8cdef54..b45c52e 100755 --- a/run.sh +++ b/run.sh @@ -1,7 +1,7 @@ #!/bin/sh APP_NAME='ImageViewer' -SIM_DEVICE='iPad Air 11-inch (M3)' +SIM_DEVICE='iPad (10th generation)' SCHEME='ImageViewer' SIMULATOR='iOS Simulator' COMPANY='ImageViewer'