Skip to content

Instantly share code, notes, and snippets.

View HarryGoodwin's full-sized avatar

Harry Goodwin HarryGoodwin

View GitHub Profile
@HarryGoodwin
HarryGoodwin / SpiralViewController.swift
Last active May 17, 2022 10:31
Draws an animated spiral
import UIKit
class SpiralViewController : UIViewController {
var spiralView: SpiralView!
override func loadView() {
let view = SpiralView()
spiralView = view
view.backgroundColor = .white
self.view = view
@HarryGoodwin
HarryGoodwin / gist:f697e68c20f2afe18d37d5999b8c4fc4
Created November 10, 2019 10:28
Simple bullet point UILabel rendering for iOS
import UIKit
import PlaygroundSupport
struct StringConstants {
static let bullet = "This is a long string, which should make the label wrap to multiple lines, showing us that the bullet point has rendered correctly with a sufficient indent on subsequent lines of text."
}
class MyViewController : UIViewController {
private let label = UILabel()
@HarryGoodwin
HarryGoodwin / gist:4528d6419915258e54b2f8c804687808
Last active August 10, 2023 02:28
Attributed string bullet points - Swift
import UIKit
import PlaygroundSupport
struct StringConstants {
static let bullet1 = "This is a small string."
static let bullet2 = "This is more of medium string with a few more words etc."
static let bullet3 = "Well this is certainly a longer string, with many more words than either of the previuos two strings."
}
typealias ParagraphData = (bullet: String, paragraph: String)