Skip to content

Instantly share code, notes, and snippets.

Also, if you have a bug or a feature request, please go to bugreporter.apple.com. Today we want to focus on questions that will help the broader audience. So, please send us your questions using the Slido panel here in WebEx. Once our moderators approve the questions, they'll appear for everyone to up vote, so we can narrow in on the questions that are of most interest to all of you. So let's jump in. I'm going to claim moderator privilege and start with a couple of questions that I'm particularly interested in. So the first thing I would like to talk about to get the ball rolling is, I just want to ask each of you what your favorite new Swift UI API is this year. Summer, why don't you kick us off? All right, I'm gonna have to go with our new rich text editor. was a big labor of love for my team, and it was super fun, 'cause we got to work cross functionally with foundation, text kit, cortex, UAKit, app kit, everybody. Excellent. Nick, how about you? Uh, for me, this is definitely a safe area bar, kind of an

(Summary generated by ChatGPT based on the automatic transcription. Transcript is attached to this Gist)

Q: What's the best approach to updating my app's UI for the new design?

A:

I think the best approach is to start from either the top down or the bottom up---however you perceive the hierarchy of your application. Focus on the big structural parts, since they tend to be most affected by the design and are often reflected in your code structure. Start there, then focus on the smaller elements.

Follow-up (Mohammed):

@samhenrigold
samhenrigold / q&a.md
Created June 11, 2025 02:07
WWDC25 Camera/Photos Group Lab Q&A

What’s the first class way to use PhotoKit to reimplement a high performance photo grid? We’ve been using a LazyVGrid and the photos caching manager, but are never able to hit the holy trinity (60hz, efficient memory footprint, minimal flashes of placeholder/empty cells)

A few things. It sounds like you're using the PHCachingImageManager already, which is definitely recommended.

One kind of specific note there—you want to use that to get media content delivered before you need to display it. So, for example, let's say you're showing a large grid of photos. You can be prefetching before and after, in expectation that the user's going to scroll. Or, if you're in a one-up situation, prefetching left and right so that you know the user is likely going to swipe, and you can quickly deliver those images to the screen and cache them.

Another thing you should really make sure you're doing is specifying the size you need for the grid size. For example, if your app supports showing a smaller grid

@steipete
steipete / windsurf-auto-continue.js
Last active June 27, 2025 04:49
Windsurf Auto Continue press button JS. Windsurf Menu Help -> Toggle Developer Tools -> Paste into Console.
// Windsurf Auto Press Continue v13.2 (with added logging)
(() => {
const SCRIPT_NAME = 'Windsurf Auto Press Continue v13.2 (logged)'; // Updated name for clarity
let intervalId = null, lastClick = 0;
// --- Config ---
const BTN_SELECTORS = 'span[class*="bg-ide-button-secondary-background"]';
const BTN_TEXT_STARTS_WITH = 'continue';
const SIDEBAR_SELECTOR = null;
const COOLDOWN_MS = 3000;
@senstella
senstella / parakeet-nemo-to-mlx.py
Created May 6, 2025 14:04
A simple script to convert NeMo Parakeet weights to MLX.
import torch
from safetensors.torch import save_file
INPUT_NAME = "model_weights.ckpt"
OUTPUT_NAME = "model.safetensors"
state = torch.load(INPUT_NAME, map_location="cpu")
new_state = {}
for key, value in state.items():
import SQLite3
import Foundation
func main(dbPath: String) {
// Pointer for database connection
var db: OpaquePointer?
// Open database
guard sqlite3_open(dbPath, &db) == SQLITE_OK else {
print("Error opening database: \(String(cString: sqlite3_errmsg(db)))")
@emilyliu7321
emilyliu7321 / bluesky-comments.tsx
Created November 25, 2024 05:39
Integrate Bluesky replies as your blog's comment section
"use client";
/* eslint-disable @next/next/no-img-element */
import Link from "next/link";
import { useState, useEffect } from 'react';
import {
AppBskyFeedDefs,
AppBskyFeedPost,
type AppBskyFeedGetPostThread,
} from "@atproto/api";
@niw
niw / use_var_in_struct.md
Last active June 13, 2025 17:21
Use `var` in `struct` in Swift

Use var in struct in Swift

TL;DR: Use var for properties in struct as long as it serves as a nominal tuple. In most cases, there is no obvious benefit to using let for struct properties.

Simple Example

Let's start with a simple example:

struct MyStruct {
Understand the Task: Grasp the main objective, goals, requirements, constraints, and expected output.
- Minimal Changes: If an existing prompt is provided, improve it only if it's simple. For complex prompts, enhance clarity and add missing elements without altering the original structure.
- Reasoning Before Conclusions: Encourage reasoning steps before any conclusions are reached. ATTENTION! If the user provides examples where the reasoning happens afterward, REVERSE the order! NEVER START EXAMPLES WITH CONCLUSIONS!
- Reasoning Order: Call out reasoning portions of the prompt and conclusion parts (specific fields by name). For each, determine the ORDER in which this is done, and whether it needs to be reversed.
- Conclusion, classifications, or results should ALWAYS appear last.
- Examples: Include high-quality examples if helpful, using placeholders [in brackets] for complex elements.
- What kinds of examples may need to be included, how many, and whether they are complex enough to benefit from p
//
// OCXML.swift
// Created by Marco Arment on 9/23/24.
//
// Released into the public domain. Do whatever you'd like with this.
// No guarantees that it'll do anything, or do it correctly. Good luck!
//
import Foundation