My iPhone 6 got hacked with spyware even tho it isn't jailbroken. Will a factory reset fix the problem?

My iPhone 6 got hacked with spyware even tho it isn't jailbroken. Will a factory reset fix the problem? - 1

Yes

How do you know it got hacked with Spyware? Did a pop up tell you that? If so, it's fake.

A factory reset should solve the issue.