This file contains 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
// | |
// ContentView.swift | |
// olympics | |
// | |
// Created by Ming on 27/7/2024. | |
// | |
import SwiftUI | |
struct ContentView: View { |
This file contains 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
// | |
// ContentView.swift | |
// Email Block List | |
// | |
// Created by Ming on 5/7/2024. | |
// | |
import SwiftUI | |
struct ContentView: View { |
This file contains 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
// | |
// ContentView.swift | |
// Picker Demo in .navigationLink Style | |
// | |
// Created by Ming on 24/6/2024. | |
// | |
import SwiftUI | |
struct ContentView: View { |
This file contains 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
// | |
// ContentView.swift | |
// Demo | |
// | |
// Created by Ming on 16/11/2022. | |
// | |
import SwiftUI | |
struct ContentView: View { |
This file contains 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
// | |
// WidgetDemo.swift | |
// WidgetDemo | |
// | |
// Created by Ming on 28/7/2022. | |
// | |
import ActivityKit | |
import WidgetKit | |
import SwiftUI |
This file contains 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
// | |
// ContentView.swift | |
// ScenePhase | |
// | |
// Created by Ming on 6/9/2022. | |
// | |
import SwiftUI | |
struct ContentView: View { |
This file contains 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 AVFoundation | |
func toggleTorch(on: Bool) { | |
guard let device = AVCaptureDevice.default(for: .video) else { return } | |
if device.hasTorch { | |
do { | |
try device.lockForConfiguration() | |
device.torchMode = on ? .on : .off |
This file contains 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 ContentView: View { | |
@AppStorage("appIcon") private var appIcon: String = "" | |
@State var appIcons = ["AppIcon", "AppIcon 2"] | |
var body: some View { | |
Picker(selection: $appIcon, label: Text("App Icon Picker")) { | |
ForEach(appIcons, id: \.self) { icon in | |
Text(icon).tag(icon) | |
} |
This file contains 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
struct PizzaDeliveryAttributes: ActivityAttributes { | |
public typealias PizzaDeliveryStatus = ContentState | |
public struct ContentState: Codable, Hashable { | |
var driverName: String | |
var estimatedDeliveryTime: Date | |
} | |
var numberOfPizzas: Int | |
var totalAmount: String |
This file contains 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 ActivityKit | |
import WidgetKit | |
import SwiftUI | |
@main | |
struct Widgets: WidgetBundle { | |
var body: some Widget { | |
PizzaDeliveryActivityWidget() | |
} | |
} |
NewerOlder