-1

in the following swift code, i get an error:

Must call a designated initializer of the superclass 'UITextView'
Convenience initializer is declared here (UIKit.UITextView)

for this line:

super.init(frame: frame)

class ACTextField: UITextView, UITextViewDelegate, UITableViewDelegate, UITableViewDataSource, UIGestureRecognizerDelegate {

var mDelegate : ACTextFieldDelegate?
var tableViewController : UITableViewController?
var data = [Dictionary<String, AnyObject>]()

@IBInspectable var popoverBackgroundColor : UIColor = UIColor(red: 240.0/255.0, green: 240.0/255.0, blue: 240.0/255.0, alpha: 1.0)
@IBInspectable var popoverSize : CGRect?
@IBInspectable var seperatorColor : UIColor = UIColor(white: 0.95, alpha: 1.0)


init(frame: CGRect) {
    super.init(frame: frame)
}

required init(coder aDecoder: NSCoder){
    super.init(coder: aDecoder)!
}
}

any ideas how can i solve this problem?

GhostStack
  • 153
  • 1
  • 13
  • 1
    From [UITextView Class Reference](https://developer.apple.com/library/ios/documentation/UIKit/Reference/UITextView_Class/index.html): the designated Initializer is `init(frame frame:, textContainer:)`. – Pang Feb 03 '16 at 07:33

1 Answers1

2

As per document for UITextView

 // Create a new text view with the specified text container (can be nil) - this is the new designated initializer for this class
@available(iOS 7.0, *)
public init(frame: CGRect, textContainer: NSTextContainer?)
Sujit
  • 610
  • 7
  • 26