I created UITextField
in storyboard. And added its constraints also. I want search icon on left side of UITextField. The code for adding search icon is as follows:
self.searchTextField.leftView = searchIconImage;
self.searchTextField.leftViewMode = UITextFieldViewModeAlways;
[self.searchTextField addTarget:self
action:@selector(textFieldDidChange:)
forControlEvents:UIControlEventEditingChanged];
My application is working fine on iOS8 and its crashing on iOS7. The error is as follows:
Assertion failure in -[UITextField layoutSublayersOfLayer:], /SourceCache/UIKit/UIKit-2935.138/UIView.m:8794 2014-11-05 12:54:33.377 WattUp[1722:60b] Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Auto Layout still required after executing -layoutSubviews. UITextField's implementation of -layoutSubviews needs to call super.'