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
| struct GesturesUse: View { | |
| // MARK: - Properties | |
| @State private var currentAmount: CGFloat = 0 | |
| @State private var finalAmount: CGFloat = 1 | |
| @State private var currentAngle: Angle = .degrees(0) | |
| @State private var finalAngle: Angle = .degrees(0) | |
| // MARK: - body | |
| var body: some View { | |
| VStack { |
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 | |
| class Prospect: Identifiable, Codable { | |
| var id = UUID() | |
| var name = "Anonymous" | |
| var emailAddress = "" | |
| fileprivate(set) var isContacted = false | |
| } |
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 CoreImage.CIFilterBuiltins | |
| struct MeView: View { | |
| // MARK: - Properties | |
| @State private var name = "" | |
| @State private var emailAddress = "" | |
| let context = CIContext() |
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 ContentView: View { | |
| // MARK: - Properties | |
| @State private var selectedTab = 0 | |
| // MARK: - Body | |
| var body: some View { | |
| TabView(selection: $selectedTab) { | |
| ProspectsView(filter: .none) | |
| .tabItem { |
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 ProspectsView: View { | |
| // MARK: - Properties | |
| enum FilterType { | |
| case none, contacted, uncontacted | |
| } //: Filtertype enum | |
| let filter: FilterType | |
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 UserNotifications | |
| struct SchedulingLocalNotifications: View { | |
| // MARK: - Properties | |
| // MARK: - Body | |
| var body: some View { | |
| VStack { | |
| Button { |
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
| // MARK: - Body | |
| var body: some View { | |
| Text("Hello World") | |
| .onAppear { | |
| fetchData(from: "https://www.apple.com") { result in | |
| switch result { | |
| case .success(let str): | |
| // print(str) | |
| print("success") | |
| case .failure(let error): |
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
| func fetchData(from urlString: String, completion: @escaping (Result<String, NetworkError>) -> Void) { | |
| // check if url is ok else return failure | |
| guard let url = URL(string: urlString) else { | |
| completion(.failure(.badURL)) | |
| return | |
| } | |
| URLSession.shared.dataTask(with: url) { data, response, error in | |
| DispatchQueue.main.async { | |
| if let data = data { | |
| // if we're here everything worked |
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
| struct ContentView: View { | |
| // MARK: - Properties | |
| let user = User() | |
| // MARK: - Body | |
| var body: some View { | |
| VStack { | |
| EditView() | |
| DisplayView() | |
| } | |
| .environmentObject(user) |