A collection of all of the various options and styles available to you if you'd like to format data into string on iOS 15.
See every option in detail at fuckingformatstyle.com or goshdarnformatstyle.com.
A collection of all of the various options and styles available to you if you'd like to format data into string on iOS 15.
See every option in detail at fuckingformatstyle.com or goshdarnformatstyle.com.
| import Combine | |
| import SwiftUI | |
| extension View { | |
| public func focused<T>(file: StaticString = #file, _ state: FocusState<T>, equals value: T) -> some View { | |
| modifier(FocusedModifier(state: state, id: value, file: file)) | |
| } | |
| } | |
| @propertyWrapper |
| import SwiftUI | |
| extension View { | |
| public func discover<T: UIView>( | |
| where predicate: @escaping (T) -> Bool = { _ in true }, | |
| _ closure: @escaping (T) -> Void | |
| ) -> some View { | |
| overlay( | |
| DiscoveryView(predicate: predicate, setup: closure) | |
| .frame(width: 0, height: 0) |
| struct SizePreferenceKey: PreferenceKey { | |
| static var defaultValue: CGSize = .zero | |
| static func reduce(value: inout CGSize, nextValue: () -> CGSize) { | |
| value = nextValue() | |
| } | |
| } | |
| struct RelativeSizeModifier: ViewModifier { | |
| let percentWidth: CGFloat |
| import Darwin | |
| import Foundation | |
| import UIKit | |
| // https://github.com/xybp888/iOS-SDKs/blob/master/iPhoneOS17.1.sdk/System/Library/PrivateFrameworks/CoreSVG.framework/CoreSVG.tbd | |
| // https://developer.limneos.net/index.php?ios=17.1&framework=UIKitCore.framework&header=UIImage.h | |
| @objc | |
| class CGSVGDocument: NSObject { } |
It seems all new scaleway servers are created without swap. For people, like me who want to use some, there is the easy way (ex. is for 8Go) :
sudo dd if=/dev/zero of=/swap bs=1024 count=8388608
sudo chmod 0600 /swap
sudo mkswap /swap
sudo swapon /swap
free -h| struct User: Equatable { | |
| var firstName: String | |
| var lastName: String | |
| } | |
| @main | |
| struct MyApp: App { | |
| @State var value = User(firstName: "", lastName: "") | |
| @State var showEdit = false |
| import Foundation | |
| public protocol CodingStrategy { | |
| associatedtype Converted | |
| associatedtype RawValue: Codable | |
| static func toRaw(_ value: Converted) throws -> RawValue | |
| static func toValue(_ raw: RawValue) throws -> Converted | |
| } |
| /// - returns: `true` when dynamic type is `Equatable` and `==` returns `true`, otherwise `false`. | |
| func areEquatablyEqual(_ lhs: Any, _ rhs: Any) -> Bool { | |
| func receiveLHS<LHS>(_ typedLHS: LHS) -> Bool { | |
| guard | |
| let rhsAsLHS = rhs as? LHS | |
| else { return false } | |
| return areEquatablyEqual(typedLHS, rhsAsLHS) | |
| } | |
| return _openExistential(lhs, do: receiveLHS) | |
| } |