Skip to content

Instantly share code, notes, and snippets.

@TarasShu
Created July 5, 2020 13:51
Show Gist options
  • Save TarasShu/6553278164488e09610a54cf55a69a25 to your computer and use it in GitHub Desktop.
Save TarasShu/6553278164488e09610a54cf55a69a25 to your computer and use it in GitHub Desktop.
func bullet1( count: Int) -> [CALayer]{
let bul = [CALayer]()
// let distance = 10
for i in 0...count {
let layer = CALayer()
layer.backgroundColor = CGColor(srgbRed: 0.8, green: 0.2, blue: 0.8, alpha: 1.0)
layer.frame = CGRect(x: 250 ,
y: 150 + (i * count),
width: 5 ,
height: 10)
mainLayer.addSublayer(layer)
}
return bul
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment