Skip to content

Instantly share code, notes, and snippets.

I may be slow to respond.

颜风 ios122

I may be slow to respond.
View GitHub Profile
mayoff / Arrow.swift
Last active Sep 28, 2020
UIBezierPath category to create an arrow (now with a Swift version!)
View Arrow.swift
// Swift 2.2 syntax / API
import UIKit
extension UIBezierPath {
class func arrow(from start: CGPoint, to end: CGPoint, tailWidth: CGFloat, headWidth: CGFloat, headLength: CGFloat) -> Self {
let length = hypot(end.x - start.x, end.y - start.y)
let tailLength = length - headLength
You can’t perform that action at this time.