Guest User

Untitled

a guest
Dec 13th, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. extension JX_TypeWrapper where T: RangeReplaceableCollection, T.Element: Equatable {
  2. mutating func remove(object: T.Element) {
  3. if let index = SELF.firstIndex(of: object) {
  4. SELF.remove(at: index)
  5. }
  6. }
  7. }
  8.  
  9. var array: [Int] = [1, 2, 3]
  10. var wrapped = JX_TypeWrapper(value: array)
  11. wrapped.remove(object: 2)
  12. wrapped.SELF // [1, 3]
Add Comment
Please, Sign In to add comment