Skip to content

Instantly share code, notes, and snippets.

@amelnychuck
Last active August 5, 2021 11:06
Show Gist options
  • Save amelnychuck/2bd69a7e323be373be4f1d866cf7cde6 to your computer and use it in GitHub Desktop.
Save amelnychuck/2bd69a7e323be373be4f1d866cf7cde6 to your computer and use it in GitHub Desktop.
The goal of this 15min project is to showcase just how easy it is to fake an iOS settings screen. No photoshop text errors, no inconsistencies to reconcile–just a really convincing fake settings screen : )
//
// FakeSettingsView.swift
// FakeSettings
//
// Created by Alex Melnychuck on 8/26/20.
//
// The goal of this 15min project is to showcase just how easy it is to
// fake an iOS settings screen. No photoshop text errors, no
// inconsistencies to reconcile–just a really convincing fake
// settings screen : )
import SwiftUI
struct FakeSettingsView: View {
var body: some View {
NavigationView {
Form {
NavigationLink("Developer", destination: FakeSettingsDetailView(), isActive: .constant(true)) // Always navigate to detail for screenshot purposes
}
.navigationTitle("Settings") // Desired title of back button
}
}
}
struct FakeSettingsDetailView: View {
var firstHeader: some View {
VStack {
Text("Paired Devices")
.padding(.top) // yes this is funky,
.padding(.top) // yes this makes it accurate
}
}
var body: some View {
List {
// Paired Devices Section
Section(header: firstHeader, footer: Text("Removing trusted computers will delete all of the records of computers that you have paired with previously.")) {
Button(action: {}, label: {
Text("Clear Trusted Computers")
})
}
// My Sneaky Section
Section(header: Text("Apple Feedback")) {
Toggle(isOn: .constant(true), label: {
Text("Enable fixes for all open radars")
})
}
// Instruments Section
Section(header: Text("Instruments")) {
NavigationLink("Logging", destination: EmptyView())
}
// UI Automation Section
Section(header: Text("UI Automation")) {
Toggle(isOn: .constant(false), label: {
Text("Enable UI Automation")
})
}
// Networking Section
Section(header: Text("Networking")) {
Picker(selection: .constant(1), label: Text("Network Link Conditioner"), content: {
Text("Off").tag(1)
})
Picker(selection: .constant(1), label: Text("Multipath Networking"), content: {
Text("Off").tag(1)
})
Toggle(isOn: .constant(false), label: {
Text("HTTP/3")
})
Toggle(isOn: .constant(false), label: {
Text("Associated Domains Development")
})
}
// App Clips Testing Section
Section(header: Text("App clips Testing"), footer: Text("Clear the app clip experience cache to immediately show recently modified app clip experiences. Local app clip experiences do not use the cache.")) {
NavigationLink("Local Experiences", destination: EmptyView())
Button(action: {}, label: {
Text("Clear Experience Cache")
})
}
// You get the idea...this is enough for the screenshot : )
}
.listStyle(GroupedListStyle()) // Ensure consistency if running on an iPad : )
.navigationTitle("Developer")
.navigationBarTitleDisplayMode(.inline)
}
}
struct FakeSettingsView_Previews: PreviewProvider {
static var previews: some View {
FakeSettingsView()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment