Skip to content

Instantly share code, notes, and snippets.

View ulian-onua's full-sized avatar
🏠
Working from home

Julian Drapaylo ulian-onua

🏠
Working from home
View GitHub Profile
struct DocumentPicker: UIViewControllerRepresentable {
// MARK: - Environment
@Environment(\.dismiss) var dismiss
let completion: (_ result: PickerResult) -> Void
func makeUIViewController(context: UIViewControllerRepresentableContext<DocumentPicker>) -> UIDocumentPickerViewController {
let picker = UIDocumentPickerViewController(forOpeningContentTypes: [.image])

Keybase proof

I hereby claim:

  • I am ulian-onua on github.
  • I am ulian_onua (https://keybase.io/ulian_onua) on keybase.
  • I have a public key ASByDC_jl53AFwmz5bn2hP_UyLxwW_A9NfGgY15ShOupggo

To claim this, I am signing this object:

@ulian-onua
ulian-onua / ModalView.swift
Created February 12, 2021 19:51 — forked from colejd/ModalView.swift
NSView that closes itself when clicking outside
// MIT License - © 2017 Jonathan Cole.
import Cocoa
/**
A view with the ability to hide itself if the user clicks outside of it.
*/
class ModalView: NSView {
private var monitor: Any?
@ulian-onua
ulian-onua / UIColor native initializer tests.swift
Last active March 3, 2019 19:12
UIColor_native_initializer_tests.swift
import XCTest
class UIColorNativeTests: XCTestCase {
var computedNativeColor: UIColor {
return UIColor(red: 224.0 / 255.0,
green: 17.0 / 255.0,
blue: 95.0 / 255.0,
alpha: 1.0)
}