I'm quite new in Swift and Xcode 6 and have just created an app. Now I am trying to improve my code and I know that there is a way to reduce this code, I do not know how
button1.layer.cornerRadius = 10 button1.layer .borderWidth = 1 Button 1.layer.borderColor = UIColor.whiteColor (). CGColor Button 2.layer.cornerRadius = 10 button2.layer.borderWidth = 1 button2. Layer.Bidder Corral = UiKolor. White collar () CGColor Button 3 Layer Corner Radius = 10 Button 3. Layer Bitter Wide = 1 Button 3. Layer.Bidder Corral = UiKolor. White collar () CGSelar Button 4 Layer Corner Redes = 10 Button 4. Layer .borderWidth = 1 button4.layer.borderColor = UIColor.whiteColor (). CGColor button5.layer.cornerRadius = 10 button 5.layer.borderWidth = 1 button 5.layer.borderColor = UIColor.whiteColor (). CGColor
You can create an array of all buttons, and then make a loop through them. You can.
No comments:
Post a Comment