for-in loops no longer work with CGFloat as of Swift B5, so switched to standard for-loops