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 Foundation | |
| import Combine | |
| class CoinDataService { | |
| @Published var allCoins: [Coin] = [] | |
| var subscription: AnyCancellable? | |
| init() { | |
| getCoins() |
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 Foundation | |
| import Combine | |
| class NetworkManager { | |
| enum NetworkingError: LocalizedError { | |
| case badURLResponse(url: URL) | |
| case unknown | |
| var errorDescription: String? { |
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 | |
| @State private var selectedTab = 0 | |
| // MARK: - Body | |
| var body: some View { | |
| TabView(selection: $selectedTab) { | |
| HomeView() | |
| .tag(0) | |
| Text("Open") |
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 TabBarView: View { | |
| // MARK: - Properties | |
| @Binding var selectedTab: Int | |
| @Namespace private var currentTab | |
| // MARK: - Body | |
| var body: some View { | |
| HStack { | |
| ForEach(tabs.indices) { index in |
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
| // | |
| // GoogMapView.swift | |
| // Landmarks | |
| // | |
| // | |
| import SwiftUI | |
| import UIKit | |
| import GoogleMaps | |
| import GooglePlaces |
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 Foundation | |
| import UIKit | |
| import SwiftUI | |
| import GooglePlaces | |
| struct PlacePicker: UIViewControllerRepresentable { | |
| func makeCoordinator() -> Coordinator { | |
| Coordinator(self) |
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
| @dynamicMemberLookup | |
| struct JSON: RandomAccessCollection { | |
| var value: Any? | |
| var startIndex: Int { array.startIndex } | |
| var endIndex: Int { array.endIndex } | |
| init(string: String) throws { | |
| let data = Data(string.utf8) | |
| value = try JSONSerialization.jsonObject(with: data) | |
| } |
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
| class XMLNode { | |
| let tag: String | |
| var data: String | |
| let attributes: [String: String] | |
| var childNodes: [XMLNode] | |
| init(tag: String, data: String, attributes: [String: String], childNodes: [XMLNode]) { | |
| self.tag = tag | |
| self.data = data | |
| self.attributes = attributes |
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
| .toolbar { | |
| Button { | |
| let records = project.prepareCloudRecords() | |
| let operation = CKModifyRecordsOperation(recordsToSave: records, recordIDsToDelete: nil) | |
| operation.savePolicy = .allKeys | |
| operation.modifyRecordsResultBlock = { result in | |
| switch result { | |
| case .success: | |
| 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
| var body: some View { | |
| VStack(spacing: 5) { | |
| ForEach(items) { item in | |
| // swiftlint:disable line_length | |
| Link(destination: URL(string: "net.naolin.PortfolioApp:///\(items.first!.objectID.uriRepresentation().absoluteString)")!) { | |
| HStack { | |
| Color(item.project?.color ?? "Light Blue") | |
| .frame(width: 5) | |
| .clipShape(Capsule()) |