Skip to content

Latest commit

 

History

History
194 lines (166 loc) · 4.63 KB

SYMBOLS.md

File metadata and controls

194 lines (166 loc) · 4.63 KB

A/B Testing Quickstart SwiftUI Symbols

Table of Contents

ABTestingExampleApp

@main
struct ABTestingExampleApp: App

main point of entry into app

appConfig

var appConfig: AppConfig

stores the AppConfig instance

init

init()

configures the FirebaseApp, configures RemoteConfig, and initializes AppConfig instance

body

var body: some Scene

returns a WindowGroup containing a ContentView with appConfig passed in

AppConfig

AppConfig

class AppConfig: ObservableObject

handles communication with RemoteConfig and updating the UI

colorScheme

@Published var colorScheme: ColorScheme

stores the color scheme for the app

init

init()

updates app's color scheme from RemoteConfig and adds observer to print installation auth token if it changes on platforms other than Mac Catalyst

deinit

deinit

removes installation auth token change observer on platforms other than Mac Catalyst

updateFromRemoteConfig

func updateFromRemoteConfig()

retrieves color scheme from RemoteConfig and updates app's color scheme on the main thread if it has changed

updateFromRemoteConfigAsync

@available(iOS 15, tvOS 15, macOS 12, watchOS 8, *)
func updateFromRemoteConfigAsync() async

retrieves color scheme from RemoteConfig asynchronously and updates app's color scheme on the main thread if it has changed

printInstallationAuthToken

@objc func printInstallationAuthToken()

prints installation auth token on platforms other than Mac Catalyst

ColorScheme

extension ColorScheme

extends ColorScheme to deal with String initializer

init

init(_ value: String)

returns the corresponding ColorScheme, defaulting to light otherwise

RemoteConfigFetchAndActivateStatus

extension RemoteConfigFetchAndActivateStatus

extends RemoteConfigFetchAndActivateStatus with debug description

debugDescription

var debugDescription: String { get }

prints String representation of status

ContentView

ContentView

struct ContentView: View

main content view

appConfig

@ObservedObject var appConfig: AppConfig

stores app's AppConfig instance

body

var body: some View { get }

returns a FirebaseList wrapped with NavigationView when not on macOS

FirebaseList

struct FirebaseList: View

multi-platform view for a BasicList populated with Firebase data

appConfig

@ObservedObject var appConfig: AppConfig

stores app's AppConfig instance

data

let data: [(title: String, subtitle: String)]

stores array of title-subtitle String pairings specific to Firebase

body

var body: some View { get }

returns VStack containing a BasicList populated with the Firebase data on top of a "Refresh" Button, which updates appConfig's color scheme from Remote Config and is done asynchronously if refreshed by pulling down on the list on iOS 15, with a navigation title of "Firenotes", preferred color scheme of appConfig's color scheme, and foreground color corresponding to appConfig's color scheme (orange for dark color scheme, primary for light color scheme)

BasicList

struct BasicList: View

view for a basic list of title-subtitle String pairings

data

let data: [(title: String, subtitle: String)]

stores array of title-subtitle String pairings

body

var body: some View { get }

returns List of VStacks each containing a Text title on top of a Text subtitle derived from data