See also: UIApplicationDelegate documentation
// AppDelegate.swift
@main
final class AppDelegate: NSObject, UIApplicationDelegate {
func application(
_ application: UIApplication,| import SwiftUI | |
| /// A layout that places views horizontally until the maximum width is filled, and allows views to flow onto new rows. | |
| /// Each row is horizontally centered in the available width. | |
| /// This layout assumes all views have the same height. | |
| struct MasonryLayout: Layout { | |
| let spacing: CGFloat | |
| func makeCache(subviews: Subviews) -> Cache { |
| /// A type-erased shape that is able to inset itself to produce another shape. | |
| /// | |
| /// See: [AnyShape](https://developer.apple.com/documentation/swiftui/anyshape), [InsettableShape](https://developer.apple.com/documentation/swiftui/insettableshape) | |
| struct AnyInsettableShape: InsettableShape { | |
| private let _sizeThatFits: (ProposedViewSize) -> CGSize | |
| private let _path: (CGRect) -> Path | |
| private let _inset: (CGFloat) -> AnyInsettableShape | |
| init<S>(_ shape: S) where S : InsettableShape { |
| import SwiftUI | |
| struct ContentView: View { | |
| var body: some View { | |
| Text("Hello, world!") | |
| .foregroundStyle(.customBackground) | |
| } | |
| } | |
| #Preview { |
| import SwiftUI | |
| struct ContentView: View { | |
| var body: some View { | |
| HStack(spacing: 20) { | |
| ViewThatFits(in: .vertical) { | |
| ChildCombinations(in: VStackLayout(spacing: 0)) { | |
| TestSquare(color: .red) | |
| .combinationPriority(2) |
See also: UIApplicationDelegate documentation
// AppDelegate.swift
@main
final class AppDelegate: NSObject, UIApplicationDelegate {
func application(
_ application: UIApplication,| extension View { | |
| /// Clips this view to its bounding frame, with the specified corner radius for the given corners. | |
| /// | |
| /// By default, a view's bounding frame only affects its layout, so any | |
| /// content that extends beyond the edges of the frame remains visible. Use | |
| /// `cornerRadius(_:corners:)` to hide any content that extends beyond | |
| /// these edges while applying a corner radius. | |
| /// | |
| /// - Returns: A view that clips this view to its bounding frame with the |
| query backwardCompatibility($titleIds: String) { | |
| backwardsCompatibilityRetrieve(titleIds: $titleIds) { | |
| titleBackwardsCompatibilityList { | |
| titleId, | |
| category | |
| } | |
| } | |
| } | |
| query downloadProgress($entitlementId: ID, $duid: ID) { |
| extension Dictionary { | |
| /// Returns a new dictionary containing the keys of this dictionary transformed | |
| /// by the given closure with the existing values. | |
| /// | |
| /// - Parameter transform: A closure that transforms a key. `transform` | |
| /// accepts each key of the dictionary as its parameter and returns a | |
| /// transformed key of the same or of a different type. | |
| /// - Returns: A dictionary containing the transformed keys and values of | |
| /// this dictionary. | |
| /// |
| - (float)compareString:(NSString *)originalString withString:(NSString *)comparisonString { | |
| // Normalize strings | |
| [originalString stringByTrimmingCharactersInSet:NSCharacterSet.newlineCharacterSet]; | |
| [comparisonString stringByTrimmingCharactersInSet:NSCharacterSet.newlineCharacterSet]; | |
| originalString = originalString.lowercaseString; | |
| comparisonString = comparisonString.lowercaseString; | |
| // Step 1 | |
| NSInteger k, i, j, cost, * d, distance; |