Created
June 25, 2020 12:35
-
-
Save TarasShu/ab4fb94d240b5a3c5a7850f7f57ec19d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func rectangles( largeRect: CGRect, count: Int) -> [CGRect] { | |
if count <= 1 { | |
CGRect(x: 0, y: 0, width: largeRect.width , height: largeRect.height) | |
return [] | |
} else { | |
for _ in 0...count{ | |
CGRect(x: 0 + (largeRect.width) * CGFloat(count) , | |
y: (largeRect.height) * CGFloat(count), | |
width: largeRect.width / CGFloat(count), | |
height: largeRect.height / CGFloat(count)) | |
} | |
return [] | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment