Skip to content

Instantly share code, notes, and snippets.

@sketchytech
sketchytech / AnimationPlayground.swift
Created January 14, 2017 12:12 — forked from crenwick/AnimationPlayground.swift
Swift 3: Draw a path with a semicircle, animation movement across it.
// Follow the horizon
import UIKit
import PlaygroundSupport
import SpriteKit
let containerView = UIView(frame: CGRect(x: 0.0, y: 0.0, width: 375.0, height: 300.0))
let view = SKView(frame: CGRect(x:0, y:0, width:375, height:120))
PlaygroundPage.current.liveView = view
@sketchytech
sketchytech / Common Swift String Extensions
Last active February 3, 2021 19:03 — forked from albertbori/Common Swift String Extensions
Added and amended to use pure Swift where possible
import Foundation
extension String
{
// Works in Xcode but not Playgrounds because of a bug with .insert()
mutating func insertString(string:String,ind:Int) {
var insertIndex = advance(self.startIndex, ind, self.endIndex)
for c in string {