| Name | URL | Section | Bundle ID |
|---|---|---|---|
| Apps | file:///System/Applications/Apps.app/ |
persistentApps |
com.apple.apps.launcher |
| Safari | file:///System/Volumes/Preboot/Cryptexes/App/System/Applications/Safari.app/ |
persistentApps |
com.apple.Safari |
| Messages | file:///System/Applications/Messages.app/ |
persistentApps |
com.apple.MobileSMS |
file:///System/Applications/Mail.app/ |
persistentApps |
com.apple.mail |
|
| Maps | file:///System/Applications/Maps.app/ |
In iOS 16, Apple added UIHostingConfiguration, making it straightforward to use a SwiftUI view in instances of UICollectionViewCell and UITableViewCell. This gist shows how UIHostingConfiguration can be backported to iOS 14 by implementing a type that conforms to UIContentConfiguration.
Starting from iOS 16, we can use SwiftUI views in an instance of UICollectionView or UITableViewCell like this:
cell.contentConfiguration = UIHostingConfiguration {
ExampleCellContentView(color: Color(item.color), text: item.text)
}
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # ----------------------------------------------------------------------------- | |
| # AI-powered Git Commit Function | |
| # Copy paste this gist into your ~/.bashrc or ~/.zshrc to gain the `gcm` command. It: | |
| # 1) gets the current staged changed diff | |
| # 2) sends them to an LLM to write the git commit message | |
| # 3) allows you to easily accept, edit, regenerate, cancel | |
| # But - just read and edit the code however you like | |
| # the `llm` CLI util is awesome, can get it here: https://llm.datasette.io/en/stable/ | |
| gcm() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env sh | |
| # usage: sh ./generate-target-dependencies.sh | dot -Tsvg -o target-graph.svg | |
| packages=`swift package describe --type json` | |
| targets=`echo $packages | jq '.targets'` | |
| target_names=`echo $targets | jq -r '.[] | .name'` | |
| body="" | |
| template=`cat <<EOF | |
| digraph DependenciesGraph { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /// Wait for async operation to return value and call callback with the value | |
| /// This class is intended to workaround/simplify async/await + actors isolation | |
| /// https://twitter.com/krzyzanowskim/status/1523233140914876416 | |
| private class AsyncWaiter<T> { | |
| var didReceiveValue: Bool = false | |
| let value: (T) -> Void | |
| let operation: () async throws -> T | |
| init(_ value: @escaping (T) -> Void, operation: @escaping () async throws -> T) { | |
| self.value = value |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| # | |
| # Disable Siri Suggestions on Simulators and SwiftUI Previews to | |
| # avoid Spotlight heating up your MacBook by keeping 4 cores busy | |
| # at 100%. | |
| # | |
| # See https://developer.apple.com/forums/thread/683277 | |
| # |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import Combine | |
| import Foundation | |
| @available(iOS 13.0, macOS 10.15, tvOS 13, watchOS 6, *) | |
| public struct ObjectDidChangePublisher<ObjectWillChangePublisher: Publisher>: Publisher { | |
| private let upstream: ObjectWillChangePublisher | |
| public typealias Output = ObjectWillChangePublisher.Output | |
| public typealias Failure = ObjectWillChangePublisher.Failure | |
| fileprivate init(upstream: ObjectWillChangePublisher) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import SwiftUI | |
| import UIKit | |
| struct ContentView: View { | |
| var body: some View { | |
| NoSepratorList { | |
| Text("Message 1") | |
| Text("Message 1") | |
| Text("Message 1") | |
| Text("Message 1") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import SwiftUI | |
| // https://medium.com/@lyeskinnikitaalexandrovich/mastering-xcode-previews-with-snapkit-uikit-aa82a146059a | |
| enum DebugPreviewLayout { | |
| case fitWidth(CGFloat) | |
| case fitHeight(CGFloat) | |
| case `default` | |
| } | |
| final class DebugPreviewLayoutView: UIView { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import Combine | |
| import Foundation | |
| /// A thread-safe store for cancellables which addresses usability pain points | |
| /// with stock Combine apis. | |
| /// | |
| /// ## Thread-safe storage of cancellables | |
| /// | |
| /// let cancelBag = CancelBag() | |
| /// cancellable.store(in: cancelBag) |
NewerOlder