$ xcrun simctl list --json
$ xcrun simctl delete unavailable
| // SwiftUI public API | |
| public protocol View { | |
| associatedtype Body: View | |
| var body: Self.Body { get } | |
| } | |
| extension Never: View { | |
| public typealias Body = Never |
| // The SwiftUI Lab | |
| // Website: https://swiftui-lab.com | |
| // Article: https://swiftui-lab.com/alignment-guides | |
| import SwiftUI | |
| class Model: ObservableObject { | |
| @Published var minimumContainer = true | |
| @Published var extendedTouchBar = false | |
| @Published var twoPhases = true |
| class CircularBuffer<T> { | |
| var bufferMaxSize: Int | |
| var size = 0 | |
| var elements = Array<T?>(repeating: nil, count: 8) | |
| var front: T? { | |
| if isEmpty() { | |
| return nil | |
| } else { |
| // Zipping.swift | |
| // known-good: Swift 4.2 | |
| // Alexis Gallagher | |
| import Foundation | |
| public extension URL { | |
| /// Creates a zip archive of the file or folder represented by this URL and returns a references to the zipped file | |
| /// |
| struct SuperEllipse { | |
| static func superEllipse(forRect rect: CGRect, topRightCornerRadius trcr: CGFloat, bottomRightCornerRadius brcr: CGFloat, bottomLeftCornerRadius blcr: CGFloat, topLeftCornerRadius tlcr: CGFloat) -> UIBezierPath { | |
| let trcr = 1.2 * trcr | |
| let brcr = 1.2 * brcr | |
| let blcr = 1.2 * blcr | |
| let tlcr = 1.2 * tlcr | |
| let path = UIBezierPath() | |
| <div data-controller="smart-scroll" | |
| data-action="smart-scroll:added->smart-scroll#handleAdded | |
| resize->smart-scroll#handleAdded | |
| scroll->smart-scroll#handleScroll"> | |
| <div data-controller="smart-scroll-item"> | |
| aya: an an | |
| </div> | |
| <div data-controller="smart-scroll-item"> | |
| hatate: ni hao | |
| </div> |
| import Foundation | |
| func setupCodeFrom(uri: String) -> String { | |
| let startIndex = uri.index(uri.startIndex, offsetBy: "X-HM://".count) | |
| let endIndex = uri.index(uri.endIndex, offsetBy: -4) | |
| var actualString = uri[startIndex..<endIndex] | |
| let number = UInt(actualString, radix: 36)! | |
| var code = String(format: "%08u", number & 0x7ffffff) |
| // UICollectionView Objective-C example | |
| - (void)viewWillAppear:(BOOL)animated { | |
| [super viewWillAppear:animated]; | |
| NSIndexPath *selectedIndexPath = [[self.collectionView indexPathsForSelectedItems] firstObject]; | |
| if (selectedIndexPath != nil) { | |
| id<UIViewControllerTransitionCoordinator> coordinator = self.transitionCoordinator; | |
| if (coordinator != nil) { | |
| [coordinator animateAlongsideTransition:^(id<UIViewControllerTransitionCoordinatorContext> context) { |
| // Swift 4 | |
| // Check out the history for contributions and acknowledgements. | |
| extension String { | |
| /// Returns a new string made by replacing all HTML character entity references with the corresponding character. | |
| /// | |
| /// - Returns: decoded string | |
| func decodingHTMLEntities() -> String { | |
| var result = String() | |
| var position = startIndex |