This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import SwiftUI | |
import PlaygroundSupport | |
import Charts | |
// MARK: Chart implementation | |
struct ChartView: View { | |
@Binding var consumption: [Consumption] | |
var body: some View { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import SwiftUI | |
import PlaygroundSupport | |
import Charts | |
// MARK: Chart implementation | |
struct ChartView: View { | |
@Binding var consumption: [Consumption] | |
var body: some View { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extension String { | |
/** | |
Sanitizes the string by obscuring sensitive information. | |
- Returns: A sanitized version of the string where sensitive information is replaced with `*******`. | |
This method searches for specific keys (namely `access_token`, `refresh_token`, and `id_token`) in various formats including JSON-like strings, query strings, HTTP headers, plain text, and also searches for email addresses. It replaces their associated values or the email addresses with a placeholder string to obscure sensitive information. | |
## Examples: | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import SwiftUI | |
struct GeneralSettingsView: View { | |
@State private var settingOneValue = false | |
@State private var settingTwoValue = false | |
@State private var settingThreeValue = false | |
var body: some View { | |
Form { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import SwiftUI | |
@main | |
struct SettingsDemoApp: App { | |
var body: some Scene { | |
WindowGroup { | |
ContentView() | |
} | |
Settings { |
OlderNewer