This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import XCTest | |
enum ShowBugPage { | |
enum Identifiers { | |
static let showBugButton = "Show me a bug" | |
static let showBugAlertMessage = "This is a bug 🐛" | |
static let showBugAlertOkButton = "Ok" | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// MARK: - Asserts | |
extension ShowBugRobot { | |
@discardableResult | |
func assertShowBugAlertMessageDisplayed(file: StaticString = #file, line: UInt = #line) -> Self { | |
let alertMessage = ShowBugPage.Alerts.showBugAlertMessage.waitForExistence(timeout: 5) | |
XCTAssertTrue(alertMessage, "Show bug alert message not displayed", file: file, line: line) | |
return self | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import XCTest | |
// MARK: - Actions | |
struct ShowBugRobot { | |
@discardableResult | |
func tapShowBugButton(file: StaticString = #file, line: UInt = #line) -> Self { | |
let button = ShowBugPage.Buttons.showBugButton | |
XCTAssertTrue(button.exists, "Show bug button does not exist", file: file, line: line) | |
button.tap() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct OnboardingButton: View { | |
// #1 | |
@AppStorage("needsAppOnboarding") var needsAppOnboarding: Bool = true | |
var body: some View { | |
GeometryReader { proxy in | |
LazyHStack { | |
Button(action: { | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct OnboardingView: View { | |
var body: some View { | |
// #1 | |
VStack { | |
Spacer(minLength: 150) | |
Image(systemName: "wand.and.stars") | |
.resizable() | |
.aspectRatio(contentMode: .fit) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extension ContentView { | |
private var mainView: some View { | |
VStack { | |
Spacer() | |
Button(action: { | |
needsAppOnboarding = true | |
}) { | |
Text("Reset Onboarding") | |
.padding(.horizontal, 40) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct ContentView: View { | |
@State private var appSetupState = "App NOT setup ☹️" | |
// #1 | |
@AppStorage("needsAppOnboarding") private var needsAppOnboarding: Bool = true | |
var body: some View { | |
// #2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import SwiftUI | |
import MapKit | |
// Main view | |
struct ContentView: View { | |
// Provides an annotation after some delay (asynchronously) | |
@ObservedObject var asynchronousAnnotationMaker = AsynchronousAnnotationMaker() | |
var body: some View { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import SwiftUI | |
import MapKit | |
// Main view | |
struct ContentView: View { | |
// Provides an annotation after some delay (asynchronously) | |
@ObservedObject var asynchronousAnnotationMaker = AsynchronousAnnotationMaker() | |
var body: some View { |