UIBezierPath 繪製國旗

因為我一上傳Githubt, xcode就當機,所以程式就附在內文。本來決定選一個簡單的國旗來練習UIBezierPath(), CAShapeLayer(), layer.addSublayer(),但後來寫著寫著土法煉鋼法的把程式寫的超長…下一個版本會再用for 迴圈改善程式,應該可以修剪的短很多,問題主要有3個:

  1. 50個星星我畫了50次…
  2. 7條紅色的線我畫了7次…
  3. UIBezierPath() 我使用了var變數,這很好,但CAShapeLayer()我使用了let常數,使得我50個星星設定了50個常數,不應該這樣設定…

let
view = UIView()
//white framevar path = UIBezierPath()path.move(to: CGPoint(x: 0, y: 0))path.addLine(to: CGPoint(x: 2878/10, y: 0))path.addLine(to: CGPoint(x: 2878/10, y: 1514/10))path.addLine(to: CGPoint(x: 0, y: 1514/10))path.close()let framelayer = CAShapeLayer()framelayer.path = path.cgPathframelayer.fillColor = CGColor(srgbRed: 1, green: 1, blue: 1, alpha: 1)view.layer.addSublayer(framelayer)// bluelayerpath = UIBezierPath()path.move(to: CGPoint(x: 0, y: 0))path.addLine(to: CGPoint(x: 1154/10, y: 0))path.addLine(to: CGPoint(x: 1154/10, y: 820/10))path.addLine(to: CGPoint(x: 0, y: 820/10))path.close()let bluelayer = CAShapeLayer()bluelayer.path = path.cgPathbluelayer.fillColor = CGColor(srgbRed: 60/255, green: 59/255, blue: 110/255, alpha: 1)view.layer.addSublayer(bluelayer)// first rowpath = UIBezierPath()path.move(to: CGPoint(x: 96/10, y: 37/10))path.addLine(to: CGPoint(x: 96/10, y:37/10))path.addLine(to: CGPoint(x: 106/10, y: 67/10))path.addLine(to: CGPoint(x: 139/10, y: 67/10))path.addLine(to: CGPoint(x: 112/10, y: 87/10))path.addLine(to: CGPoint(x: 123/10, y: 118/10))path.addLine(to: CGPoint(x: 96/10, y: 100/10))path.addLine(to: CGPoint(x: 69/10, y: 118/10))path.addLine(to: CGPoint(x: 79/10, y: 87/10))path.addLine(to: CGPoint(x: 52/10, y: 67/10))path.addLine(to: CGPoint(x: 85/10, y: 66/10))path.close()let starlayer1 = CAShapeLayer()starlayer1.path = path.cgPathstarlayer1.fillColor = CGColor(srgbRed: 255, green: 255, blue: 255, alpha: 1)view.layer.addSublayer(starlayer1)var index = 192path = UIBezierPath()path.move(to: CGPoint(x: (96+index)/10, y: 37/10))path.addLine(to: CGPoint(x: (96+index)/10, y:37/10))path.addLine(to: CGPoint(x: (106+index)/10, y: 67/10))path.addLine(to: CGPoint(x: (139+index)/10, y: 67/10))path.addLine(to: CGPoint(x: (112+index)/10, y: 87/10))path.addLine(to: CGPoint(x: (123+index)/10, y: 118/10))path.addLine(to: CGPoint(x: (96+index)/10, y: 100/10))path.addLine(to: CGPoint(x: (69+index)/10, y: 118/10))path.addLine(to: CGPoint(x: (79+index)/10, y: 87/10))path.addLine(to: CGPoint(x: (52+index)/10, y: 67/10))path.addLine(to: CGPoint(x: (85+index)/10, y: 66/10))path.close()let starlayer2 = CAShapeLayer()starlayer2.path = path.cgPathstarlayer2.fillColor = CGColor(srgbRed: 255, green: 255, blue: 255, alpha: 1)view.layer.addSublayer(starlayer2)index = 192*2path = UIBezierPath()path.move(to: CGPoint(x: (96+index)/10, y: 37/10))path.addLine(to: CGPoint(x: (96+index)/10, y:37/10))path.addLine(to: CGPoint(x: (106+index)/10, y: 67/10))path.addLine(to: CGPoint(x: (139+index)/10, y: 67/10))path.addLine(to: CGPoint(x: (112+index)/10, y: 87/10))path.addLine(to: CGPoint(x: (123+index)/10, y: 118/10))path.addLine(to: CGPoint(x: (96+index)/10, y: 100/10))path.addLine(to: CGPoint(x: (69+index)/10, y: 118/10))path.addLine(to: CGPoint(x: (79+index)/10, y: 87/10))path.addLine(to: CGPoint(x: (52+index)/10, y: 67/10))path.addLine(to: CGPoint(x: (85+index)/10, y: 66/10))path.close()let starlayer3 = CAShapeLayer()starlayer3.path = path.cgPathstarlayer3.fillColor = CGColor(srgbRed: 255, green: 255, blue: 255, alpha: 1)view.layer.addSublayer(starlayer3)index = 192*3path = UIBezierPath()path.move(to: CGPoint(x: (96+index)/10, y: 37/10))path.addLine(to: CGPoint(x: (96+index)/10, y:37/10))path.addLine(to: CGPoint(x: (106+index)/10, y: 67/10))path.addLine(to: CGPoint(x: (139+index)/10, y: 67/10))path.addLine(to: CGPoint(x: (112+index)/10, y: 87/10))path.addLine(to: CGPoint(x: (123+index)/10, y: 118/10))path.addLine(to: CGPoint(x: (96+index)/10, y: 100/10))path.addLine(to: CGPoint(x: (69+index)/10, y: 118/10))path.addLine(to: CGPoint(x: (79+index)/10, y: 87/10))path.addLine(to: CGPoint(x: (52+index)/10, y: 67/10))path.addLine(to: CGPoint(x: (85+index)/10, y: 66/10))path.close()let starlayer4 = CAShapeLayer()starlayer4.path = path.cgPathstarlayer4.fillColor = CGColor(srgbRed: 255, green: 255, blue: 255, alpha: 1)view.layer.addSublayer(starlayer4)index = 192*4path = UIBezierPath()path.move(to: CGPoint(x: (96+index)/10, y: 37/10))path.addLine(to: CGPoint(x: (96+index)/10, y:37/10))path.addLine(to: CGPoint(x: (106+index)/10, y: 67/10))path.addLine(to: CGPoint(x: (139+index)/10, y: 67/10))path.addLine(to: CGPoint(x: (112+index)/10, y: 87/10))path.addLine(to: CGPoint(x: (123+index)/10, y: 118/10))path.addLine(to: CGPoint(x: (96+index)/10, y: 100/10))path.addLine(to: CGPoint(x: (69+index)/10, y: 118/10))path.addLine(to: CGPoint(x: (79+index)/10, y: 87/10))path.addLine(to: CGPoint(x: (52+index)/10, y: 67/10))path.addLine(to: CGPoint(x: (85+index)/10, y: 66/10))path.close()let starlayer5 = CAShapeLayer()starlayer5.path = path.cgPathstarlayer5.fillColor = CGColor(srgbRed: 255, green: 255, blue: 255, alpha: 1)view.layer.addSublayer(starlayer5)index = 192*5path = UIBezierPath()path.move(to: CGPoint(x: (96+index)/10, y: 37/10))path.addLine(to: CGPoint(x: (96+index)/10, y:37/10))path.addLine(to: CGPoint(x: (106+index)/10, y: 67/10))path.addLine(to: CGPoint(x: (139+index)/10, y: 67/10))path.addLine(to: CGPoint(x: (112+index)/10, y: 87/10))path.addLine(to: CGPoint(x: (123+index)/10, y: 118/10))path.addLine(to: CGPoint(x: (96+index)/10, y: 100/10))path.addLine(to: CGPoint(x: (69+index)/10, y: 118/10))path.addLine(to: CGPoint(x: (79+index)/10, y: 87/10))path.addLine(to: CGPoint(x: (52+index)/10, y: 67/10))path.addLine(to: CGPoint(x: (85+index)/10, y: 66/10))path.close()let starlayer6 = CAShapeLayer()starlayer6.path = path.cgPathstarlayer6.fillColor = CGColor(srgbRed: 255, green: 255, blue: 255, alpha: 1)view.layer.addSublayer(starlayer6)//second rowvar index2 = 163path = UIBezierPath()path.move(to: CGPoint(x: 96/10, y: (37+index2)/10))path.addLine(to: CGPoint(x: 96/10, y:(37+index2)/10))path.addLine(to: CGPoint(x: 106/10, y: (67+index2)/10))path.addLine(to: CGPoint(x: 139/10, y: (67+index2)/10))path.addLine(to: CGPoint(x: 112/10, y: (87+index2)/10))path.addLine(to: CGPoint(x: 123/10, y: (118+index2)/10))path.addLine(to: CGPoint(x: 96/10, y: (100+index2)/10))path.addLine(to: CGPoint(x: 69/10, y: (118+index2)/10))path.addLine(to: CGPoint(x: 79/10, y: (87+index2)/10))path.addLine(to: CGPoint(x: 52/10, y: (67+index2)/10))path.addLine(to: CGPoint(x: 85/10, y: (66+index2)/10))path.close()let starlayer7 = CAShapeLayer()starlayer7.path = path.cgPathstarlayer7.fillColor = CGColor(srgbRed: 255, green: 255, blue: 255, alpha: 1)view.layer.addSublayer(starlayer7)index = 192path.move(to: CGPoint(x: (96+index)/10, y: (37+index2)/10))path.addLine(to: CGPoint(x: (96+index)/10, y:(37+index2)/10))path.addLine(to: CGPoint(x: (106+index)/10, y: (67+index2)/10))path.addLine(to: CGPoint(x: (139+index)/10, y: (67+index2)/10))path.addLine(to: CGPoint(x: (112+index)/10, y: (87+index2)/10))path.addLine(to: CGPoint(x: (123+index)/10, y: (118+index2)/10))path.addLine(to: CGPoint(x: (96+index)/10, y: (100+index2)/10))path.addLine(to: CGPoint(x: (69+index)/10, y: (118+index2)/10))path.addLine(to: CGPoint(x: (79+index)/10, y: (87+index2)/10))path.addLine(to: CGPoint(x: (52+index)/10, y: (67+index2)/10))path.addLine(to: CGPoint(x: (85+index)/10, y: (66+index2)/10))path.close()let starlayer8 = CAShapeLayer()starlayer8.path = path.cgPathstarlayer8.fillColor = CGColor(srgbRed: 255, green: 255, blue: 255, alpha: 1)view.layer.addSublayer(starlayer8)index = 192*2path.move(to: CGPoint(x: (96+index)/10, y: (37+index2)/10))path.addLine(to: CGPoint(x: (96+index)/10, y:(37+index2)/10))path.addLine(to: CGPoint(x: (106+index)/10, y: (67+index2)/10))path.addLine(to: CGPoint(x: (139+index)/10, y: (67+index2)/10))path.addLine(to: CGPoint(x: (112+index)/10, y: (87+index2)/10))path.addLine(to: CGPoint(x: (123+index)/10, y: (118+index2)/10))path.addLine(to: CGPoint(x: (96+index)/10, y: (100+index2)/10))path.addLine(to: CGPoint(x: (69+index)/10, y: (118+index2)/10))path.addLine(to: CGPoint(x: (79+index)/10, y: (87+index2)/10))path.addLine(to: CGPoint(x: (52+index)/10, y: (67+index2)/10))path.addLine(to: CGPoint(x: (85+index)/10, y: (66+index2)/10))path.close()let starlayer9 = CAShapeLayer()starlayer9.path = path.cgPathstarlayer9.fillColor = CGColor(srgbRed: 255, green: 255, blue: 255, alpha: 1)view.layer.addSublayer(starlayer9)index = 192*3path.move(to: CGPoint(x: (96+index)/10, y: (37+index2)/10))path.addLine(to: CGPoint(x: (96+index)/10, y:(37+index2)/10))path.addLine(to: CGPoint(x: (106+index)/10, y: (67+index2)/10))path.addLine(to: CGPoint(x: (139+index)/10, y: (67+index2)/10))path.addLine(to: CGPoint(x: (112+index)/10, y: (87+index2)/10))path.addLine(to: CGPoint(x: (123+index)/10, y: (118+index2)/10))path.addLine(to: CGPoint(x: (96+index)/10, y: (100+index2)/10))path.addLine(to: CGPoint(x: (69+index)/10, y: (118+index2)/10))path.addLine(to: CGPoint(x: (79+index)/10, y: (87+index2)/10))path.addLine(to: CGPoint(x: (52+index)/10, y: (67+index2)/10))path.addLine(to: CGPoint(x: (85+index)/10, y: (66+index2)/10))path.close()let starlayer10 = CAShapeLayer()starlayer10.path = path.cgPathstarlayer10.fillColor = CGColor(srgbRed: 255, green: 255, blue: 255, alpha: 1)view.layer.addSublayer(starlayer10)index = 192*4path.move(to: CGPoint(x: (96+index)/10, y: (37+index2)/10))path.addLine(to: CGPoint(x: (96+index)/10, y:(37+index2)/10))path.addLine(to: CGPoint(x: (106+index)/10, y: (67+index2)/10))path.addLine(to: CGPoint(x: (139+index)/10, y: (67+index2)/10))path.addLine(to: CGPoint(x: (112+index)/10, y: (87+index2)/10))path.addLine(to: CGPoint(x: (123+index)/10, y: (118+index2)/10))path.addLine(to: CGPoint(x: (96+index)/10, y: (100+index2)/10))path.addLine(to: CGPoint(x: (69+index)/10, y: (118+index2)/10))path.addLine(to: CGPoint(x: (79+index)/10, y: (87+index2)/10))path.addLine(to: CGPoint(x: (52+index)/10, y: (67+index2)/10))path.addLine(to: CGPoint(x: (85+index)/10, y: (66+index2)/10))path.close()let starlayer11 = CAShapeLayer()starlayer11.path = path.cgPathstarlayer11.fillColor = CGColor(srgbRed: 255, green: 255, blue: 255, alpha: 1)view.layer.addSublayer(starlayer11)index = 192*5path.move(to: CGPoint(x: (96+index)/10, y: (37+index2)/10))path.addLine(to: CGPoint(x: (96+index)/10, y:(37+index2)/10))path.addLine(to: CGPoint(x: (106+index)/10, y: (67+index2)/10))path.addLine(to: CGPoint(x: (139+index)/10, y: (67+index2)/10))path.addLine(to: CGPoint(x: (112+index)/10, y: (87+index2)/10))path.addLine(to: CGPoint(x: (123+index)/10, y: (118+index2)/10))path.addLine(to: CGPoint(x: (96+index)/10, y: (100+index2)/10))path.addLine(to: CGPoint(x: (69+index)/10, y: (118+index2)/10))path.addLine(to: CGPoint(x: (79+index)/10, y: (87+index2)/10))path.addLine(to: CGPoint(x: (52+index)/10, y: (67+index2)/10))path.addLine(to: CGPoint(x: (85+index)/10, y: (66+index2)/10))path.close()let starlayer12 = CAShapeLayer()starlayer12.path = path.cgPathstarlayer12.fillColor = CGColor(srgbRed: 255, green: 255, blue: 255, alpha: 1)view.layer.addSublayer(starlayer12)// third rowindex2 = 163*2path = UIBezierPath()path.move(to: CGPoint(x: 96/10, y: (37+index2)/10))path.addLine(to: CGPoint(x: 96/10, y:(37+index2)/10))path.addLine(to: CGPoint(x: 106/10, y: (67+index2)/10))path.addLine(to: CGPoint(x: 139/10, y: (67+index2)/10))path.addLine(to: CGPoint(x: 112/10, y: (87+index2)/10))path.addLine(to: CGPoint(x: 123/10, y: (118+index2)/10))path.addLine(to: CGPoint(x: 96/10, y: (100+index2)/10))path.addLine(to: CGPoint(x: 69/10, y: (118+index2)/10))path.addLine(to: CGPoint(x: 79/10, y: (87+index2)/10))path.addLine(to: CGPoint(x: 52/10, y: (67+index2)/10))path.addLine(to: CGPoint(x: 85/10, y: (66+index2)/10))path.close()let starlayer13 = CAShapeLayer()starlayer13.path = path.cgPathstarlayer13.fillColor = CGColor(srgbRed: 255, green: 255, blue: 255, alpha: 1)view.layer.addSublayer(starlayer13)index = 192path.move(to: CGPoint(x: (96+index)/10, y: (37+index2)/10))path.addLine(to: CGPoint(x: (96+index)/10, y:(37+index2)/10))path.addLine(to: CGPoint(x: (106+index)/10, y: (67+index2)/10))path.addLine(to: CGPoint(x: (139+index)/10, y: (67+index2)/10))path.addLine(to: CGPoint(x: (112+index)/10, y: (87+index2)/10))path.addLine(to: CGPoint(x: (123+index)/10, y: (118+index2)/10))path.addLine(to: CGPoint(x: (96+index)/10, y: (100+index2)/10))path.addLine(to: CGPoint(x: (69+index)/10, y: (118+index2)/10))path.addLine(to: CGPoint(x: (79+index)/10, y: (87+index2)/10))path.addLine(to: CGPoint(x: (52+index)/10, y: (67+index2)/10))path.addLine(to: CGPoint(x: (85+index)/10, y: (66+index2)/10))path.close()let starlayer14 = CAShapeLayer()starlayer14.path = path.cgPathstarlayer14.fillColor = CGColor(srgbRed: 255, green: 255, blue: 255, alpha: 1)view.layer.addSublayer(starlayer14)index = 192*2path.move(to: CGPoint(x: (96+index)/10, y: (37+index2)/10))path.addLine(to: CGPoint(x: (96+index)/10, y:(37+index2)/10))path.addLine(to: CGPoint(x: (106+index)/10, y: (67+index2)/10))path.addLine(to: CGPoint(x: (139+index)/10, y: (67+index2)/10))path.addLine(to: CGPoint(x: (112+index)/10, y: (87+index2)/10))path.addLine(to: CGPoint(x: (123+index)/10, y: (118+index2)/10))path.addLine(to: CGPoint(x: (96+index)/10, y: (100+index2)/10))path.addLine(to: CGPoint(x: (69+index)/10, y: (118+index2)/10))path.addLine(to: CGPoint(x: (79+index)/10, y: (87+index2)/10))path.addLine(to: CGPoint(x: (52+index)/10, y: (67+index2)/10))path.addLine(to: CGPoint(x: (85+index)/10, y: (66+index2)/10))path.close()let starlayer15 = CAShapeLayer()starlayer15.path = path.cgPathstarlayer15.fillColor = CGColor(srgbRed: 255, green: 255, blue: 255, alpha: 1)view.layer.addSublayer(starlayer15)index = 192*3path.move(to: CGPoint(x: (96+index)/10, y: (37+index2)/10))path.addLine(to: CGPoint(x: (96+index)/10, y:(37+index2)/10))path.addLine(to: CGPoint(x: (106+index)/10, y: (67+index2)/10))path.addLine(to: CGPoint(x: (139+index)/10, y: (67+index2)/10))path.addLine(to: CGPoint(x: (112+index)/10, y: (87+index2)/10))path.addLine(to: CGPoint(x: (123+index)/10, y: (118+index2)/10))path.addLine(to: CGPoint(x: (96+index)/10, y: (100+index2)/10))path.addLine(to: CGPoint(x: (69+index)/10, y: (118+index2)/10))path.addLine(to: CGPoint(x: (79+index)/10, y: (87+index2)/10))path.addLine(to: CGPoint(x: (52+index)/10, y: (67+index2)/10))path.addLine(to: CGPoint(x: (85+index)/10, y: (66+index2)/10))path.close()let starlayer16 = CAShapeLayer()starlayer16.path = path.cgPathstarlayer16.fillColor = CGColor(srgbRed: 255, green: 255, blue: 255, alpha: 1)view.layer.addSublayer(starlayer16)index = 192*4path.move(to: CGPoint(x: (96+index)/10, y: (37+index2)/10))path.addLine(to: CGPoint(x: (96+index)/10, y:(37+index2)/10))path.addLine(to: CGPoint(x: (106+index)/10, y: (67+index2)/10))path.addLine(to: CGPoint(x: (139+index)/10, y: (67+index2)/10))path.addLine(to: CGPoint(x: (112+index)/10, y: (87+index2)/10))path.addLine(to: CGPoint(x: (123+index)/10, y: (118+index2)/10))path.addLine(to: CGPoint(x: (96+index)/10, y: (100+index2)/10))path.addLine(to: CGPoint(x: (69+index)/10, y: (118+index2)/10))path.addLine(to: CGPoint(x: (79+index)/10, y: (87+index2)/10))path.addLine(to: CGPoint(x: (52+index)/10, y: (67+index2)/10))path.addLine(to: CGPoint(x: (85+index)/10, y: (66+index2)/10))path.close()let starlayer17 = CAShapeLayer()starlayer17.path = path.cgPathstarlayer17.fillColor = CGColor(srgbRed: 255, green: 255, blue: 255, alpha: 1)view.layer.addSublayer(starlayer17)index = 192*5path.move(to: CGPoint(x: (96+index)/10, y: (37+index2)/10))path.addLine(to: CGPoint(x: (96+index)/10, y:(37+index2)/10))path.addLine(to: CGPoint(x: (106+index)/10, y: (67+index2)/10))path.addLine(to: CGPoint(x: (139+index)/10, y: (67+index2)/10))path.addLine(to: CGPoint(x: (112+index)/10, y: (87+index2)/10))path.addLine(to: CGPoint(x: (123+index)/10, y: (118+index2)/10))path.addLine(to: CGPoint(x: (96+index)/10, y: (100+index2)/10))path.addLine(to: CGPoint(x: (69+index)/10, y: (118+index2)/10))path.addLine(to: CGPoint(x: (79+index)/10, y: (87+index2)/10))path.addLine(to: CGPoint(x: (52+index)/10, y: (67+index2)/10))path.addLine(to: CGPoint(x: (85+index)/10, y: (66+index2)/10))path.close()let starlayer18 = CAShapeLayer()starlayer18.path = path.cgPathstarlayer18.fillColor = CGColor(srgbRed: 255, green: 255, blue: 255, alpha: 1)view.layer.addSublayer(starlayer18)// fourth rowindex2 = 163*3path = UIBezierPath()path.move(to: CGPoint(x: 96/10, y: (37+index2)/10))path.addLine(to: CGPoint(x: 96/10, y:(37+index2)/10))path.addLine(to: CGPoint(x: 106/10, y: (67+index2)/10))path.addLine(to: CGPoint(x: 139/10, y: (67+index2)/10))path.addLine(to: CGPoint(x: 112/10, y: (87+index2)/10))path.addLine(to: CGPoint(x: 123/10, y: (118+index2)/10))path.addLine(to: CGPoint(x: 96/10, y: (100+index2)/10))path.addLine(to: CGPoint(x: 69/10, y: (118+index2)/10))path.addLine(to: CGPoint(x: 79/10, y: (87+index2)/10))path.addLine(to: CGPoint(x: 52/10, y: (67+index2)/10))path.addLine(to: CGPoint(x: 85/10, y: (66+index2)/10))path.close()let starlayer19 = CAShapeLayer()starlayer19.path = path.cgPathstarlayer19.fillColor = CGColor(srgbRed: 255, green: 255, blue: 255, alpha: 1)view.layer.addSublayer(starlayer19)index = 192path = UIBezierPath()path.move(to: CGPoint(x: (96+index)/10, y: (37+index2)/10))path.addLine(to: CGPoint(x: (96+index)/10, y:(37+index2)/10))path.addLine(to: CGPoint(x: (106+index)/10, y: (67+index2)/10))path.addLine(to: CGPoint(x: (139+index)/10, y: (67+index2)/10))path.addLine(to: CGPoint(x: (112+index)/10, y: (87+index2)/10))path.addLine(to: CGPoint(x: (123+index)/10, y: (118+index2)/10))path.addLine(to: CGPoint(x: (96+index)/10, y: (100+index2)/10))path.addLine(to: CGPoint(x: (69+index)/10, y: (118+index2)/10))path.addLine(to: CGPoint(x: (79+index)/10, y: (87+index2)/10))path.addLine(to: CGPoint(x: (52+index)/10, y: (67+index2)/10))path.addLine(to: CGPoint(x: (85+index)/10, y: (66+index2)/10))path.close()let starlayer20 = CAShapeLayer()starlayer20.path = path.cgPathstarlayer20.fillColor = CGColor(srgbRed: 255, green: 255, blue: 255, alpha: 1)view.layer.addSublayer(starlayer20)index = 192*2path = UIBezierPath()path.move(to: CGPoint(x: (96+index)/10, y: (37+index2)/10))path.addLine(to: CGPoint(x: (96+index)/10, y:(37+index2)/10))path.addLine(to: CGPoint(x: (106+index)/10, y: (67+index2)/10))path.addLine(to: CGPoint(x: (139+index)/10, y: (67+index2)/10))path.addLine(to: CGPoint(x: (112+index)/10, y: (87+index2)/10))path.addLine(to: CGPoint(x: (123+index)/10, y: (118+index2)/10))path.addLine(to: CGPoint(x: (96+index)/10, y: (100+index2)/10))path.addLine(to: CGPoint(x: (69+index)/10, y: (118+index2)/10))path.addLine(to: CGPoint(x: (79+index)/10, y: (87+index2)/10))path.addLine(to: CGPoint(x: (52+index)/10, y: (67+index2)/10))path.addLine(to: CGPoint(x: (85+index)/10, y: (66+index2)/10))path.close()let starlayer21 = CAShapeLayer()starlayer21.path = path.cgPathstarlayer21.fillColor = CGColor(srgbRed: 255, green: 255, blue: 255, alpha: 1)view.layer.addSublayer(starlayer21)index = 192*3path = UIBezierPath()path.move(to: CGPoint(x: (96+index)/10, y: (37+index2)/10))path.addLine(to: CGPoint(x: (96+index)/10, y:(37+index2)/10))path.addLine(to: CGPoint(x: (106+index)/10, y: (67+index2)/10))path.addLine(to: CGPoint(x: (139+index)/10, y: (67+index2)/10))path.addLine(to: CGPoint(x: (112+index)/10, y: (87+index2)/10))path.addLine(to: CGPoint(x: (123+index)/10, y: (118+index2)/10))path.addLine(to: CGPoint(x: (96+index)/10, y: (100+index2)/10))path.addLine(to: CGPoint(x: (69+index)/10, y: (118+index2)/10))path.addLine(to: CGPoint(x: (79+index)/10, y: (87+index2)/10))path.addLine(to: CGPoint(x: (52+index)/10, y: (67+index2)/10))path.addLine(to: CGPoint(x: (85+index)/10, y: (66+index2)/10))path.close()let starlayer22 = CAShapeLayer()starlayer22.path = path.cgPathstarlayer22.fillColor = CGColor(srgbRed: 255, green: 255, blue: 255, alpha: 1)view.layer.addSublayer(starlayer22)index = 192*4path = UIBezierPath()path.move(to: CGPoint(x: (96+index)/10, y: (37+index2)/10))path.addLine(to: CGPoint(x: (96+index)/10, y:(37+index2)/10))path.addLine(to: CGPoint(x: (106+index)/10, y: (67+index2)/10))path.addLine(to: CGPoint(x: (139+index)/10, y: (67+index2)/10))path.addLine(to: CGPoint(x: (112+index)/10, y: (87+index2)/10))path.addLine(to: CGPoint(x: (123+index)/10, y: (118+index2)/10))path.addLine(to: CGPoint(x: (96+index)/10, y: (100+index2)/10))path.addLine(to: CGPoint(x: (69+index)/10, y: (118+index2)/10))path.addLine(to: CGPoint(x: (79+index)/10, y: (87+index2)/10))path.addLine(to: CGPoint(x: (52+index)/10, y: (67+index2)/10))path.addLine(to: CGPoint(x: (85+index)/10, y: (66+index2)/10))path.close()let starlayer23 = CAShapeLayer()starlayer23.path = path.cgPathstarlayer23.fillColor = CGColor(srgbRed: 255, green: 255, blue: 255, alpha: 1)view.layer.addSublayer(starlayer23)index = 192*5path = UIBezierPath()path.move(to: CGPoint(x: (96+index)/10, y: (37+index2)/10))path.addLine(to: CGPoint(x: (96+index)/10, y:(37+index2)/10))path.addLine(to: CGPoint(x: (106+index)/10, y: (67+index2)/10))path.addLine(to: CGPoint(x: (139+index)/10, y: (67+index2)/10))path.addLine(to: CGPoint(x: (112+index)/10, y: (87+index2)/10))path.addLine(to: CGPoint(x: (123+index)/10, y: (118+index2)/10))path.addLine(to: CGPoint(x: (96+index)/10, y: (100+index2)/10))path.addLine(to: CGPoint(x: (69+index)/10, y: (118+index2)/10))path.addLine(to: CGPoint(x: (79+index)/10, y: (87+index2)/10))path.addLine(to: CGPoint(x: (52+index)/10, y: (67+index2)/10))path.addLine(to: CGPoint(x: (85+index)/10, y: (66+index2)/10))path.close()let starlayer24 = CAShapeLayer()starlayer24.path = path.cgPathstarlayer24.fillColor = CGColor(srgbRed: 255, green: 255, blue: 255, alpha: 1)view.layer.addSublayer(starlayer24)// fifth rowindex2 = 163*4path = UIBezierPath()path.move(to: CGPoint(x: 96/10, y: (37+index2)/10))path.addLine(to: CGPoint(x: 96/10, y:(37+index2)/10))path.addLine(to: CGPoint(x: 106/10, y: (67+index2)/10))path.addLine(to: CGPoint(x: 139/10, y: (67+index2)/10))path.addLine(to: CGPoint(x: 112/10, y: (87+index2)/10))path.addLine(to: CGPoint(x: 123/10, y: (118+index2)/10))path.addLine(to: CGPoint(x: 96/10, y: (100+index2)/10))path.addLine(to: CGPoint(x: 69/10, y: (118+index2)/10))path.addLine(to: CGPoint(x: 79/10, y: (87+index2)/10))path.addLine(to: CGPoint(x: 52/10, y: (67+index2)/10))path.addLine(to: CGPoint(x: 85/10, y: (66+index2)/10))path.close()let starlayer25 = CAShapeLayer()starlayer25.path = path.cgPathstarlayer25.fillColor = CGColor(srgbRed: 255, green: 255, blue: 255, alpha: 1)view.layer.addSublayer(starlayer25)index = 192path = UIBezierPath()path.move(to: CGPoint(x: (96+index)/10, y: (37+index2)/10))path.addLine(to: CGPoint(x: (96+index)/10, y:(37+index2)/10))path.addLine(to: CGPoint(x: (106+index)/10, y: (67+index2)/10))path.addLine(to: CGPoint(x: (139+index)/10, y: (67+index2)/10))path.addLine(to: CGPoint(x: (112+index)/10, y: (87+index2)/10))path.addLine(to: CGPoint(x: (123+index)/10, y: (118+index2)/10))path.addLine(to: CGPoint(x: (96+index)/10, y: (100+index2)/10))path.addLine(to: CGPoint(x: (69+index)/10, y: (118+index2)/10))path.addLine(to: CGPoint(x: (79+index)/10, y: (87+index2)/10))path.addLine(to: CGPoint(x: (52+index)/10, y: (67+index2)/10))path.addLine(to: CGPoint(x: (85+index)/10, y: (66+index2)/10))path.close()let starlayer26 = CAShapeLayer()starlayer26.path = path.cgPathstarlayer26.fillColor = CGColor(srgbRed: 255, green: 255, blue: 255, alpha: 1)view.layer.addSublayer(starlayer26)index = 192*2path = UIBezierPath()path.move(to: CGPoint(x: (96+index)/10, y: (37+index2)/10))path.addLine(to: CGPoint(x: (96+index)/10, y:(37+index2)/10))path.addLine(to: CGPoint(x: (106+index)/10, y: (67+index2)/10))path.addLine(to: CGPoint(x: (139+index)/10, y: (67+index2)/10))path.addLine(to: CGPoint(x: (112+index)/10, y: (87+index2)/10))path.addLine(to: CGPoint(x: (123+index)/10, y: (118+index2)/10))path.addLine(to: CGPoint(x: (96+index)/10, y: (100+index2)/10))path.addLine(to: CGPoint(x: (69+index)/10, y: (118+index2)/10))path.addLine(to: CGPoint(x: (79+index)/10, y: (87+index2)/10))path.addLine(to: CGPoint(x: (52+index)/10, y: (67+index2)/10))path.addLine(to: CGPoint(x: (85+index)/10, y: (66+index2)/10))path.close()let starlayer27 = CAShapeLayer()starlayer27.path = path.cgPathstarlayer27.fillColor = CGColor(srgbRed: 255, green: 255, blue: 255, alpha: 1)view.layer.addSublayer(starlayer27)index = 192*3path = UIBezierPath()path.move(to: CGPoint(x: (96+index)/10, y: (37+index2)/10))path.addLine(to: CGPoint(x: (96+index)/10, y:(37+index2)/10))path.addLine(to: CGPoint(x: (106+index)/10, y: (67+index2)/10))path.addLine(to: CGPoint(x: (139+index)/10, y: (67+index2)/10))path.addLine(to: CGPoint(x: (112+index)/10, y: (87+index2)/10))path.addLine(to: CGPoint(x: (123+index)/10, y: (118+index2)/10))path.addLine(to: CGPoint(x: (96+index)/10, y: (100+index2)/10))path.addLine(to: CGPoint(x: (69+index)/10, y: (118+index2)/10))path.addLine(to: CGPoint(x: (79+index)/10, y: (87+index2)/10))path.addLine(to: CGPoint(x: (52+index)/10, y: (67+index2)/10))path.addLine(to: CGPoint(x: (85+index)/10, y: (66+index2)/10))path.close()let starlayer28 = CAShapeLayer()starlayer28.path = path.cgPathstarlayer28.fillColor = CGColor(srgbRed: 255, green: 255, blue: 255, alpha: 1)view.layer.addSublayer(starlayer28)index = 192*4path = UIBezierPath()path.move(to: CGPoint(x: (96+index)/10, y: (37+index2)/10))path.addLine(to: CGPoint(x: (96+index)/10, y:(37+index2)/10))path.addLine(to: CGPoint(x: (106+index)/10, y: (67+index2)/10))path.addLine(to: CGPoint(x: (139+index)/10, y: (67+index2)/10))path.addLine(to: CGPoint(x: (112+index)/10, y: (87+index2)/10))path.addLine(to: CGPoint(x: (123+index)/10, y: (118+index2)/10))path.addLine(to: CGPoint(x: (96+index)/10, y: (100+index2)/10))path.addLine(to: CGPoint(x: (69+index)/10, y: (118+index2)/10))path.addLine(to: CGPoint(x: (79+index)/10, y: (87+index2)/10))path.addLine(to: CGPoint(x: (52+index)/10, y: (67+index2)/10))path.addLine(to: CGPoint(x: (85+index)/10, y: (66+index2)/10))path.close()let starlayer29 = CAShapeLayer()starlayer29.path = path.cgPathstarlayer29.fillColor = CGColor(srgbRed: 255, green: 255, blue: 255, alpha: 1)view.layer.addSublayer(starlayer29)index = 192*5path = UIBezierPath()path.move(to: CGPoint(x: (96+index)/10, y: (37+index2)/10))path.addLine(to: CGPoint(x: (96+index)/10, y:(37+index2)/10))path.addLine(to: CGPoint(x: (106+index)/10, y: (67+index2)/10))path.addLine(to: CGPoint(x: (139+index)/10, y: (67+index2)/10))path.addLine(to: CGPoint(x: (112+index)/10, y: (87+index2)/10))path.addLine(to: CGPoint(x: (123+index)/10, y: (118+index2)/10))path.addLine(to: CGPoint(x: (96+index)/10, y: (100+index2)/10))path.addLine(to: CGPoint(x: (69+index)/10, y: (118+index2)/10))path.addLine(to: CGPoint(x: (79+index)/10, y: (87+index2)/10))path.addLine(to: CGPoint(x: (52+index)/10, y: (67+index2)/10))path.addLine(to: CGPoint(x: (85+index)/10, y: (66+index2)/10))path.close()let starlayer30 = CAShapeLayer()starlayer30.path = path.cgPathstarlayer30.fillColor = CGColor(srgbRed: 255, green: 255, blue: 255, alpha: 1)view.layer.addSublayer(starlayer30)//other first rowindex2 = 82index = 96path = UIBezierPath()path.move(to: CGPoint(x: (96+index)/10, y: (37+index2)/10))path.addLine(to: CGPoint(x: (96+index)/10, y:(37+index2)/10))path.addLine(to: CGPoint(x: (106+index)/10, y: (67+index2)/10))path.addLine(to: CGPoint(x: (139+index)/10, y: (67+index2)/10))path.addLine(to: CGPoint(x: (112+index)/10, y: (87+index2)/10))path.addLine(to: CGPoint(x: (123+index)/10, y: (118+index2)/10))path.addLine(to: CGPoint(x: (96+index)/10, y: (100+index2)/10))path.addLine(to: CGPoint(x: (69+index)/10, y: (118+index2)/10))path.addLine(to: CGPoint(x: (79+index)/10, y: (87+index2)/10))path.addLine(to: CGPoint(x: (52+index)/10, y: (67+index2)/10))path.addLine(to: CGPoint(x: (85+index)/10, y: (66+index2)/10))path.close()let starlayer31 = CAShapeLayer()starlayer31.path = path.cgPathstarlayer31.fillColor = CGColor(srgbRed: 255, green: 255, blue: 255, alpha: 1)view.layer.addSublayer(starlayer31)index = 96+192path = UIBezierPath()path.move(to: CGPoint(x: (96+index)/10, y: (37+index2)/10))path.addLine(to: CGPoint(x: (96+index)/10, y:(37+index2)/10))path.addLine(to: CGPoint(x: (106+index)/10, y: (67+index2)/10))path.addLine(to: CGPoint(x: (139+index)/10, y: (67+index2)/10))path.addLine(to: CGPoint(x: (112+index)/10, y: (87+index2)/10))path.addLine(to: CGPoint(x: (123+index)/10, y: (118+index2)/10))path.addLine(to: CGPoint(x: (96+index)/10, y: (100+index2)/10))path.addLine(to: CGPoint(x: (69+index)/10, y: (118+index2)/10))path.addLine(to: CGPoint(x: (79+index)/10, y: (87+index2)/10))path.addLine(to: CGPoint(x: (52+index)/10, y: (67+index2)/10))path.addLine(to: CGPoint(x: (85+index)/10, y: (66+index2)/10))path.close()let starlayer32 = CAShapeLayer()starlayer32.path = path.cgPathstarlayer32.fillColor = CGColor(srgbRed: 255, green: 255, blue: 255, alpha: 1)view.layer.addSublayer(starlayer32)index = 96+192*2path = UIBezierPath()path.move(to: CGPoint(x: (96+index)/10, y: (37+index2)/10))path.addLine(to: CGPoint(x: (96+index)/10, y:(37+index2)/10))path.addLine(to: CGPoint(x: (106+index)/10, y: (67+index2)/10))path.addLine(to: CGPoint(x: (139+index)/10, y: (67+index2)/10))path.addLine(to: CGPoint(x: (112+index)/10, y: (87+index2)/10))path.addLine(to: CGPoint(x: (123+index)/10, y: (118+index2)/10))path.addLine(to: CGPoint(x: (96+index)/10, y: (100+index2)/10))path.addLine(to: CGPoint(x: (69+index)/10, y: (118+index2)/10))path.addLine(to: CGPoint(x: (79+index)/10, y: (87+index2)/10))path.addLine(to: CGPoint(x: (52+index)/10, y: (67+index2)/10))path.addLine(to: CGPoint(x: (85+index)/10, y: (66+index2)/10))path.close()let starlayer33 = CAShapeLayer()starlayer33.path = path.cgPathstarlayer33.fillColor = CGColor(srgbRed: 255, green: 255, blue: 255, alpha: 1)view.layer.addSublayer(starlayer33)index = 96+192*3path = UIBezierPath()path.move(to: CGPoint(x: (96+index)/10, y: (37+index2)/10))path.addLine(to: CGPoint(x: (96+index)/10, y:(37+index2)/10))path.addLine(to: CGPoint(x: (106+index)/10, y: (67+index2)/10))path.addLine(to: CGPoint(x: (139+index)/10, y: (67+index2)/10))path.addLine(to: CGPoint(x: (112+index)/10, y: (87+index2)/10))path.addLine(to: CGPoint(x: (123+index)/10, y: (118+index2)/10))path.addLine(to: CGPoint(x: (96+index)/10, y: (100+index2)/10))path.addLine(to: CGPoint(x: (69+index)/10, y: (118+index2)/10))path.addLine(to: CGPoint(x: (79+index)/10, y: (87+index2)/10))path.addLine(to: CGPoint(x: (52+index)/10, y: (67+index2)/10))path.addLine(to: CGPoint(x: (85+index)/10, y: (66+index2)/10))path.close()let starlayer34 = CAShapeLayer()starlayer34.path = path.cgPathstarlayer34.fillColor = CGColor(srgbRed: 255, green: 255, blue: 255, alpha: 1)view.layer.addSublayer(starlayer34)index = 96+192*4path = UIBezierPath()path.move(to: CGPoint(x: (96+index)/10, y: (37+index2)/10))path.addLine(to: CGPoint(x: (96+index)/10, y:(37+index2)/10))path.addLine(to: CGPoint(x: (106+index)/10, y: (67+index2)/10))path.addLine(to: CGPoint(x: (139+index)/10, y: (67+index2)/10))path.addLine(to: CGPoint(x: (112+index)/10, y: (87+index2)/10))path.addLine(to: CGPoint(x: (123+index)/10, y: (118+index2)/10))path.addLine(to: CGPoint(x: (96+index)/10, y: (100+index2)/10))path.addLine(to: CGPoint(x: (69+index)/10, y: (118+index2)/10))path.addLine(to: CGPoint(x: (79+index)/10, y: (87+index2)/10))path.addLine(to: CGPoint(x: (52+index)/10, y: (67+index2)/10))path.addLine(to: CGPoint(x: (85+index)/10, y: (66+index2)/10))path.close()let starlayer35 = CAShapeLayer()starlayer35.path = path.cgPathstarlayer35.fillColor = CGColor(srgbRed: 255, green: 255, blue: 255, alpha: 1)view.layer.addSublayer(starlayer35)//other second rowindex2 = 82+163index = 96path = UIBezierPath()path.move(to: CGPoint(x: (96+index)/10, y: (37+index2)/10))path.addLine(to: CGPoint(x: (96+index)/10, y:(37+index2)/10))path.addLine(to: CGPoint(x: (106+index)/10, y: (67+index2)/10))path.addLine(to: CGPoint(x: (139+index)/10, y: (67+index2)/10))path.addLine(to: CGPoint(x: (112+index)/10, y: (87+index2)/10))path.addLine(to: CGPoint(x: (123+index)/10, y: (118+index2)/10))path.addLine(to: CGPoint(x: (96+index)/10, y: (100+index2)/10))path.addLine(to: CGPoint(x: (69+index)/10, y: (118+index2)/10))path.addLine(to: CGPoint(x: (79+index)/10, y: (87+index2)/10))path.addLine(to: CGPoint(x: (52+index)/10, y: (67+index2)/10))path.addLine(to: CGPoint(x: (85+index)/10, y: (66+index2)/10))path.close()let starlayer36 = CAShapeLayer()starlayer36.path = path.cgPathstarlayer36.fillColor = CGColor(srgbRed: 255, green: 255, blue: 255, alpha: 1)view.layer.addSublayer(starlayer36)index = 96+192path = UIBezierPath()path.move(to: CGPoint(x: (96+index)/10, y: (37+index2)/10))path.addLine(to: CGPoint(x: (96+index)/10, y:(37+index2)/10))path.addLine(to: CGPoint(x: (106+index)/10, y: (67+index2)/10))path.addLine(to: CGPoint(x: (139+index)/10, y: (67+index2)/10))path.addLine(to: CGPoint(x: (112+index)/10, y: (87+index2)/10))path.addLine(to: CGPoint(x: (123+index)/10, y: (118+index2)/10))path.addLine(to: CGPoint(x: (96+index)/10, y: (100+index2)/10))path.addLine(to: CGPoint(x: (69+index)/10, y: (118+index2)/10))path.addLine(to: CGPoint(x: (79+index)/10, y: (87+index2)/10))path.addLine(to: CGPoint(x: (52+index)/10, y: (67+index2)/10))path.addLine(to: CGPoint(x: (85+index)/10, y: (66+index2)/10))path.close()let starlayer37 = CAShapeLayer()starlayer37.path = path.cgPathstarlayer37.fillColor = CGColor(srgbRed: 255, green: 255, blue: 255, alpha: 1)view.layer.addSublayer(starlayer37)index = 96+192*2path = UIBezierPath()path.move(to: CGPoint(x: (96+index)/10, y: (37+index2)/10))path.addLine(to: CGPoint(x: (96+index)/10, y:(37+index2)/10))path.addLine(to: CGPoint(x: (106+index)/10, y: (67+index2)/10))path.addLine(to: CGPoint(x: (139+index)/10, y: (67+index2)/10))path.addLine(to: CGPoint(x: (112+index)/10, y: (87+index2)/10))path.addLine(to: CGPoint(x: (123+index)/10, y: (118+index2)/10))path.addLine(to: CGPoint(x: (96+index)/10, y: (100+index2)/10))path.addLine(to: CGPoint(x: (69+index)/10, y: (118+index2)/10))path.addLine(to: CGPoint(x: (79+index)/10, y: (87+index2)/10))path.addLine(to: CGPoint(x: (52+index)/10, y: (67+index2)/10))path.addLine(to: CGPoint(x: (85+index)/10, y: (66+index2)/10))path.close()let starlayer38 = CAShapeLayer()starlayer38.path = path.cgPathstarlayer38.fillColor = CGColor(srgbRed: 255, green: 255, blue: 255, alpha: 1)view.layer.addSublayer(starlayer38)index = 96+192*3path = UIBezierPath()path.move(to: CGPoint(x: (96+index)/10, y: (37+index2)/10))path.addLine(to: CGPoint(x: (96+index)/10, y:(37+index2)/10))path.addLine(to: CGPoint(x: (106+index)/10, y: (67+index2)/10))path.addLine(to: CGPoint(x: (139+index)/10, y: (67+index2)/10))path.addLine(to: CGPoint(x: (112+index)/10, y: (87+index2)/10))path.addLine(to: CGPoint(x: (123+index)/10, y: (118+index2)/10))path.addLine(to: CGPoint(x: (96+index)/10, y: (100+index2)/10))path.addLine(to: CGPoint(x: (69+index)/10, y: (118+index2)/10))path.addLine(to: CGPoint(x: (79+index)/10, y: (87+index2)/10))path.addLine(to: CGPoint(x: (52+index)/10, y: (67+index2)/10))path.addLine(to: CGPoint(x: (85+index)/10, y: (66+index2)/10))path.close()let starlayer39 = CAShapeLayer()starlayer39.path = path.cgPathstarlayer39.fillColor = CGColor(srgbRed: 255, green: 255, blue: 255, alpha: 1)view.layer.addSublayer(starlayer39)index = 96+192*4path = UIBezierPath()path.move(to: CGPoint(x: (96+index)/10, y: (37+index2)/10))path.addLine(to: CGPoint(x: (96+index)/10, y:(37+index2)/10))path.addLine(to: CGPoint(x: (106+index)/10, y: (67+index2)/10))path.addLine(to: CGPoint(x: (139+index)/10, y: (67+index2)/10))path.addLine(to: CGPoint(x: (112+index)/10, y: (87+index2)/10))path.addLine(to: CGPoint(x: (123+index)/10, y: (118+index2)/10))path.addLine(to: CGPoint(x: (96+index)/10, y: (100+index2)/10))path.addLine(to: CGPoint(x: (69+index)/10, y: (118+index2)/10))path.addLine(to: CGPoint(x: (79+index)/10, y: (87+index2)/10))path.addLine(to: CGPoint(x: (52+index)/10, y: (67+index2)/10))path.addLine(to: CGPoint(x: (85+index)/10, y: (66+index2)/10))path.close()let starlayer40 = CAShapeLayer()starlayer40.path = path.cgPathstarlayer40.fillColor = CGColor(srgbRed: 255, green: 255, blue: 255, alpha: 1)view.layer.addSublayer(starlayer40)// other third rowindex2 = 82+163*2index = 96path = UIBezierPath()path.move(to: CGPoint(x: (96+index)/10, y: (37+index2)/10))path.addLine(to: CGPoint(x: (96+index)/10, y:(37+index2)/10))path.addLine(to: CGPoint(x: (106+index)/10, y: (67+index2)/10))path.addLine(to: CGPoint(x: (139+index)/10, y: (67+index2)/10))path.addLine(to: CGPoint(x: (112+index)/10, y: (87+index2)/10))path.addLine(to: CGPoint(x: (123+index)/10, y: (118+index2)/10))path.addLine(to: CGPoint(x: (96+index)/10, y: (100+index2)/10))path.addLine(to: CGPoint(x: (69+index)/10, y: (118+index2)/10))path.addLine(to: CGPoint(x: (79+index)/10, y: (87+index2)/10))path.addLine(to: CGPoint(x: (52+index)/10, y: (67+index2)/10))path.addLine(to: CGPoint(x: (85+index)/10, y: (66+index2)/10))path.close()let starlayer41 = CAShapeLayer()starlayer41.path = path.cgPathstarlayer41.fillColor = CGColor(srgbRed: 255, green: 255, blue: 255, alpha: 1)view.layer.addSublayer(starlayer41)index = 96+192path = UIBezierPath()path.move(to: CGPoint(x: (96+index)/10, y: (37+index2)/10))path.addLine(to: CGPoint(x: (96+index)/10, y:(37+index2)/10))path.addLine(to: CGPoint(x: (106+index)/10, y: (67+index2)/10))path.addLine(to: CGPoint(x: (139+index)/10, y: (67+index2)/10))path.addLine(to: CGPoint(x: (112+index)/10, y: (87+index2)/10))path.addLine(to: CGPoint(x: (123+index)/10, y: (118+index2)/10))path.addLine(to: CGPoint(x: (96+index)/10, y: (100+index2)/10))path.addLine(to: CGPoint(x: (69+index)/10, y: (118+index2)/10))path.addLine(to: CGPoint(x: (79+index)/10, y: (87+index2)/10))path.addLine(to: CGPoint(x: (52+index)/10, y: (67+index2)/10))path.addLine(to: CGPoint(x: (85+index)/10, y: (66+index2)/10))path.close()let starlayer42 = CAShapeLayer()starlayer42.path = path.cgPathstarlayer42.fillColor = CGColor(srgbRed: 255, green: 255, blue: 255, alpha: 1)view.layer.addSublayer(starlayer42)index = 96+192*2path = UIBezierPath()path.move(to: CGPoint(x: (96+index)/10, y: (37+index2)/10))path.addLine(to: CGPoint(x: (96+index)/10, y:(37+index2)/10))path.addLine(to: CGPoint(x: (106+index)/10, y: (67+index2)/10))path.addLine(to: CGPoint(x: (139+index)/10, y: (67+index2)/10))path.addLine(to: CGPoint(x: (112+index)/10, y: (87+index2)/10))path.addLine(to: CGPoint(x: (123+index)/10, y: (118+index2)/10))path.addLine(to: CGPoint(x: (96+index)/10, y: (100+index2)/10))path.addLine(to: CGPoint(x: (69+index)/10, y: (118+index2)/10))path.addLine(to: CGPoint(x: (79+index)/10, y: (87+index2)/10))path.addLine(to: CGPoint(x: (52+index)/10, y: (67+index2)/10))path.addLine(to: CGPoint(x: (85+index)/10, y: (66+index2)/10))path.close()let starlayer43 = CAShapeLayer()starlayer43.path = path.cgPathstarlayer43.fillColor = CGColor(srgbRed: 255, green: 255, blue: 255, alpha: 1)view.layer.addSublayer(starlayer43)index = 96+192*3path = UIBezierPath()path.move(to: CGPoint(x: (96+index)/10, y: (37+index2)/10))path.addLine(to: CGPoint(x: (96+index)/10, y:(37+index2)/10))path.addLine(to: CGPoint(x: (106+index)/10, y: (67+index2)/10))path.addLine(to: CGPoint(x: (139+index)/10, y: (67+index2)/10))path.addLine(to: CGPoint(x: (112+index)/10, y: (87+index2)/10))path.addLine(to: CGPoint(x: (123+index)/10, y: (118+index2)/10))path.addLine(to: CGPoint(x: (96+index)/10, y: (100+index2)/10))path.addLine(to: CGPoint(x: (69+index)/10, y: (118+index2)/10))path.addLine(to: CGPoint(x: (79+index)/10, y: (87+index2)/10))path.addLine(to: CGPoint(x: (52+index)/10, y: (67+index2)/10))path.addLine(to: CGPoint(x: (85+index)/10, y: (66+index2)/10))path.close()let starlayer44 = CAShapeLayer()starlayer44.path = path.cgPathstarlayer44.fillColor = CGColor(srgbRed: 255, green: 255, blue: 255, alpha: 1)view.layer.addSublayer(starlayer44)index = 96+192*4path = UIBezierPath()path.move(to: CGPoint(x: (96+index)/10, y: (37+index2)/10))path.addLine(to: CGPoint(x: (96+index)/10, y:(37+index2)/10))path.addLine(to: CGPoint(x: (106+index)/10, y: (67+index2)/10))path.addLine(to: CGPoint(x: (139+index)/10, y: (67+index2)/10))path.addLine(to: CGPoint(x: (112+index)/10, y: (87+index2)/10))path.addLine(to: CGPoint(x: (123+index)/10, y: (118+index2)/10))path.addLine(to: CGPoint(x: (96+index)/10, y: (100+index2)/10))path.addLine(to: CGPoint(x: (69+index)/10, y: (118+index2)/10))path.addLine(to: CGPoint(x: (79+index)/10, y: (87+index2)/10))path.addLine(to: CGPoint(x: (52+index)/10, y: (67+index2)/10))path.addLine(to: CGPoint(x: (85+index)/10, y: (66+index2)/10))path.close()let starlayer45 = CAShapeLayer()starlayer45.path = path.cgPathstarlayer45.fillColor = CGColor(srgbRed: 255, green: 255, blue: 255, alpha: 1)view.layer.addSublayer(starlayer45)// other fourh rowindex2 = 82+163*3index = 96path = UIBezierPath()path.move(to: CGPoint(x: (96+index)/10, y: (37+index2)/10))path.addLine(to: CGPoint(x: (96+index)/10, y:(37+index2)/10))path.addLine(to: CGPoint(x: (106+index)/10, y: (67+index2)/10))path.addLine(to: CGPoint(x: (139+index)/10, y: (67+index2)/10))path.addLine(to: CGPoint(x: (112+index)/10, y: (87+index2)/10))path.addLine(to: CGPoint(x: (123+index)/10, y: (118+index2)/10))path.addLine(to: CGPoint(x: (96+index)/10, y: (100+index2)/10))path.addLine(to: CGPoint(x: (69+index)/10, y: (118+index2)/10))path.addLine(to: CGPoint(x: (79+index)/10, y: (87+index2)/10))path.addLine(to: CGPoint(x: (52+index)/10, y: (67+index2)/10))path.addLine(to: CGPoint(x: (85+index)/10, y: (66+index2)/10))path.close()let starlayer46 = CAShapeLayer()starlayer46.path = path.cgPathstarlayer46.fillColor = CGColor(srgbRed: 255, green: 255, blue: 255, alpha: 1)view.layer.addSublayer(starlayer46)index = 96+192path = UIBezierPath()path.move(to: CGPoint(x: (96+index)/10, y: (37+index2)/10))path.addLine(to: CGPoint(x: (96+index)/10, y:(37+index2)/10))path.addLine(to: CGPoint(x: (106+index)/10, y: (67+index2)/10))path.addLine(to: CGPoint(x: (139+index)/10, y: (67+index2)/10))path.addLine(to: CGPoint(x: (112+index)/10, y: (87+index2)/10))path.addLine(to: CGPoint(x: (123+index)/10, y: (118+index2)/10))path.addLine(to: CGPoint(x: (96+index)/10, y: (100+index2)/10))path.addLine(to: CGPoint(x: (69+index)/10, y: (118+index2)/10))path.addLine(to: CGPoint(x: (79+index)/10, y: (87+index2)/10))path.addLine(to: CGPoint(x: (52+index)/10, y: (67+index2)/10))path.addLine(to: CGPoint(x: (85+index)/10, y: (66+index2)/10))path.close()let starlayer47 = CAShapeLayer()

--

--