Skip to content

Instantly share code, notes, and snippets.

View hartbeatnt's full-sized avatar

Nate Hart hartbeatnt

View GitHub Profile
@hartbeatnt
hartbeatnt / Loading elipsis animation.swift
Last active June 12, 2021 00:19 — forked from nunogoncalves/Loading elipsis animation.swift
Setting an ellipsis changing from 1 to 3 dots
let animationDelay = 0.5 // tweak this to speed up / slow down animation
var hiddenDots = 3
func animateDots() {
if let str = label.text {
let range = NSRange(location: str.count - hiddenDots, length: hiddenDots)
let string = NSMutableAttributedString(string: str)
string.addAttribute(.foregroundColor, value: UIColor.clear, range: range)