The problem with your code is that 0 ..< list.count is executed once at the beginning of the loop, when list still has all of its elements. Each time you remove one element, list.count is decremented, but the iteration range is not modified. You end up reading too far.

EDIT Removed the C-style loop because it's incorrect (for reasons other than @MartinR pointed out before deleting his comment, but incorrect nonetheless).