UPGRADE YOUR SKILLS: Learn advanced Swift and SwiftUI on Hacking with Swift+! >>

SOLVED: project 3 code problem in codex13

Forums > 100 Days of Swift

please help is anyone else facing this problem

@objc func shareTapped() { gaurd let image = imageView.image?.jpegData(compressionQuality: 0.8) else { print("No image found") return }

    let vc = UIActivityViewController(activityItems: [image], applicationActivities: [])
    vc.popoverPresentationController?.barButtonItem = navigationItem.rightBarButtonItem
    present(vc, animated: true)

}

this code is not working in codex13. it is showing errors:

Cannot find 'gaurd' in scope
closure expression is unused
Consecutive statements on a line must be separated by ';'

3      

guard has been misspelt ( as 'gaurd')

@objc func shareTapped() { guard let image = imageView.image?.jpegData(compressionQuality: 0.8) else { print("No image found") return }

3      

Hacking with Swift is sponsored by RevenueCat

SPONSORED Take the pain out of configuring and testing your paywalls. RevenueCat's Paywalls allow you to remotely configure your entire paywall view without any code changes or app updates.

Learn more here

Sponsor Hacking with Swift and reach the world's largest Swift community!

Archived topic

This topic has been closed due to inactivity, so you can't reply. Please create a new topic if you need to.

All interactions here are governed by our code of conduct.

 
Unknown user

You are not logged in

Log in or create account
 

Link copied to your pasteboard.