Skip to content

Instantly share code, notes, and snippets.

@ElegyD
ElegyD / LocationVCard.swift
Last active March 18, 2019 20:06 — forked from naturaln0va/LocationVCard.swift
Create a location vCard for use in UIActivityViewController like in Apple's Maps app.
import CoreLocation
static func vCardURL(from coordinate: CLLocationCoordinate2D, with name: String?) -> URL {
let vCardFileURL = URL(fileURLWithPath: NSTemporaryDirectory()).appendingPathComponent("vCard.loc.vcf")
let vCardString = [
"BEGIN:VCARD",
"VERSION:4.0",
"FN:\(name ?? "Shared Location")",
"item1.URL;type=pref:http://maps.apple.com/?ll=\(coordinate.latitude),\(coordinate.longitude)",
@ElegyD
ElegyD / SeparatorView.swift
Last active September 12, 2019 23:15 — forked from JULI-ya/SeparatorView.swift
SeparatorView in Swift 4 with drag indicator
import UIKit
enum SeparatorType {
case horizontal
case vertical
}
let kTotalSize: CGFloat = 18 // the total height of the separator (including parts that are not visible)
let kVisibleSize: CGFloat = 8 // the height of the visible portion of the separator
let kMargin: CGFloat = (kTotalSize - kVisibleSize) / 2 // the height of the non-visible portions of the separator (i.e. above and below the visible portion)