Skip to content

Instantly share code, notes, and snippets.

View AbodiDawoud's full-sized avatar
:octocat:

Abodi AbodiDawoud

:octocat:
View GitHub Profile
@brentsimmons
brentsimmons / NSMenuItem+RSCore.swift
Created January 6, 2026 04:11
Disable all menu item images in a Mac app.
//
// NSMenuItem+RSCore.swift
// RSCore
//
// Created by Brent Simmons on 1/5/26.
//
#if os(macOS)
import AppKit
import ObjectiveC
import SwiftUI
import CompactSlider
@main
struct IntelligenceDemoApp: App {
@NSApplicationDelegateAdaptor var appDelegate: AppDelegate
var body: some Scene {
_EmptyScene()
@katagaki
katagaki / LiquidGlass.sh
Created September 3, 2025 01:21
Force Liquid Glass on/off for all apps on macOS 26+
echo Output defaults domains
defaults domains > domains.txt
echo Replace \', \' with new lines
sed -i "" 's/, /\n/g' domains.txt
echo Reset Liquid Glass defaults for apps
while read d; do
defaults delete "$d" com.apple.SwiftUI.IgnoreSolariumLinkedOnCheck
done <domains.txt
@JadenGeller
JadenGeller / ZoomNavigator.swift
Last active September 17, 2025 05:12
Keep view state and identity while animating into it from a list
/// A view that displays a collection of items in a scrollable list that can "zoom" to focus on a single selected item.
///
/// `ZoomNavigator` provides a navigation pattern similar to the iOS lock screen wallpaper picker,
/// where items can be viewed together in a scrollable list or individually in full screen.
/// The same view instance is maintained during transitions, preserving state and identity.
///
/// When no item is selected (`selection` is `nil`), all items are displayed in a scrollable list.
/// When an item is selected, the view filters to show only that item, expanded to fill the available space.
struct ZoomNavigator<Data: RandomAccessCollection, ID: Hashable, Content: View, Background: View, Modifier: ViewModifier>: View {
var data: Data
@georgecartridge
georgecartridge / StaggerTextEffect.swift
Created June 27, 2025 10:54
This is a staggered text animation based on the Arc onboarding intro - using the AnimateText swift package (https://github.com/jasudev/AnimateText)
public struct StaggerTextEffect: ATTextAnimateEffect {
public var data: ATElementData
public var userInfo: Any?
public init(_ data: ATElementData, _ userInfo: Any?) {
self.data = data
self.userInfo = userInfo
}
public func body(content: Content) -> some View {
@Aayush9029
Aayush9029 / NSWindow+Glass.swift
Created June 3, 2025 20:55
NSWindow AppKit that is pretty
let windowStyles: NSWindow.StyleMask = [.titled, .utilityWindow, .hudWindow]
let windowRect = NSRect.init(x: 0, y: 0, width: 600, height: 400)
let window = NSPanel.init(contentRect: windowRect, styleMask: windowStyles, backing: .buffered, defer: true)
window.title = "Title"
window.titleVisibility = .hidden
window.titlebarAppearsTransparent = true
let view = NSView()
window.contentView = view
window.contentView?.wantsLayer = true
window.contentView?.layer?.cornerRadius = 0.0
@Chronos2500
Chronos2500 / AllowsSwipeBack.Swift
Created May 16, 2025 17:59
This should be declared only once in the root view of the NavigationStack.
import SwiftUI
extension View {
/// Allows swipe back when navigation bar is hidden.
/// This modifier should be applied to a view that resides within a NavigationStack.
/// - Returns: A view that allows swipe back when navigation bar is hidden.
public func allowsSwipeBackWhenNavBarHidden() -> some View {
modifier( AllowsSwipeBackWhenNavBarHiddenModifier() )
}
}
@Chronos2500
Chronos2500 / MarqueeLabel-Minimal.swift
Created May 13, 2025 15:19
MarqueeLabel Please be fully aware that these use Private APIs.
let label = UILabel()
label.text = "Swift is a modern, intuitive programming language crafted for all Apple platforms."
label.setValue(true, forKey: "marqueeEnabled")
label.setValue(true, forKey: "marqueeRunning")
label.setValue(0, forKey: "marqueeRepeatCount")
@ObuchiYuki
ObuchiYuki / VariableBlurView.swift
Last active September 17, 2025 01:14
SwiftUI Progressive / Variable Blur View (using private api)
//
// VariableBlurView.swift
// MFileViewer
//
// Created by yuki on 2025/04/21.
//
import SwiftUI
import UIKit
import CoreImage
@Chronos2500
Chronos2500 / Example.Swift
Last active June 22, 2025 18:54
UIBlurEffectStyle一覧
// Example
// Custom extension to add a blur effect style with raw value 1100
extension UIBlurEffect.Style {
static var systemChromeBackground: UIBlurEffect.Style {
return UIBlurEffect.Style(rawValue: 1100) ?? .dark
}
}