Exhaustive file-by-file audit of every Swift file in the project (iOS app, Watch app, Widget extension). Every interactive UI element — buttons, toggles, pickers, links, menus, tap gestures, text editors, color pickers, photo pickers — now has an accessibilityIdentifier for XCUITest automation. 46 files changed across Shared/, Onboarding/, Watch App/, and Widget targets. Added ~100 new ID definitions covering settings debug controls, export/photo views, sharing templates, customization subviews, onboarding flows, tip modals, widget voting buttons, and watch mood buttons.
86 lines
3.0 KiB
Swift
86 lines
3.0 KiB
Swift
//
|
|
// OnboardingTitle.swift
|
|
// Reflect (iOS)
|
|
//
|
|
// Created by Trey Tartt on 1/20/22.
|
|
//
|
|
|
|
import SwiftUI
|
|
|
|
struct OnboardingTitle: View {
|
|
static let titleOptions = [
|
|
String(localized: "onboarding_title_title_option_1"),
|
|
String(localized: "onboarding_title_title_option_2"),
|
|
String(localized: "onboarding_title_title_option_3")]
|
|
|
|
@ObservedObject var onboardingData: OnboardingData
|
|
|
|
var body: some View {
|
|
ScrollView {
|
|
VStack{
|
|
Text(String(localized: "onboarding_title_title"))
|
|
.font(.title)
|
|
.foregroundColor(Color(UIColor.white))
|
|
.padding([.trailing, .leading], 55)
|
|
.padding([.top], 25)
|
|
|
|
ForEach(OnboardingTitle.titleOptions, id: \.self) { option in
|
|
Button(action: {
|
|
// onboardingData.title = option
|
|
}, label: {
|
|
Text(option)
|
|
.font(.subheadline.weight(.bold))
|
|
.foregroundColor(.white)
|
|
.padding(10)
|
|
.background(RoundedRectangle(cornerRadius: 10).stroke().foregroundColor(Color.white))
|
|
.cornerRadius(10)
|
|
})
|
|
.buttonStyle(PlainButtonStyle())
|
|
.accessibilityIdentifier(AccessibilityID.Onboarding.titleOptionButton)
|
|
.padding([.top], 10)
|
|
}
|
|
|
|
Text(String(localized: "onboarding_title_type_your_own"))
|
|
.font(.body)
|
|
.foregroundColor(Color(UIColor.white))
|
|
.padding([.top], 25)
|
|
.padding([.trailing, .leading], 55)
|
|
|
|
// TextField("Notification", text: $onboardingData.title)
|
|
// .frame(height: 44)
|
|
// .foregroundColor(Color(UIColor.white))
|
|
// .textFieldStyle(PlainTextFieldStyle())
|
|
// .padding([.leading, .trailing], 4)
|
|
// .cornerRadius(16)
|
|
// .overlay(RoundedRectangle(cornerRadius: 16).stroke(Color.white))
|
|
// .padding([.leading, .trailing], 75)
|
|
// .padding([.top], 45)
|
|
|
|
Spacer()
|
|
}
|
|
}
|
|
.background {
|
|
ZStack {
|
|
Color.orange
|
|
Image("average", bundle: .main)
|
|
.foregroundColor(Color(UIColor.darkText))
|
|
.opacity(0.04)
|
|
.scaleEffect(1.2)
|
|
.padding(.bottom, 55)
|
|
.accessibilityHidden(true)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
struct OnboardingTitle_Previews: PreviewProvider {
|
|
static var previews: some View {
|
|
Group {
|
|
OnboardingTitle(onboardingData: OnboardingData())
|
|
|
|
OnboardingTitle(onboardingData: OnboardingData())
|
|
.preferredColorScheme(.dark)
|
|
}
|
|
}
|
|
}
|