Skip to content

Instantly share code, notes, and snippets.

@sketchytech
sketchytech / gist:5ed3c8241ce1509c5342
Last active May 23, 2020 02:00
Swift: How to draw a clock face using CoreGraphics and CoreText (Part 2: Animating with CABasicAnimation)
// see this blogpost: http://sketchytech.blogspot.co.uk/2014/11/swift-how-to-draw-clock-face-using_12.html
import UIKit
class ViewController: UIViewController {
func rotateLayer(currentLayer:CALayer,dur:CFTimeInterval){
var angle = degree2radian(360)
@sketchytech
sketchytech / gist:d0a8909459aea899e67c
Last active March 30, 2021 13:47
Swift: Draw a clock face (part 1)
// accompanies this blogpost http://sketchytech.blogspot.co.uk/2014/11/swift-how-to-draw-clock-face-using.html
import UIKit
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.