Skip to content

Instantly share code, notes, and snippets.

View fatbobman's full-sized avatar

Fatbobman(东坡肘子) fatbobman

View GitHub Profile
@samhenrigold
samhenrigold / _WWDC25 AI-ML Group Lab.md
Last active June 13, 2025 21:43
WWDC25 Machine Learning and AI Frameworks group lab

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

Panelists:

  • Host: Shashank

  • Panelists: Michael, Erik, Richard, Ronan


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
and definitely have the expertise to answer any questions that you have for us. So, to kick things off, in some of the design sessions, and keynote, and so, too, we were talking a little bit about the way in which liquid glass can really help with navigation, focus, in the UI, and there's some questions, just kind of, you know, can we expand on that? Can we elaborate a little bit on that notion? And I think maybe, Chabam, that might be a good one for you to take. Yeah, yeah, absolutely. So with liquid glass, you know, we really tried to clarify the navigation layer in our apps. So liquid glass introduces a single floating plane that acts as an navigation layer for your app. buttons in that floating pane sort of seamlessly morph in mitosis as you move between different sections of the app, and when you look at things like controls, controls can also temporarily lift into that glass steam. If you watch some of the design sessions, you know, we go into not overusing glass or not using glass on top of glass, but

(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):

@Koshimizu-Takehito
Koshimizu-Takehito / MazeGenerator.swift
Last active June 12, 2025 09:01
迷路生成ロジック
import Combine
import Foundation
// MARK: - MazeGenerator (Model)
/// An actor that generates a maze using a depth-first search (DFS) based approach.
/// 深さ優先探索 (DFS) ベースのアルゴリズムを用いて迷路を生成する。
///
/// This actor provides an async stream of snapshots (`MazeGenerator.Snapshot`) so that observers
/// can track the maze's state and generation progress in real time.
import SwiftUI
// Remember to download FontSettings.swift
struct WWDC24AnimatedTextView: View {
var text = "Hello, World!"
var animation: Animation = .easeInOut
var targetFontSize: CGFloat = 40
var minimumFontSize: CGFloat = 30
var targetFontWeight: Font.Weight = .semibold
@NoahKamara
NoahKamara / CompoundPredicate.swift
Last active October 29, 2024 21:19
Combining New Swift Predicates
import Foundation
@available(macOS 14, iOS 17, tvOS 17, watchOS 10, *)
/// Allows you to use an existing Predicate as a ``StandardPredicateExpression``
struct VariableWrappingExpression<T>: StandardPredicateExpression {
let predicate: Predicate<T>
let variable: PredicateExpressions.Variable<T>
func evaluate(_ bindings: PredicateBindings) throws -> Bool {
// resolve the variable
@unixzii
unixzii / WeatherView.swift
Created November 7, 2023 13:21
A demo of implementing iOS Weather card in SwiftUI.
import SwiftUI
struct HeaderView: View {
var body: some View {
HStack {
Image(systemName: "info.circle.fill")
.resizable()
.frame(width: 12, height: 12)
Text("Section Header")
.font(.system(size: 13))
@megabitsenmzq
megabitsenmzq / UIAlertControllerWrapper.swift
Last active August 25, 2023 10:04
Show UIKit alert in SwiftUI.
// SwiftUI alert has so many problems. Use UIKit instead.
import UIKit
struct UIAlertControllerWrapper {
static func present(alert: UIAlertController) {
if let scene = UIApplication.shared.connectedScenes.first as? UIWindowScene, let root = scene.windows.first?.rootViewController {
var nextViewController = root
while nextViewController.presentedViewController != nil {
nextViewController = nextViewController.presentedViewController!
@SmartJSONEditor
SmartJSONEditor / gist:33d796e81554205fd491b6449376c426
Last active March 31, 2024 05:38
Observation withObservationTracking as Combine publisher
import Combine
import Foundation
import Observation
// A: Using specific class
/// Class that wraps withObservationTracking function into a Combine compatible continuos stream publisher
public class ObservationTracker<O: Observable & AnyObject, T> {
/// Subscribe to a publisher.
public var valuePublisher: AnyPublisher<T, Never> {