Check out the repo instead. The Wisdom of Quinn Now with 100% more archived PDFs.
Informative DevForum posts from everyone's favorite DTS member.
(Arranged newest to oldest)
| /// Embeds its content between two horizontal dividers. | |
| struct Davider<Content: View>: View { | |
| let content: Content | |
| init(@ViewBuilder content: () -> Content) { | |
| self.content = content() | |
| } | |
| var body: some View { | |
| HStack { |
Check out the repo instead. The Wisdom of Quinn Now with 100% more archived PDFs.
Informative DevForum posts from everyone's favorite DTS member.
(Arranged newest to oldest)
| import SwiftUI | |
| import PlaygroundSupport | |
| struct iPod: View { | |
| var body: some View { | |
| VStack(spacing: 40) { | |
| Screen() | |
| ClickWheel() | |
| Spacer() | |
| } |
| let createRequest = ZDKCreateRequest() | |
| createRequest.subject = "Hello?" | |
| createRequest.requestDescription = "Is it me you're looking for?" | |
| let requestProvider = ZDKRequestProvider() | |
| requestProvider.createRequest(createRequest) { (response, error) in | |
| if (error != nil) { | |
| // Display / Handle the error | |
| return |
| struct Contact: Decodable, CustomStringConvertible { | |
| var id: String | |
| @NestedKey | |
| var firstname: String | |
| @NestedKey | |
| var lastname: String | |
| @NestedKey | |
| var address: String | |
| enum CodingKeys: String, NestableCodingKey { |
| import Foundation | |
| // Diff objects for better test assertions. | |
| // | |
| // Implemented in a way that: | |
| // 1. The compiler generates as much code as possible | |
| // 2. You'll get a compiler error if you forget a property | |
| // | |
| // Nested support and collections left as an exercise for the reader. |
| // How to: | |
| // 1. Open the Firebase Analytics Dashboard | |
| // 2. Scroll to bottom, where you see the "Users by Device model" widget | |
| // 3. Click "View device models" in that widget (this opens the "Tech details" Firebase Analytics page) | |
| // 4. Above the table shown in the new page, click on the “Device model” drop down menu and select “OS with Version” | |
| // 5. Make sure to select “OS with version” and not “OS Version” | |
| // 6. On the top right corner of the page, click on the “Share this report” icon (next to the date) | |
| // 7. Click “Download file” on the new side bar, then “Download CSV" | |
| // 8. Open the file and select the iOS/Android breakdown raw data | |
| // 9. Replace the sample data in this script with your data |
| // Douglas Hill, December 2018 | |
| // Made for https://douglashill.co/reading-app/ | |
| // Find the latest version of this file at https://github.com/douglashill/KeyboardKit | |
| import UIKit | |
| /// A table view that allows navigation and selection using a hardware keyboard. | |
| /// Only supports a single section. | |
| class KeyboardTableView: UITableView { | |
| // These properties may be set or overridden to provide discoverability titles for key commands. |
| let renderer = UIGraphicsImageRenderer(size: CGSize(width: 400, height: 400)) | |
| let image = renderer.image { | |
| context in | |
| UIColor.lightGray.setFill() | |
| UIRectFill(context.format.bounds) | |
| UIColor.black.set() | |
| UIRectFrame(context.format.bounds) | |
| let text = "TEST IMAGE \n\(Date())" as NSString | |
| let paragraph = NSMutableParagraphStyle() | |
| paragraph.alignment = .center |
| extension NSView { | |
| var snapshot: NSImage { | |
| guard let bitmapRep = bitmapImageRepForCachingDisplayInRect(bounds) else { return NSImage() } | |
| bitmapRep.size = bounds.size | |
| cacheDisplayInRect(bounds, toBitmapImageRep: bitmapRep) | |
| let image = NSImage(size: bounds.size) | |
| image.addRepresentation(bitmapRep) | |
| return image | |
| } | |
| } |