Skip to content

Instantly share code, notes, and snippets.

View VladislavSmolyanoy's full-sized avatar
🥷
Pushing the boundaries!

Vladislav Smolyanoy VladislavSmolyanoy

🥷
Pushing the boundaries!
View GitHub Profile
@goodones-mac
goodones-mac / VideoPlayerAlphaView.swift
Last active February 14, 2024 08:48
This lets you play a HEVC-with-alpha file on repeat and put it in as a SwiftUI view as a much smaller alternative to GIF files. This code is released into the public domain with no warranties, use as you like. Due to it being a SKView, not a UIView you can hypothetically use this within MacOS & iOS without many changes.
import AVFoundation
import SpriteKit
import SwiftUI
@MainActor
class TransparentBackgroundVideoPlayerUIView: SKView {
let backgroundNode: SKSpriteNode
let videoPlayer: AVPlayer
let videoNode: SKVideoNode
let url: URL
@zats
zats / ContentView.swift
Last active April 11, 2025 00:47
Internal SF Symbols
struct ContentView: View {
var body: some View {
let names = [
["appstore.app.dashed", "buildings.3d", "emoji.chicken.face"],
["person.text.rectangle.and.nfc", "secure.element", "laugh.bubble.tapback.2.he"],
["apple.news", "apple.podcasts.square.stack", "apple.slice"],
]
VStack(spacing: 20) {
Grid(horizontalSpacing: 20, verticalSpacing: 20) {
ForEach(names, id: \.self) { nameRow in
@jav-solo
jav-solo / sliding-icons-demo.swift
Last active January 27, 2025 06:37
Drag to re-order icons Playgrounds demo
import SwiftUI
import PlaygroundSupport
struct InspectorSidebarToolbarTop: View {
@State var targeted: Bool = true
@State private var icons = [
InspectorDockIcon(imageName: "doc", title: "File Inspector", id: 0),
InspectorDockIcon(imageName: "clock", title: "History Inspector", id: 1),
InspectorDockIcon(imageName: "questionmark.circle", title: "Quick Help Inspector", id: 2)
@HereOrCode
HereOrCode / notification.swift
Created November 8, 2021 02:18
Deliver an OSX notification with Swift
// Remember: import UserNotifications
func sendNotification(title: String, body: String = "") {
let content = UNMutableNotificationContent()
content.title = title
if body.count > 0 {
content.body = body
}