Skip to content

Instantly share code, notes, and snippets.

View fpg1503's full-sized avatar
🐥

Francesco fpg1503

🐥
View GitHub Profile
@fpg1503
fpg1503 / DragView.swift
Last active January 31, 2020 20:10
Drag and Drop View on macOS
protocol DragViewDelegate {
var acceptedFileExtensions: [String] { get }
func dragView(dragView: DragView, didDragFileWith URL: NSURL)
}
class DragView: NSView {
required init?(coder: NSCoder) {
super.init(coder: coder)
registerForDraggedTypes([NSFilenamesPboardType, NSURLPboardType])
@fpg1503
fpg1503 / ImageFromUrl.swift
Created January 19, 2015 15:21
UIImageView setImageFromURL - Swift
//
// ImageFromUrl.swift
//
// Created by Francesco Perrotti-Garcia on 1/19/15.
// Copyright (c) 2015 Francesco Perrotti-Garcia. All rights reserved.
//
import Foundation
import UIKit
import ObjectiveC