An Xcode project generates the following archive:
$ tree Yams-macosx.xcarchive
Yams-macosx.xcarchive
├── Info.plist
├── Products
│ └── Library
│ └── Frameworks
│ └── Yams.framework
| extension Collection { | |
| subscript(index i : Index) -> Element? { | |
| return indices.contains(i) ? self[i] : nil | |
| } | |
| } | |
| sliceOfArray[index: 0] |
| if array.indices.contains(3) { | |
| print (array[3]) | |
| } |
| import UIKit | |
| #if canImport(SwiftUI) && DEBUG | |
| import SwiftUI | |
| struct UIViewControllerPreview<ViewController: UIViewController>: UIViewControllerRepresentable { | |
| let viewController: ViewController | |
| init(_ builder: @escaping () -> ViewController) { | |
| viewController = builder() | |
| } |
An Xcode project generates the following archive:
$ tree Yams-macosx.xcarchive
Yams-macosx.xcarchive
├── Info.plist
├── Products
│ └── Library
│ └── Frameworks
│ └── Yams.framework
| import Foundation | |
| typealias ApiCallback<Output> = Optional<(Result<Output, Error>) -> Void> | |
| protocol EndpointClient { | |
| func execute<Output>(endpoint: Endpoint<Output>, onResult: ApiCallback<Output>) | |
| } | |
| struct RequestBuilder { | |
| var path: String = "" |
For an emulator that mimics a Pixel 5 Device with Google APIs and ARM architecture (for an M1/M2 Macbook):
List All System Images Available for Download: sdkmanager --list | grep system-images
Download Image: sdkmanager --install "system-images;android-30;google_atd;arm64-v8a"
The Google Cloud Shell gives you a handy and quick Shell access to your Cloud instance. One thing you may not know is that you can use the Cloud Shell to clone and edit a Github project. Let's see how.
The trick here is to just call the following URL: https://console.cloud.google.com/cloudshell/open with the following parameters:
git_repo: this is the URL to your github repositoryopen_in_editor: this would be the file you want to open in the editorpage=editor: this tells the cloud shell to open the code editorAuthor: Chris Lattner
| #!/bin/bash | |
| component=$1 | |
| version=$(/usr/libexec/PlistBuddy -c 'Print CFBundleShortVersionString' Info.plist) | |
| IFS="." read major minor patch <<< "$version" | |
| echo "$version" | |
| if [[ "$component" = 'major' ]]; then |