Create a function that can serve as a listener to anchors and integrate it to the swifty search.