diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..796b96d --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/build diff --git a/ImageViewer.xcodeproj/project.pbxproj b/ImageViewer.xcodeproj/project.pbxproj index 1dde677..32f2eef 100644 --- a/ImageViewer.xcodeproj/project.pbxproj +++ b/ImageViewer.xcodeproj/project.pbxproj @@ -289,13 +289,14 @@ 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_UIMainStoryboardFile = Main; 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", @@ -316,13 +317,14 @@ 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_UIMainStoryboardFile = Main; 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", diff --git a/ImageViewer/AppDelegate.swift b/ImageViewer/AppDelegate.swift index 885a359..6b89bf6 100644 --- a/ImageViewer/AppDelegate.swift +++ b/ImageViewer/AppDelegate.swift @@ -1,36 +1,15 @@ -// -// AppDelegate.swift -// ImageViewer -// -// Created by Christine Bieker on 04/07/2025. -// - import UIKit -@main +@UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate { + var window: UIWindow? - - 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. - } - - + func application(_ application: UIApplication, + didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool { + window = UIWindow(frame: UIScreen.main.bounds) + window?.rootViewController = ViewController() + window?.makeKeyAndVisible() + return true + } } - diff --git a/ImageViewer/Assets.xcassets/AccentColor.colorset/Contents.json b/ImageViewer/Assets.xcassets/AccentColor.colorset/Contents.json index eb87897..d2ddb70 100644 --- a/ImageViewer/Assets.xcassets/AccentColor.colorset/Contents.json +++ b/ImageViewer/Assets.xcassets/AccentColor.colorset/Contents.json @@ -1,6 +1,10 @@ { "colors" : [ { + "color" : { + "platform" : "universal", + "reference" : "systemGrayColor" + }, "idiom" : "universal" } ], diff --git a/ImageViewer/Assets.xcassets/AppIcon.appiconset/Contents.json b/ImageViewer/Assets.xcassets/AppIcon.appiconset/Contents.json index 2305880..c68da6c 100644 --- a/ImageViewer/Assets.xcassets/AppIcon.appiconset/Contents.json +++ b/ImageViewer/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -1,6 +1,7 @@ { "images" : [ { + "filename" : "icon.png", "idiom" : "universal", "platform" : "ios", "size" : "1024x1024" diff --git a/ImageViewer/Assets.xcassets/AppIcon.appiconset/icon.png b/ImageViewer/Assets.xcassets/AppIcon.appiconset/icon.png new file mode 100644 index 0000000..dc93119 Binary files /dev/null and b/ImageViewer/Assets.xcassets/AppIcon.appiconset/icon.png differ diff --git a/ImageViewer/Base.lproj/LaunchScreen.storyboard b/ImageViewer/Base.lproj/LaunchScreen.storyboard deleted file mode 100644 index 865e932..0000000 --- a/ImageViewer/Base.lproj/LaunchScreen.storyboard +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/ImageViewer/Base.lproj/Main.storyboard b/ImageViewer/Base.lproj/Main.storyboard deleted file mode 100644 index 25a7638..0000000 --- a/ImageViewer/Base.lproj/Main.storyboard +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/ImageViewer/Info.plist b/ImageViewer/Info.plist index dd3c9af..0c67376 100644 --- a/ImageViewer/Info.plist +++ b/ImageViewer/Info.plist @@ -1,25 +1,5 @@ - - UIApplicationSceneManifest - - UIApplicationSupportsMultipleScenes - - UISceneConfigurations - - UIWindowSceneSessionRoleApplication - - - UISceneConfigurationName - Default Configuration - UISceneDelegateClassName - $(PRODUCT_MODULE_NAME).SceneDelegate - UISceneStoryboardFile - Main - - - - - + diff --git a/ImageViewer/SceneDelegate.swift b/ImageViewer/SceneDelegate.swift deleted file mode 100644 index cff02e3..0000000 --- a/ImageViewer/SceneDelegate.swift +++ /dev/null @@ -1,52 +0,0 @@ -// -// SceneDelegate.swift -// ImageViewer -// -// Created by Christine Bieker on 04/07/2025. -// - -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/ImageViewer/ViewController.swift b/ImageViewer/ViewController.swift index 313b25c..454f714 100644 --- a/ImageViewer/ViewController.swift +++ b/ImageViewer/ViewController.swift @@ -1,19 +1,14 @@ -// -// ViewController.swift -// ImageViewer -// -// Created by Christine Bieker on 04/07/2025. -// - import UIKit class ViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() - // Do any additional setup after loading the view. + view.backgroundColor = .white + let label = UILabel() + label.text = "Hello, UIKit!" + label.textAlignment = .center + label.frame = CGRect(x: 50, y: 150, width: 300, height: 50) + view.addSubview(label) } - - } - diff --git a/ImageViewerTests/ImageViewerTests.swift b/ImageViewerTests/ImageViewerTests.swift index c6a7516..9a731bb 100644 --- a/ImageViewerTests/ImageViewerTests.swift +++ b/ImageViewerTests/ImageViewerTests.swift @@ -1,17 +1,9 @@ -// -// ImageViewerTests.swift -// ImageViewerTests -// -// Created by Christine Bieker on 04/07/2025. -// - import Testing @testable import ImageViewer struct ImageViewerTests { @Test func example() async throws { - // Write your test here and use APIs like `#expect(...)` to check expected conditions. } } diff --git a/ImageViewerUITests/ImageViewerUITests.swift b/ImageViewerUITests/ImageViewerUITests.swift index ba5a6d8..e8b171b 100644 --- a/ImageViewerUITests/ImageViewerUITests.swift +++ b/ImageViewerUITests/ImageViewerUITests.swift @@ -1,39 +1,22 @@ -// -// ImageViewerUITests.swift -// ImageViewerUITests -// -// Created by Christine Bieker on 04/07/2025. -// - import XCTest final class ImageViewerUITests: 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/ImageViewerUITests/ImageViewerUITestsLaunchTests.swift b/ImageViewerUITests/ImageViewerUITestsLaunchTests.swift index f99ecf7..1d5d363 100644 --- a/ImageViewerUITests/ImageViewerUITestsLaunchTests.swift +++ b/ImageViewerUITests/ImageViewerUITestsLaunchTests.swift @@ -1,10 +1,3 @@ -// -// ImageViewerUITestsLaunchTests.swift -// ImageViewerUITests -// -// Created by Christine Bieker on 04/07/2025. -// - import XCTest final class ImageViewerUITestsLaunchTests: XCTestCase { @@ -22,9 +15,6 @@ final class ImageViewerUITestsLaunchTests: XCTestCase { 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 diff --git a/run.sh b/run.sh new file mode 100755 index 0000000..9a1841a --- /dev/null +++ b/run.sh @@ -0,0 +1,20 @@ +#!/bin/sh + +APP_NAME='ImageViewer' +SIM_DEVICE='iPad Air 11-inch (M3)' +SCHEME='ImageViewer' +DERIVED_DATA="./build" +SIMULATOR='iOS Simulator' +COMPANY='ImageViewer' + +# Boot and launch simulator +xcrun simctl boot "$SIM_DEVICE" +open -a Simulator + +# Build app +xcodebuild -scheme "$SCHEME" -derivedDataPath "$DERIVED_DATA" -destination "platform=$SIMULATOR,name=$SIM_DEVICE" + +# Install and launch +APP_PATH="$DERIVED_DATA/Build/Products/Debug-iphonesimulator/$APP_NAME.app" +xcrun simctl install booted "$APP_PATH" +xcrun simctl launch booted "$COMPANY.$APP_NAME"