Alright I have a couple of suggestions for you!! First off, I would change your function to have public on the front of it. So it would look something like this:
public func findpindist() {
print("Test")
}
Put is outside of your viewcontroller class and you should be able to call it in homePageViewController by putting findpindist() in the viewDidLoad.
However, this looks sloppy and is very buggy so I have a better solution for you! There is something called NotificationCenter. This will allow you to pass data between viewcontrollers without a segue or anything. To use this, first put this code inside the viewDidLoad of the homePageController
NotificationCenter.default.post(name: Notification.Name("findpindist"), object: nil, userInfo: ["message":"Test"])
Next, add this code to your viewController1. the observer stays in the viewDidLoad and the objective c function goes outside of the viewDidLoad
override func viewDidLoad() {
super.viewDidLoad()
NotificationCenter.default.addObserver(self, selector: #selector(findpindist(_:)), name: Notification.Name("findpindist"), object: nil)
}
@objc func findpindist(_ notification: Notification){
let message = notification.userInfo!["message"] as! String
print(message)
}
As long as you have your viewController1 loaded, it should print the statement. you can use this code to send any data between viewControllers. This should help with what I think you are trying to achieve, but as the other person said, I'm not sure what your objective is.
heres some additional resources:
Posting Messages with NotificationCenter
A deep walkthrough of NotificationCenter