Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add function for swapping elements in collection #240

Closed
artemkalinovsky opened this issue Oct 19, 2016 · 1 comment
Closed

Add function for swapping elements in collection #240

artemkalinovsky opened this issue Oct 19, 2016 · 1 comment

Comments

@artemkalinovsky
Copy link

Let's implement something like:

extension Array {
    mutating func moveItem(at oldIndex: Int, to newIndex: Int) {
        self.insert(self.remove(at: oldIndex), at: newIndex)
    }
}
@ankurp
Copy link
Owner

ankurp commented Oct 19, 2016

Closing this and created it in the correct project ankurp/Cent#17

@ankurp ankurp closed this as completed Oct 19, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants