Last active
February 10, 2016 03:59
-
-
Save kwylez/384f89a080e057cfff14 to your computer and use it in GitHub Desktop.
This file contains 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
/// Iterate and add subviews plus the index value | |
var currentIndex = 0 | |
let updatedIndexes = items.map({ (item: MenuItem) -> MenuItem in | |
item.index += currentIndex | |
item.delegate = self | |
currentIndex++ | |
self.addSubview(item) | |
return item | |
}) | |
self.menutItems += updatedIndexes |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment