I know nothing about Xcode...

So, I dont like my phone knowing where I am at all times and dont feel like turning location services off. I am trying to make a spoofer that can be toggled on or off from my phone but I dont know how to setup the toggle switch to change my current location to the one I desire. Any suggestions? the current code I have is

import UIKit

class ViewController: UIViewController {

    
    @IBAction func `switch`(_ sender: UISwitch)
    {
        if (sender.isOn == true)
        {
            
        }
        
    }
    
    
    
    override func viewDidLoad() {
        super.viewDidLoad()
        
    }


}

The part im having difficulty is right here

if (sender.isOn == true)
{

}

I dont know what to put there to make my location change

Any help would be appreciated

Could you show the code where you use current location ?

I dont like my phone knowing where I am at all times

  • The location is known only in the iPhone, unless you authorize an app to use your location. So, what is the point ?
  • AFAIK, you cannoot change the real user location, just hide it to apps or turn off.

Note: even if allowed, IMHO, it is not a good idea to call a func with a reserved word (even enclosed by tick marks) func switch

In Swift, instead of

if (sender.isOn == true)

you can simply write

if sender.isOn
I know nothing about Xcode...
 
 
Q