Skip to content

Instantly share code, notes, and snippets.

View aataraxiaa's full-sized avatar
:octocat:
Focusing

Pete Smith aataraxiaa

:octocat:
Focusing
  • DuckDuckGo
  • 10:28 (UTC +01:00)
View GitHub Profile
import XCTest
enum ShowBugPage {
enum Identifiers {
static let showBugButton = "Show me a bug"
static let showBugAlertMessage = "This is a bug 🐛"
static let showBugAlertOkButton = "Ok"
}
// 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
}
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()
@aataraxiaa
aataraxiaa / Z1_Chat_Close_Button.swift
Created March 24, 2021 13:53
Z1_Chat_Close_Button
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
Chat.initialize(accountKey: "", appId: "")
}
@IBAction func buttonPressed(_ sender: Any) {
struct OnboardingButton: View {
// #1
@AppStorage("needsAppOnboarding") var needsAppOnboarding: Bool = true
var body: some View {
GeometryReader { proxy in
LazyHStack {
Button(action: {
struct OnboardingView: View {
var body: some View {
// #1
VStack {
Spacer(minLength: 150)
Image(systemName: "wand.and.stars")
.resizable()
.aspectRatio(contentMode: .fit)
extension ContentView {
private var mainView: some View {
VStack {
Spacer()
Button(action: {
needsAppOnboarding = true
}) {
Text("Reset Onboarding")
.padding(.horizontal, 40)
struct ContentView: View {
@State private var appSetupState = "App NOT setup ☹️"
// #1
@AppStorage("needsAppOnboarding") private var needsAppOnboarding: Bool = true
var body: some View {
// #2
import SwiftUI
import MapKit
// Main view
struct ContentView: View {
// Provides an annotation after some delay (asynchronously)
@ObservedObject var asynchronousAnnotationMaker = AsynchronousAnnotationMaker()
var body: some View {
import SwiftUI
import MapKit
// Main view
struct ContentView: View {
// Provides an annotation after some delay (asynchronously)
@ObservedObject var asynchronousAnnotationMaker = AsynchronousAnnotationMaker()
var body: some View {