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 | |
struct ContentView: View { | |
private let colors: [Color] = [.red, .orange, .yellow, .green, .blue, .indigo, .purple] | |
private let itemDimension = UIScreen.main.bounds.width * 0.7 | |
private let itemSpacing = CGFloat(16) | |
private let scrollViewHorizontalInset = CGFloat(16) | |
var body: some 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
import CloudKit | |
final class ChangeTokenCache { | |
// MARK: - Zone support | |
/// Determines a unique UserDefaults key for storing zone change tokens | |
/// like from CKFetchRecordZoneChangesOperation | |
private static func userDefaultsKey(_ zoneID: CKRecordZone.ID) -> String { | |
return "token_" + zoneID.ownerName + zoneID.zoneName |
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
// Bigger iPhones = any Max, any Plus, iPhone XR, iPhone 11 | |
switch (UITraitCollection.current.horizontalSizeClass, UITraitCollection.current.verticalSizeClass) { | |
case (.compact, .compact): | |
// Smaller iPhones in landscape | |
case (.compact, .regular): | |
// iPhones in portrait | |
// iPads in portrait during any split screen, |