I have edited the question to focus on the last error. This is the last error in my code: an Array extension to remove object by value
It seems to be related to this post too:
Array extension to remove object by value
But I am stuck :x
func cell(cell: FriendSearchTableViewCell, didSelectUnfollowUser user: PFUser) {
if var followingUsers = followingUsers {
ParseHelper.removeFollowRelationshipFromUser(PFUser.currentUser()!, toUser: user)
// update local cache
removeObject(user, fromArray: &followingUsers)
self.followingUsers = followingUsers
}
// for the 'removeObject' an error is raised:
Use of unresolved identifier 'removeObject'
The function is calling the framework Foundation
through a Array+RemoveObject.swift
file which states:
import Foundation
// Thanks to Martin R: https://stackoverflow.com/questions/24938948/array-extension-to-remove-object-by-value
extension Array where Element : Equatable {
// Remove first collection element that is equal to the given `object`:
mutating func removeObject(object : Generator.Element) {
if let index = self.indexOf(object) {
self.removeAtIndex(index)
}
}
}
I am not sure my workspace is properly understanding that he needs to refer to this swift file to find the details of the identified removeObject
.