diff --git a/TSMiniWebBrowser.podspec b/TSMiniWebBrowser.podspec new file mode 100644 index 0000000..b1979b5 --- /dev/null +++ b/TSMiniWebBrowser.podspec @@ -0,0 +1,14 @@ +Pod::Spec.new do |s| + s.name = 'TSMiniWebBrowser' + s.version = '1.0.1' + s.platform = :ios + s.license = 'MIT' + s.summary = 'An in-app web browser control for iOS apps.' + s.homepage = 'https://github.com/tonisalae/TSMiniWebBrowser' + s.author = { 'Toni Sala' => 'tonisalae@gmail.com' } + s.source = { :git => 'https://github.com/neoneye/TSMiniWebBrowser.git', :tag => 'version_1.0.1' } + s.source_files = 'TSMiniWebBrowser/*.{h,m}' + s.framework = 'QuartzCore' + s.requires_arc = true + s.resources = 'TSMiniWebBrowser/TSMiniWebBrowser.bundle', 'TSMiniWebBrowser/localizations', 'TSMiniWebBrowser/*.xib' +end \ No newline at end of file diff --git a/TSMiniWebBrowser/TSMiniWebBrowser.m b/TSMiniWebBrowser/TSMiniWebBrowser.m index 0c8a9f5..f09a4f8 100644 --- a/TSMiniWebBrowser/TSMiniWebBrowser.m +++ b/TSMiniWebBrowser/TSMiniWebBrowser.m @@ -80,7 +80,11 @@ -(void) dismissController { if ( webView.loading ) { [webView stopLoading]; } +#if __IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_5_0 + [self dismissViewControllerAnimated:YES completion:nil]; +#else [self dismissModalViewControllerAnimated:YES]; +#endif // Notify the delegate if (self.delegate != NULL && [self.delegate respondsToSelector:@selector(tsMiniWebBrowserDidDismiss)]) { @@ -191,6 +195,11 @@ -(void) initWebView { webView.scalesPageToFit = YES; webView.delegate = self; + + if (([[[UIDevice currentDevice] systemVersion] compare:@"7.0" options:NSNumericSearch] != NSOrderedAscending)) { + // On iOS7 the webview can be seen through the navigationbar + webView.scrollView.contentInset = UIEdgeInsetsMake(64, 0, 0, 0); + } // Load the URL in the webView NSURLRequest *requestObj = [NSURLRequest requestWithURL:urlToLoad];