Set BarButtonItem (Left) as Image from URL

26 Views Asked by At

Im fairly new to swift and im struggling to set a bar button item as an image which pulls from the Sign-In function that has created a variable 'profilePicImage'.

  var profilePicUrl: URL?
       @IBAction func signIn(_ sender: Any)  {
            GIDSignIn.sharedInstance.signIn(with: signInConfig, presenting: self) { user, error in
                guard error == nil else { return }
                guard let user = user else { return }

                self.profilePicUrl = user.profile?.imageURL(withDimension: 320)

Then, in the Main ViewController where i want to display this image i have created an Outlet for the BarButtonItem called 'profileButton'

    @IBOutlet weak var profileButton: UIBarButtonItem!

however from here i come unstuck. any help offered i would greatly appreciate.

0

There are 0 best solutions below