5
let screenBounds = UIScreen.mainScreen().bounds   
var initialOrigin: CGFloat = UIScreen.mainScreen().bounds.height - 108   
let offset: CGFloat = 108   
var lastItem: ViewModel?   
var currentURIs = [NSURL]()

lazy var panRecognizer: UIPanGestureRecognizer = UIPanGestureRecognizer(target: self, action:
    #selector(PlayerController.handlePanGesture(_:)))   
lazy var tapRecognizer: UITapGestureRecognizer = UITapGestureRecognizer(target: self, action:
    #selector(PlayerController.handleTapGesture(_:)))

Getting Errors 'Expected ',' separator' and 'Expected expression in list of expressions' for the above code..It would be great..if somebody enlighten me...

6
  • Are you sure you pasted this code correctly? You cannot put multiple statements on the same line.
    – ryantxr
    Apr 1, 2016 at 4:32
  • There is nothing wrong with just the code you have posted (as formatted above). There were multiple statements in the code you had initially posted, which might be causing the issue if thats how it was written in your project. If not, you might want to specify the line where you get the error Apr 1, 2016 at 4:41
  • 1
    This code is for Swift 2.2 (Xcode 7.3): update Xcode if your version is older.
    – Eric Aya
    Apr 1, 2016 at 8:14
  • thanks Eric D, i'm on Yosemite & Xcode 7.2...will update and try this...
    – Rajesh M
    Apr 2, 2016 at 3:29
  • 1
    or you may change the action: #selector(PlayerController.handlePanGesture(_:)) to action:"handlePanGesture:" and like this
    – HardikDG
    Apr 5, 2016 at 16:15

1 Answer 1

11

Update the Xcode to 7.3 The new #selector syntax will only work in Xcode 7.3 (or newer)

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.