Skip to content

Instantly share code, notes, and snippets.

View BBC6BAE9's full-sized avatar
🌍

BBC6BAE9 BBC6BAE9

🌍
  • Beijing, China
  • 22:25 (UTC +08:00)
View GitHub Profile
@BBC6BAE9
BBC6BAE9 / VirtualKeyboard.swift
Created February 26, 2025 13:30 — forked from ethanhuang13/VirtualKeyboard.swift
MacBook Air M1 Zhuyin Keyboard written with SwiftUI ~=300 LOC, < 4hrs
//
// VirtualKeyboard.swift
// MacBook Air M1 Zhuyin Keyboard
// Written with SwiftUI ~=300 LOC, < 4hrs
// Created by Ethan Huang on 2021/1/13.
// Twitter: @ethanhuang13
import SwiftUI
struct VirtualKeyboard: View {
@BBC6BAE9
BBC6BAE9 / SwiftUIKeyboardAnimation.swift
Created August 12, 2024 06:24 — forked from timothycosta/SwiftUIKeyboardAnimation.swift
Create a SwiftUI Animation with the correct curve and duration from UIKit keyboard notifications
func animation(from notification: Notification) -> Animation? {
guard
let info = notification.userInfo,
let duration = info[UIResponder.keyboardAnimationDurationUserInfoKey] as? Double,
let curveValue = info[UIResponder.keyboardAnimationCurveUserInfoKey] as? Int,
let uiKitCurve = UIView.AnimationCurve(rawValue: curveValue)
else {
return nil
}
@BBC6BAE9
BBC6BAE9 / OpenGLToCVPixelBuffer.m
Created February 14, 2024 02:36 — forked from caojianhua/OpenGLToCVPixelBuffer.m
Create CVPixelBufferRef from OpenGL
@interface SREAGLContext : NSObject
+ (EAGLContext*)sharedContext;
+ (EAGLContext*)newContext: (EAGLRenderingAPI) api;
@end
@implementation SREAGLContext