Skip to content

Instantly share code, notes, and snippets.

View PointerFLY's full-sized avatar
🎯
Focusing

Michael Ma PointerFLY

🎯
Focusing
View GitHub Profile
@PointerFLY
PointerFLY / gist:c650ceed2e21c12c7e5d81b657c6bc56
Created December 8, 2016 09:16
// swift playground dog animation
// swift playground dog animation
import UIKit
import PlaygroundSupport
extension UIBezierPath {
class func pathFromBitmap() -> UIBezierPath? {
let map: [[UInt8]] = [
[0,0,0,0,0,0,1,1,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
[0,0,0,0,0,1,0,0,1,0,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
[0,0,0,0,0,1,0,0,1,1,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],