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
| // | |
| // KeychainManager.swift | |
| // | |
| // Created by Ömer Ulusal on 11/09/2023. | |
| // | |
| import AuthenticationServices | |
| final class KeychainManager { | |
| static let shared: KeychainManager = .init() |
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
| // | |
| // ConfigManager.swift | |
| // | |
| // Created by Ömer Ulusal on 19/08/2023. | |
| // | |
| import FirebaseRemoteConfig | |
| final class ConfigManager { | |
| static let shared = ConfigManager() |
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 | |
| public struct ContentView: View { | |
| @State private var showingBottomSheet = false | |
| @State private var sheetContentHeight = CGFloat(0) | |
| public init() {} | |
| public var body: some View { | |
| Button("Show Bottom Sheet") { |
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 | |
| @propertyWrapper | |
| struct LocalJson<T> where T: Decodable { | |
| private let fileName: String | |
| var wrappedValue: T { | |
| guard let result = loadJson(fileName: fileName) else { | |
| fatalError("Cannot load json data \(fileName)") | |
| } |
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 | |
| // Question 1 | |
| struct Cat { | |
| var age: Int | |
| } | |
| var cat = Cat(age: 5) | |
| var fluffyCat = cat | |
| fluffyCat.age = 3 |
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 | |
| protocol AnimalFeed { | |
| associatedtype CropType: Crop where CropType.FeedType == Self | |
| static func grow() -> CropType | |
| } | |
| protocol Crop { | |
| associatedtype FeedType: AnimalFeed | |
| func harvest() -> FeedType |
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 { | |
| @State var isFaceUp: Bool = true | |
| let timer = Timer.publish(every: 2, on: .main, in: .common).autoconnect() | |
| var body: some View { | |
| ZStack { | |
| FrontCardSide().opacity(isFaceUp ? 1 : 0) |