Skip to content

Commit

Permalink
Added solution to setApplicationNameForUserAgent:
Browse files Browse the repository at this point in the history
  • Loading branch information
devedbox committed Jul 21, 2016
1 parent b034c09 commit cba4e4f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
4 changes: 2 additions & 2 deletions AXWebViewController.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Pod::Spec.new do |s|
#

s.name = "AXWebViewController"
s.version = "0.2.3"
s.version = "0.2.4"
s.summary = "A light weight web view controller in iOS."

# This description is used to generate tags and improve search results.
Expand Down Expand Up @@ -83,7 +83,7 @@ s.platform = :ios, "7.0"
# Supports git, hg, bzr, svn and HTTP.
#

s.source = { :git => "https://github.com/devedbox/AXWebViewController.git", :tag => "0.2.3" }
s.source = { :git => "https://github.com/devedbox/AXWebViewController.git", :tag => "0.2.4" }


# ――― Source Code ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
Expand Down
8 changes: 6 additions & 2 deletions AXWebViewController/AXWebViewController/AXWebViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -285,8 +285,12 @@ - (WKWebView *)webView {
WKWebViewConfiguration *config = [[WKWebViewConfiguration alloc] init];
config.preferences.minimumFontSize = 9.0;
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_9_0
config.applicationNameForUserAgent = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleDisplayName"];
config.allowsInlineMediaPlayback = YES;
if ([config respondsToSelector:@selector(setApplicationNameForUserAgent:)]) {
[config setApplicationNameForUserAgent:[[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleDisplayName"]];
}
if ([config respondsToSelector:@selector(setAllowsInlineMediaPlayback:)]) {
[config setAllowsInlineMediaPlayback:YES];
}
#endif
_webView = [[WKWebView alloc] initWithFrame:CGRectZero configuration:config];
_webView.allowsBackForwardNavigationGestures = YES;
Expand Down

0 comments on commit cba4e4f

Please sign in to comment.