Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions TSMiniWebBrowser.podspec
Original file line number Diff line number Diff line change
@@ -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
9 changes: 9 additions & 0 deletions TSMiniWebBrowser/TSMiniWebBrowser.m
Original file line number Diff line number Diff line change
Expand Up @@ -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)]) {
Expand Down Expand Up @@ -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];
Expand Down