You probably have a WidgetBundle
type in your widget extension like this:
@main
struct MyWidgets: WidgetBundle {
var body: some Widget {
SmallWidget()
MediumWidget()
LargeWidget()
}
<?xml version="1.0" encoding="UTF-8" standalone="no"?> | |
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="6245" systemVersion="13E28" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" initialViewController="vXZ-lx-hvc"> | |
<dependencies> | |
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6238"/> | |
<capability name="Aspect ratio constraints" minToolsVersion="5.1"/> | |
</dependencies> | |
<scenes> | |
<!--View Controller--> | |
<scene sceneID="ufC-wZ-h7g"> | |
<objects> |
You probably have a WidgetBundle
type in your widget extension like this:
@main
struct MyWidgets: WidgetBundle {
var body: some Widget {
SmallWidget()
MediumWidget()
LargeWidget()
}
@testable import SwiftUICaseStudies | |
import XCTest | |
class RefreshableTests: XCTestCase { | |
func testVanilla() async { | |
var k: CheckedContinuation<Void, Never>? = nil | |
let viewModel = PullToRefreshViewModel( | |
fetch: { |
import Dispatch | |
import Foundation | |
var x = 7 | |
let dd = withUnsafeBytes(of: &x, { DispatchData.init(bytes: $0) }) | |
print(dd as? Data) // Case 1: nil | |
print(dd as? NSData) // Case 2: nil | |
print(dd as Any as? Data) // Case 3: nil | |
print(dd as Any as? NSData) // Case 4: .some | |
print(dd as Any as? NSData as Data?) // Case 5: .some |
#import <UIKit/UIKit.h> | |
@interface UIImage (Rob_PDFPage) | |
/** | |
I return an image in which I have drawn page `pageNumber` of the PDF found at `url`. Pages are numbered starting at 1. If I can't draw the page, I return `nil`. | |
*/ | |
+ (UIImage *)Rob_imageWithPDFURL:(NSURL *)url pageNumber:(size_t)pageNumber; | |
@end |
#import "ViewController.h" | |
#import <QuartzCore/QuartzCore.h> | |
@interface ViewController () | |
@end | |
@implementation ViewController { | |
CALayer *_layer; | |
} |
#import <QuartzCore/QuartzCore.h> | |
@interface ArrowLayer : CALayer | |
@property (nonatomic) CGFloat thickness; | |
@property (nonatomic) CGFloat startRadians; | |
@property (nonatomic) CGFloat lengthRadians; | |
@property (nonatomic) CGFloat headLengthRadians; | |
@property (nonatomic, strong) UIColor *fillColor; |
import SwiftUI | |
struct BubbleFramesValue { | |
var framesForKey: [AnyHashable: [CGRect]] = [:] | |
var gradientFrame: CGRect? = nil | |
} | |
struct BubbleFramesKey { } | |
extension BubbleFramesKey: PreferenceKey { |
# Show the Xcode version number over the Dock icon. | |
defaults write com.apple.dt.Xcode DVTEnableDockIconVersionNumber -bool YES | |
# Or set ShowDVTDebugMenu. | |
# Show Index in the Report navigator. | |
# https://pspdfkit.com/blog/2019/how-xcode-indexing-works-and-how-to-solve-problems/ | |
defaults write com.apple.dt.Xcode IDEIndexShowLog -bool YES |
#!/usr/bin/xcrun swift | |
// http://alastairs-place.net/blog/2012/06/06/utis-are-better-than-you-think-and-heres-why/ | |
extension String { | |
static let bitsForCodeUnit: [Character: [UInt8]] = { | |
var dict = [Character: [UInt8]]() | |
for (i, ch) in "abcdefghkmnpqrstuvwxyz0123456789".enumerated() { | |
let bits = Array((0 ..< 5).map({ UInt8((i >> $0) & 1) }).reversed()) | |
dict[ch] = bits |