Search code examples
xcodeswiftiboutlet

IBOutlet variable name surrounded by ( ` )?


I'm not sure why, but for some reason I control-dragged a button as an Outlet to a view controller as usual, but the name was surrounded by Grave Accents ( ` ). Is there a reason for this? I haven't seen this notation before in Swift. What does it stand for?

My Outlets

@IBOutlet weak var q1: UITextField!
@IBOutlet weak var q2: UITextField!
@IBOutlet weak var q3: UITextField!
@IBOutlet weak var q4: UITextField!
@IBOutlet weak var q5: UITextField!

@IBOutlet var questions: [UITextField]!

@IBOutlet weak var `continue`: UIButton! 

Solution

  • Because continue is a Swift reserved word. You can't use a reserved word as a variable name without surrounding it with backticks.