Posts

Showing posts with the label iOS 8

Change Status Bar text color in iPhone

Image
Go to --> Info.plist :   1) View controller-based status bar appearance : NO   2) Status bar style : Opaque black style

Scroll UITextField above Keyboard in a UITableView OR UIScrollView in Swift and Objective C

In Objective C -(BOOL)textFieldShouldBeginEditing:(UITextField *)textField {     CGPoint pointInTable = [textField.superview convertPoint:textField.frame.origin toView:_tableview];     CGPoint contentOffset = _tableview.contentOffset;         contentOffset.y = (pointInTable.y - textField.inputAccessoryView.frame.size.height);         NSLog(@"contentOffset is: %@", NSStringFromCGPoint(contentOffset));        [_tableview setContentOffset:contentOffset animated:YES];        return YES; } -(BOOL)textFieldShouldEndEditing:(UITextField *)textField {     [textField resignFirstResponder];        if ([textField.superview.superview isKindOfClass:[UITableViewCell class]])     {         CGPoint buttonPosition = [textField convertPoint:CGPointZero  ...

Check if a string contains another string in iOS 8

NSString * string = @ "hello bla blah" ; if ([ string containsString :@ "bla" ]) { NSLog (@ "string contains bla!" ); } else { NSLog (@ "string does not contain bla" ); }

Xcode 6: keyboard not showing up in ios simulator

Image
Go to--> iOS Simulator -> Hardware -> Keyboard Uncheck "Connect Hardware Keyboard"