You probably have a WidgetBundle
type in your widget extension like this:
@main
struct MyWidgets: WidgetBundle {
var body: some Widget {
SmallWidget()
MediumWidget()
LargeWidget()
}
import SwiftUI | |
extension UnitPoint { | |
/// - returns: The point on the perimeter of the unit square that is at angle `angle` relative to the center of the unit square. | |
init(_ angle: Angle) { | |
// Inspired by https://math.stackexchange.com/a/4041510/399217 | |
// Also see https://www.desmos.com/calculator/k13553cbgk | |
let s = sin(angle.radians) | |
let c = cos(angle.radians) |
// https://adventofcode.com/2022/day/23 | |
import AOC | |
import Preamble | |
let input = readInput() | |
let xinput = """ | |
....#.. | |
..###.# | |
#...#.# |
# https://twitter.com/hillelogram/status/1461103115260805123/photo/1 | |
# https://pikchr.org/home/pikchrshow | |
linerad = 5px | |
B1: box "1" | |
B8: box "8" | |
B9: box "9" | |
B1_2: [ box; "1" color blue at last box ] | |
B2_2: [ box; "2" color blue at last box ] |
import SwiftUI | |
fileprivate struct WidthPreferenceKey: PreferenceKey { | |
static var defaultValue: [AnyHashable: CGFloat] { [:] } | |
static func reduce(value: inout [AnyHashable : CGFloat], nextValue: () -> [AnyHashable : CGFloat]) { | |
value.merge(nextValue(), uniquingKeysWith: { max($0, $1) }) | |
} | |
} |
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>Label</key> | |
<string>com.dqd.stop-simulator-spotlight</string> | |
<key>ProcessType</key> | |
<string>Background</string> | |
<key>ProgramArguments</key> | |
<array> |
You probably have a WidgetBundle
type in your widget extension like this:
@main
struct MyWidgets: WidgetBundle {
var body: some Widget {
SmallWidget()
MediumWidget()
LargeWidget()
}
import SwiftUI | |
fileprivate struct IconWidthKey: PreferenceKey { | |
static var defaultValue: CGFloat? { nil } | |
static func reduce(value: inout CGFloat?, nextValue: () -> CGFloat?) { | |
switch (value, nextValue()) { | |
case (nil, let next): value = next | |
case (_, nil): break | |
case (.some(let current), .some(let next)): value = max(current, next) |
@testable import SwiftUICaseStudies | |
import XCTest | |
class RefreshableTests: XCTestCase { | |
func testVanilla() async { | |
var k: CheckedContinuation<Void, Never>? = nil | |
let viewModel = PullToRefreshViewModel( | |
fetch: { |
#if canImport(Combine) | |
import Combine | |
import CasePaths | |
@available(iOS 13.0, macOS 10.15, tvOS 13.0, watchOS 6.0, *) | |
public typealias Effect<Output> = AnyPublisher<Output, Never> | |
@available(iOS 13.0, macOS 10.15, tvOS 13.0, watchOS 6.0, *) | |
extension Effect { |
import SwiftUI | |
struct BubbleFramesValue { | |
var framesForKey: [AnyHashable: [CGRect]] = [:] | |
var gradientFrame: CGRect? = nil | |
} | |
struct BubbleFramesKey { } | |
extension BubbleFramesKey: PreferenceKey { |