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
extension SingleValueDecodingContainer { | |
func decodeIfPresent<T>(_ type: T.Type) -> T? where T : Decodable { | |
print(type) | |
return try? decode(type) | |
} | |
} | |
struct MonitorStatus: Decodable { |
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
// | |
// FCRemoteConfig.swift | |
// Brut | |
// | |
// Created by Hugo Saynac on 25/11/2020. | |
// | |
import FirebaseRemoteConfig | |
private let remoteConfigDecoder = JSONDecoder() | |
@propertyWrapper struct FCRemoteConfig<Value: Decodable> { |
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 MapKit | |
struct Profile { | |
var firstName: String | |
var lastName: String | |
var city: String | |
} | |
struct BasicEditableProfileView: 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
// | |
// UserDefaultStored.swift | |
// SwiftUICourse | |
// | |
// Created by Hugo Saynac on 25/06/2020. | |
// | |
import Foundation | |
@propertyWrapper |
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
static public func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [UIImagePickerController.InfoKey : Any]) -> (image: UIImage, url: URL)? { | |
guard let image = info[UIImagePickerController.InfoKey.originalImage] as? UIImage else { return nil } | |
var url: URL? | |
if #available(iOS 11.0, *) { | |
url = info[.imageURL] as? URL | |
} else { | |
url = info[.referenceURL] as? URL | |
} |
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
//: [Previous](@previous) | |
import Foundation | |
class Foo { | |
@objc static var prop1: String? { | |
print("accessed prop1") | |
return "Hello I am prop1!" } | |
@objc static var prop2: String? { | |
print("accessed prop2") |