tableView:indexPathForCell returns nil

It could be that the cell is not visible at this moment. tableView:indexPathForCell returns nil in this situation. I solved this using indexPathForRowAtPoint this method works even if the cell is not visible. The code: UITableViewCell *cell = textField.superview.superview; NSIndexPath *indexPath = [self.tableView indexPathForRowAtPoint:cell.center];

Triggering a specific action when the app enters foreground from a local notification in iOS? (using swift)

If I want a view controller to be notified when the app is brought back to the foreground, I might just register for the UIApplication.willEnterForegroundNotification notification (bypassing the app delegate method entirely): class ViewController: UIViewController { private var observer: NSObjectProtocol? override func viewDidLoad() { super.viewDidLoad() observer = NotificationCenter.default.addObserver(forName: UIApplication.willEnterForegroundNotification, object: nil, queue: .main) { [unowned … Read more

how to increase font size in UIWebView

I have 2 buttons – A- and A+ @interface NSUInteger textFontSize; – (IBAction)changeTextFontSize:(id)sender { switch ([sender tag]) { case 1: // A- textFontSize = (textFontSize > 50) ? textFontSize -5 : textFontSize; break; case 2: // A+ textFontSize = (textFontSize < 160) ? textFontSize +5 : textFontSize; break; } NSString *jsString = [[NSString alloc] initWithFormat:@”document.getElementsByTagName(‘body’)[0].style.webkitTextSizeAdjust=”%d%%””, … Read more

ITMS-90809: Deprecated API Usage – existing app that use UIWebView are no longer accepted

Yes, Apple did change the policies Are you using ionic? if so, install these: cordova plugin add cordova-plugin-ionic-webview@latest npm install @ionic-native/ionic-webview Then add this to your config.xml under ios platform: <preference name=”WKWebViewOnly” value=”true” /> <feature name=”CDVWKWebViewEngine”>` <param name=”ios-package” value=”CDVWKWebViewEngine” /> </feature> <preference name=”CordovaWebViewEngine” value=”CDVWKWebViewEngine” /> Finally run ionic cordova prepare ios to reflect the changes … Read more

ios8 iPad uiwebview crashes while displaying popover when user taps drop down list HTML select tag

The solution mentioned in the question did not help me, however it did point me in the right direction. After some investigation I would say it’s some sort of race condition between presenting and removing the popover. As a workaround you can postpone the presentation in the delegate of the UIWebView: -(void)presentViewController:(UIViewController *)viewControllerToPresent animated:(BOOL)flag completion:(void … Read more

Force a WebView link to launch Safari?

To expand upon what Randy said, this is what I use in my application to make every http://, https://, and mailto:// URL open in the external Safari or Mail applications: -(BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType; { NSURL *requestURL =[ [ request URL ] retain ]; if ( ( [ [ requestURL scheme ] isEqualToString: @”http” … Read more