Implemented version of findNearestObject to traverse a vector of views