Ben Welterveden Ben Welterveden - 6 months ago 19
Swift Question

Invalid redeclaration of 'CURRENT_USER'

I wanted to define a variable for an OS X Application with Swift

But I always get this error in the title.

var CURRENT_USER: Firebase?


I also tried it with func

func var CURRENT_USER: Firebase?


Does anyone knows what I'm doing wrong?

Answer

EXPLANATION:

Yes, either:

1) You must have declared CURRENT_USER somewhere else in your code already (in the same Class or func).

2) CURRENT_USER is a variable used by a framework.


SOLUTION:

Just change the name of the var.