I hereby claim:
- I am mergesort on github.
- I am mergesort (https://keybase.io/mergesort) on keybase.
- I have a public key ASBrCbe4NtxBhbKR8uhxRvW3Eti48la91J-Biph4klTPNAo
To claim this, I am signing this object:
tell application "System Events" | |
if (name of processes) contains "Xcode" then | |
-- Check if Xcode is already the active/focused application | |
if (name of first application process whose frontmost is true) is not "Xcode" then | |
tell application "Xcode 16.2 (Beta)" | |
activate | |
delay 0.25 -- Wait for Xcode to become active | |
end tell | |
end if |
import Foundation | |
public enum Platform { | |
case iOS | |
case iOSOnMac | |
case mac | |
} | |
public func execute(if condition: Bool, _ action: () -> Void) { | |
if condition { |
public final class LiveActivitiesController<Model: Identifiable & Equatable & Codable, ModelActivity: ActivityAttributes & Identifiable>: ObservableObject { | |
var activityFromModel: (Model) -> ModelActivity | |
var contentStateFromModel: (Model) -> ModelActivity.ContentState | |
public init(activityFromModel: @escaping (Model) -> ModelActivity, contentStateFromModel: @escaping (Model) -> ModelActivity.ContentState) { | |
self.activityFromModel = activityFromModel | |
self.contentStateFromModel = contentStateFromModel | |
} |
// Problem: Converting a Color to UIColor via the UIColor(Color) initializer does not properly respect dark/light mode. | |
// This becomes an issue when you have a color palette that provides different colors for dark and light mode, for example a red that's rendered darker in dark mode. | |
// This came up because I use asset catalogs for my apps color palettes, if you'd like to learn how to make slick SwiftUI color palettes check out: https://build.ms/2021/08/24/creating-slick-color-palette-apis | |
/////////////////////////// | |
// Solution: This extension | |
/////////////////////////// |
import SwiftUI | |
let colors = [ | |
Color.pink, | |
Color.blue, | |
Color.green, | |
Color.orange, | |
Color.purple, | |
Color.black, | |
] |
import UIKit | |
extension UIViewController { | |
/// This function adds a `UIViewController` as a childViewController, | |
/// and calls the appropriate lifecycle methods. | |
/// | |
/// - Parameter childViewController: The childViewController to add to the view. | |
func add(childViewController: UIViewController) { | |
self.addChildViewController(childViewController) |
{ | |
"id": 0, | |
"position_id": 0, | |
"user_id": 0, | |
"noun_list_icon_id": 3, | |
"private": false, | |
"shared": false, | |
"master_list": false, | |
"title": "Search Results", | |
"description": "Search results found for 'godfather' in movies.", |
import UIKit | |
extension UIViewController { | |
/// This function adds a `UIViewController` as a childViewController, | |
/// and calls the appropriate lifecycle methods. | |
/// | |
/// - Parameter childViewController: The childViewController to add to the view. | |
func add(childViewController: UIViewController) { | |
self.addChildViewController(childViewController) |
I hereby claim:
To claim this, I am signing this object:
// | |
// TextEffectView.swift | |
// TextEffects | |
// | |
// Created by Ben Scheirman on 2/15/16. | |
// Copyright © 2016 NSScreencast. All rights reserved. | |
// | |
import UIKit | |
import CoreText |