Skip to content

Instantly share code, notes, and snippets.

extension TimeZone {
 public static let localTimeZone: TimeZone = TimeZone(identifier: "Asia/Calcutta")!
}
extension Date {
struct _Formatter {
static let base: DateFormatter = {
let formatter = DateFormatter()
formatter.dateStyle = DateFormatter.Style.long
formatter.timeZone = TimeZone.localTimeZone
struct ContentView: View {
var body: some View {
VStack {
Text("Text 1 ")
.modifier(LargeTitle())
}
}
}
struct ContentView_Previews: PreviewProvider {
struct ContentView: View {
var body: some View {
List {
Group {
Text("Hello, world!")
Text("Hello, world!")
Text("Hello, world!")
Text("Hello, world!")
Text("Hello, world!")
Text("Hello, world!")
struct ContentView: View {
var body: some View {
VStack {
Text("Text 1 ") + Text("Text 2").font(.title) + Text("Text 3").bold()
}
}
}
struct ContentView_Previews: PreviewProvider {
static var previews: some View {
struct ContentView: View {
@State private var shouldShowAlert1 = false
@State private var shouldShowAlert2 = false
@State private var shouldShowAlert3 = false
var body: some View {
VStack {
Button("Tap here to present Alert - 1") {
shouldShowAlert1 = true
}
struct ContentView: View {
@State private var shouldShowAlert1 = false
var body: some View {
VStack {
IndependentView()
Button("Tap here to present Alert - 1") {
shouldShowAlert1 = true
}
//
// ContentView.swift
// SwiftUI-UITesting-Medium
//
// Created by Dheeru Neelam on 9/16/21.
//
import SwiftUI
struct ContentView: View {
import Foundation
import SwiftUI
struct View1: View {
var body: some View {
ZStack {
Color.red
Text("View - 1")
}
}
enum LaunchArguments {
static let isRunningUITests = "isRunningUITests"
static let noAnimations = "NoAnimations"
static let standardForUAT = [noAnimations, isRunningUITests]
}
class TestDetector {
private enum Keys: String {
case shouldOverrideTitleText = "Override-Label-titleText"
case showView2 = "Override-showView2"
}
static func isRunningUITests() -> Bool {
return ProcessInfo.processInfo.arguments.contains("isRunningUITests")
}