i have implemented assistolab dropdown in my project.but in some viewcontroller it could not work properly.it shows,
cannot use instance member within property initializer my code snippet is given below
class MobileTopUpVC: UIViewController,UITextFieldDelegate {
let dropDown = DropDown() //error is here
@IBOutlet weak var mobileTopUpImag: UIImageView!
@IBOutlet weak var amountTxt: UITextField!
@IBOutlet weak var mobileNumberTxt: UITextField!
@IBOutlet weak var operatorTxt: UITextField!
@IBOutlet weak var countryTxt: UITextField!
@IBOutlet weak var DropDown: UIView!
@IBOutlet weak var backGroundView: UIView!
var textArray = [UITextField]()
var countryArray:[String] = colors.countryArray
var operatorArray:[String] = colors.opArray
@IBOutlet weak var proceedButton: UIButton!
override func viewDidLoad() {
super.viewDidLoad()
backGroundView.layer.cornerRadius = backGroundView.frame.width/2
backGroundView.clipsToBounds = true
//countryArray = colors.countryArray
backGroundView.layer.borderWidth = 3
backGroundView.layer.borderColor = colors.second.cgColor
textArray = [countryTxt,operatorTxt,amountTxt,mobileNumberTxt]
let view1:UIView! = UIView()
view1.frame = CGRect(x: 0, y: 0, width: 0, height: 0)
countryTxt.inputView = view1
operatorTxt.inputView = view1
// countryTxt.layer.borderWidth = 1
// countryTxt.layer.borderColor = UIColor.green.cgColor
// countryTxt.borderStyle = UITextBorderStyle.bezel
borderStyle()
proceedButton.Cradius(size: 15.0)
mobileTopUpImag.image = mobileTopUpImag.image?.withRenderingMode(.alwaysTemplate)
mobileTopUpImag.tintColor = colors.second
countryDropDown()
}
the error is troubling me in this line
let dropDown = DropDown()
please help me to resolve this