Skip to content

Commit

Permalink
Create new app using Xcode 15.1, named TemplateApp
Browse files Browse the repository at this point in the history
  • Loading branch information
mbernson committed Jan 17, 2024
1 parent cf545d5 commit c22744c
Show file tree
Hide file tree
Showing 14 changed files with 213 additions and 183 deletions.
16 changes: 0 additions & 16 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,17 +1 @@
# Xcode user settings
xcuserdata

# Fastlane output
fastlane/test_output
fastlane/report.xml

# Xcode test result bundles
*.xcresult

# Certificates
*.cer

# Build artifacts
*.ipa
*.zip
*.xcarchive
3 changes: 0 additions & 3 deletions README.md

This file was deleted.

Large diffs are not rendered by default.

File renamed without changes.
4 changes: 2 additions & 2 deletions Template/ContentView.swift → TemplateApp/ContentView.swift
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
//
// ContentView.swift
// Template
// TemplateApp
//
// Created by Mathijs Bernson on 08/12/2023.
// Created by Mathijs Bernson on 17/01/2024.
//

import SwiftUI
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
//
// TemplateApp.swift
// Template
// TemplateAppApp.swift
// TemplateApp
//
// Created by Mathijs Bernson on 08/12/2023.
// Created by Mathijs Bernson on 17/01/2024.
//

import SwiftUI

@main
struct TemplateApp: App {
struct TemplateAppApp: App {
var body: some Scene {
WindowGroup {
ContentView()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
//
// TemplateTests.swift
// TemplateTests
// TemplateAppTests.swift
// TemplateAppTests
//
// Created by Mathijs Bernson on 08/12/2023.
// Created by Mathijs Bernson on 17/01/2024.
//

import XCTest
@testable import Template
@testable import TemplateApp

final class TemplateTests: XCTestCase {
final class TemplateAppTests: XCTestCase {

override func setUpWithError() throws {
// Put setup code here. This method is called before the invocation of each test method in the class.
Expand All @@ -24,7 +24,13 @@ final class TemplateTests: XCTestCase {
// Any test you write for XCTest can be annotated as throws and async.
// Mark your test throws to produce an unexpected failure when your test encounters an uncaught error.
// Mark your test async to allow awaiting for asynchronous code to complete. Check the results with assertions afterwards.
XCTAssertEqual(21 + 21, 42)
}

func testPerformanceExample() throws {
// This is an example of a performance test case.
self.measure {
// Put the code you want to measure the time of here.
}
}

}
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
//
// TemplateUITests.swift
// TemplateUITests
// TemplateAppUITests.swift
// TemplateAppUITests
//
// Created by Mathijs Bernson on 08/12/2023.
// Created by Mathijs Bernson on 17/01/2024.
//

import XCTest

final class TemplateUITests: XCTestCase {
final class TemplateAppUITests: XCTestCase {

override func setUpWithError() throws {
// Put setup code here. This method is called before the invocation of each test method in the class.
Expand All @@ -28,7 +28,14 @@ final class TemplateUITests: XCTestCase {
app.launch()

// Use XCTAssert and related functions to verify your tests produce the correct results.
XCTAssertTrue(app.staticTexts["Hello, world!"].exists)
}

func testLaunchPerformance() throws {
if #available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 7.0, *) {
// This measures how long it takes to launch your application.
measure(metrics: [XCTApplicationLaunchMetric()]) {
XCUIApplication().launch()
}
}
}
}
32 changes: 32 additions & 0 deletions TemplateAppUITests/TemplateAppUITestsLaunchTests.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
//
// TemplateAppUITestsLaunchTests.swift
// TemplateAppUITests
//
// Created by Mathijs Bernson on 17/01/2024.
//

import XCTest

final class TemplateAppUITestsLaunchTests: XCTestCase {

override class var runsForEachTargetApplicationUIConfiguration: Bool {
true
}

override func setUpWithError() throws {
continueAfterFailure = false
}

func testLaunch() throws {
let app = XCUIApplication()
app.launch()

// Insert steps here to perform after app launch but before taking a screenshot,
// such as logging into a test account or navigating somewhere in the app

let attachment = XCTAttachment(screenshot: app.screenshot())
attachment.name = "Launch Screen"
attachment.lifetime = .keepAlways
add(attachment)
}
}

0 comments on commit c22744c

Please sign in to comment.