Skip to content

Instantly share code, notes, and snippets.

View Ciyou's full-sized avatar
💭
👨🏻‍💻☕️☕️

Ciyou Lee Ciyou

💭
👨🏻‍💻☕️☕️
View GitHub Profile
@mishimay
mishimay / MyScrollView.swift
Created July 15, 2019 05:50
Bridge UIScrollView to SwiftUI
struct MyScrollView: UIViewRepresentable {
let swiftUIView: AnyView
func makeUIView(context: UIViewRepresentableContext<ContentView.MyScrollView>) -> UIView {
let hosting = UIHostingController(rootView: swiftUIView)
let width = UIScreen.main.bounds.width
let size = hosting.view.sizeThatFits(CGSize(width: width, height: CGFloat.greatestFiniteMagnitude))
hosting.view.frame = CGRect(x: 0, y: 0, width: width, height: size.height)
let view = UIScrollView()
view.alwaysBounceVertical = true
@warrenm
warrenm / ARQLThumbnailGenerator.swift
Created June 12, 2018 06:31
Generating thumbnail images of 3D model files for use with AR QuickLook
import Foundation
import SceneKit
class ARQLThumbnailGenerator {
private let device = MTLCreateSystemDefaultDevice()!
/// Create a thumbnail image of the asset with the specified URL at the specified
/// animation time. Supports loading of .scn, .usd, .usdz, .obj, and .abc files,
/// and other formats supported by ModelIO.
@ayamflow
ayamflow / gist:b602ab436ac9f05660d9c15190f4fd7b
Created May 9, 2016 19:10
Safari border-radius + overflow: hidden + CSS transform fix
// Add on element with overflow
-webkit-mask-image: -webkit-radial-gradient(white, black);