Skip to content

Commit 3d38d43

Browse files
committed
Remove UIWebView
1 parent d8423ee commit 3d38d43

File tree

5 files changed

+44
-173
lines changed

5 files changed

+44
-173
lines changed
Lines changed: 17 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2-
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="6254" systemVersion="14B25" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" initialViewController="rN7-5n-qBa">
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="16096" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" colorMatched="YES" initialViewController="rN7-5n-qBa">
3+
<device id="retina6_1" orientation="portrait" appearance="light"/>
34
<dependencies>
45
<deployment identifier="iOS"/>
5-
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6247"/>
6-
<capability name="Constraints to layout margins" minToolsVersion="6.0"/>
6+
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="16086"/>
7+
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
78
</dependencies>
89
<scenes>
910
<!--View Controller-->
@@ -15,43 +16,43 @@
1516
<viewControllerLayoutGuide type="bottom" id="2fi-mo-0CV"/>
1617
</layoutGuides>
1718
<view key="view" contentMode="scaleToFill" id="kh9-bI-dsS">
18-
<rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
19+
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
1920
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
2021
<subviews>
2122
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="XrB-vd-6Xg">
22-
<rect key="frame" x="94" y="306" width="132" height="30"/>
23+
<rect key="frame" x="141" y="470" width="132" height="30"/>
2324
<state key="normal" title="show action button">
24-
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
25+
<color key="titleShadowColor" red="0.5" green="0.5" blue="0.5" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
2526
</state>
2627
<connections>
2728
<action selector="show2:" destination="vXZ-lx-hvc" eventType="touchUpInside" id="SQQ-oF-Ozh"/>
2829
</connections>
2930
</button>
3031
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="CUn-xZ-2cR">
31-
<rect key="frame" x="137" y="255" width="37" height="30"/>
32+
<rect key="frame" x="184" y="419" width="37" height="30"/>
3233
<state key="normal" title="show">
33-
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
34+
<color key="titleShadowColor" red="0.5" green="0.5" blue="0.5" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
3435
</state>
3536
<connections>
3637
<action selector="show:" destination="vXZ-lx-hvc" eventType="touchUpInside" id="fa5-Oa-Wie"/>
3738
</connections>
3839
</button>
3940
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="XGM-5e-D8s">
40-
<rect key="frame" x="113" y="352" width="85" height="30"/>
41+
<rect key="frame" x="160" y="516" width="85" height="30"/>
4142
<state key="normal" title="arrow image">
42-
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
43+
<color key="titleShadowColor" red="0.5" green="0.5" blue="0.5" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
4344
</state>
4445
<connections>
4546
<action selector="showWithArrowImage:" destination="vXZ-lx-hvc" eventType="touchUpInside" id="dV2-vy-m0m"/>
4647
</connections>
4748
</button>
4849
<textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" placeholder="URL" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="8qF-nt-LQt">
49-
<rect key="frame" x="16" y="212" width="288" height="30"/>
50+
<rect key="frame" x="20" y="374" width="374" height="34"/>
5051
<fontDescription key="fontDescription" type="system" pointSize="14"/>
5152
<textInputTraits key="textInputTraits"/>
5253
</textField>
5354
</subviews>
54-
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
55+
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
5556
<constraints>
5657
<constraint firstAttribute="centerY" secondItem="CUn-xZ-2cR" secondAttribute="centerY" constant="14" id="8kA-83-yxi"/>
5758
<constraint firstItem="8qF-nt-LQt" firstAttribute="leading" secondItem="kh9-bI-dsS" secondAttribute="leadingMargin" id="DZi-8j-Kbq"/>
@@ -72,15 +73,15 @@
7273
</viewController>
7374
<placeholder placeholderIdentifier="IBFirstResponder" id="x5A-6p-PRh" sceneMemberID="firstResponder"/>
7475
</objects>
75-
<point key="canvasLocation" x="1789" y="521"/>
76+
<point key="canvasLocation" x="2592.753623188406" y="348.88392857142856"/>
7677
</scene>
7778
<!--Navigation Controller-->
7879
<scene sceneID="wHR-h9-bFF">
7980
<objects>
8081
<navigationController automaticallyAdjustsScrollViewInsets="NO" id="rN7-5n-qBa" sceneMemberID="viewController">
8182
<toolbarItems/>
8283
<navigationBar key="navigationBar" contentMode="scaleToFill" id="teO-LE-H5Y">
83-
<rect key="frame" x="0.0" y="0.0" width="320" height="44"/>
84+
<rect key="frame" x="0.0" y="44" width="414" height="44"/>
8485
<autoresizingMask key="autoresizingMask"/>
8586
</navigationBar>
8687
<nil name="viewControllers"/>
@@ -90,12 +91,7 @@
9091
</navigationController>
9192
<placeholder placeholderIdentifier="IBFirstResponder" id="i1c-eh-eqE" userLabel="First Responder" sceneMemberID="firstResponder"/>
9293
</objects>
93-
<point key="canvasLocation" x="1257" y="521"/>
94+
<point key="canvasLocation" x="1821.7391304347827" y="348.88392857142856"/>
9495
</scene>
9596
</scenes>
96-
<simulatedMetricsContainer key="defaultSimulatedMetrics">
97-
<simulatedStatusBarMetrics key="statusBar"/>
98-
<simulatedOrientationMetrics key="orientation"/>
99-
<simulatedScreenMetrics key="destination" type="retina4"/>
100-
</simulatedMetricsContainer>
10197
</document>

Example/M2DWebViewController/M2DViewController.m

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ - (IBAction)show:(id)sender
3939
else {
4040
url = [NSURL URLWithString:@"https://github.com/0x0c/M2DWebViewController"];
4141
}
42-
M2DWebViewController *viewController = [[M2DWebViewController alloc] initWithURL:url type:M2DWebViewTypeWebKit];
42+
M2DWebViewController *viewController = [[M2DWebViewController alloc] initWithURL:url];
4343
viewController.delegate = self;
4444
NSLog(@"%@", [viewController.webView description]);
4545
[self.navigationController pushViewController:viewController animated:YES];
@@ -54,7 +54,7 @@ - (IBAction)show2:(id)sender
5454
else {
5555
url = [NSURL URLWithString:@"https://github.com/0x0c/M2DWebViewController"];
5656
}
57-
M2DWebViewController *viewController = [[M2DWebViewController alloc] initWithURL:url type:M2DWebViewTypeUIKit];
57+
M2DWebViewController *viewController = [[M2DWebViewController alloc] initWithURL:url];
5858
viewController.delegate = self;
5959
__weak typeof(viewController) bviewcontroller = viewController;
6060
viewController.actionButtonPressedHandler = ^(NSString *pageTitle, NSURL *url){
@@ -94,7 +94,7 @@ - (IBAction)showWithArrowImage:(id)sender
9494
else {
9595
url = [NSURL URLWithString:@"https://github.com/0x0c/M2DWebViewController"];
9696
}
97-
M2DWebViewController *viewController = [[M2DWebViewController alloc] initWithURL:url type:M2DWebViewTypeUIKit backArrowImage:icon forwardArrowImage:icon];
97+
M2DWebViewController *viewController = [[M2DWebViewController alloc] initWithURL:url backArrowImage:icon forwardArrowImage:icon];
9898
[self.navigationController pushViewController:viewController animated:YES];
9999
}
100100

M2DWebViewController.podspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@
99

1010
Pod::Spec.new do |s|
1111
s.name = "M2DWebViewController"
12-
s.version = "0.2.6"
12+
s.version = "1.0.0"
1313
s.summary = "Simple built-in web view controller."
1414
s.homepage = "https://github.com/0x0c/M2DWebViewController"
1515
s.license = 'MIT'
1616
s.author = { "Akira Matsuda" => "[email protected]" }
1717
s.source = { :git => "https://github.com/0x0c/M2DWebViewController.git", :tag => s.version.to_s }
1818
s.screenshots = "https://raw.github.com/0x0c/M2DWebViewController/master/images/1.png", "https://raw.github.com/0x0c/M2DWebViewController/master/images/2.png", "https://raw.github.com/0x0c/M2DWebViewController/master/images/3.png"
1919

20-
s.platform = :ios, '7.0'
20+
s.platform = :ios, '8.0'
2121
s.requires_arc = true
2222

2323
s.source_files = 'Pod/Classes/**/*.{h,m}'

Pod/Classes/M2DWebViewController/M2DWebViewController.h

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,7 @@
88

99
#import <UIKit/UIKit.h>
1010
#import <QuartzCore/QuartzCore.h>
11-
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_8_0
1211
#import <WebKit/WebKit.h>
13-
#endif
1412

1513
@protocol M2DWebViewControllerDelegate <NSObject>
1614
@optional
@@ -37,36 +35,20 @@
3735
- (void)m2d_webView:(WKWebView * _Nonnull)webView didReceiveAuthenticationChallenge:(NSURLAuthenticationChallenge * _Nonnull)challenge completionHandler:(void (^ _Nonnull)(NSURLSessionAuthChallengeDisposition disposition, NSURLCredential * _Nullable credential))completionHandler;
3836
- (void)m2d_webViewWebContentProcessDidTerminate:(WKWebView * _Nonnull)webView API_AVAILABLE(macosx(10.11), ios(9.0));
3937

40-
// UIWebViewDelegate
41-
- (BOOL)m2d_webView:(UIWebView * _Nonnull)webView shouldStartLoadWithRequest:(NSURLRequest * _Nonnull)request navigationType:(UIWebViewNavigationType)navigationType;
42-
- (void)m2d_webViewDidFinishLoad:(UIWebView * _Nonnull)webView;
43-
- (void)m2d_webViewDidStartLoad:(UIWebView * _Nonnull)webView;
44-
- (void)m2d_webView:(UIWebView * _Nonnull)webView didFailLoadWithError:(NSError * _Nullable)error;
45-
4638
@end
4739

4840
@class M2DWebViewController;
4941

50-
typedef NS_ENUM(NSUInteger, M2DWebViewType) {
51-
M2DWebViewTypeUIKit,
52-
M2DWebViewTypeWebKit,
53-
M2DWebViewTypeAutoSelect
54-
};
55-
56-
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_8_0
57-
@interface M2DWebViewController : UIViewController <WKUIDelegate, WKNavigationDelegate, UIWebViewDelegate>
58-
#else
59-
@interface M2DWebViewController : UIViewController <UIWebViewDelegate>
60-
#endif
42+
@interface M2DWebViewController : UIViewController <WKUIDelegate, WKNavigationDelegate>
6143

6244
@property (nonatomic, readonly) id _Nullable webView;
6345
@property (nonatomic, assign) BOOL toolbarHidden;
6446
@property (nonatomic, assign) BOOL smoothScroll;
6547
@property (nonatomic, weak) id<M2DWebViewControllerDelegate> _Nullable delegate;
6648
@property (nonatomic, copy) void (^_Nonnull actionButtonPressedHandler)(NSString * _Nullable pageTitle, NSURL * _Nullable url);
6749

68-
- (instancetype _Nonnull)initWithURL:(NSURL * _Nullable)url type:(M2DWebViewType)type;
69-
- (instancetype _Nonnull)initWithURL:(NSURL * _Nullable)url type:(M2DWebViewType)type backArrowImage:(UIImage * _Nullable)backArrowImage forwardArrowImage:(UIImage * _Nullable)forwardArrowImage;
50+
- (instancetype _Nonnull)initWithURL:(NSURL * _Nullable)url;
51+
- (instancetype _Nonnull)initWithURL:(NSURL * _Nullable)url backArrowImage:(UIImage * _Nullable)backArrowImage forwardArrowImage:(UIImage * _Nullable)forwardArrowImage;
7052
- (instancetype _Nonnull)initWithConfiguration:(WKWebViewConfiguration * _Nonnull)configuration url:(NSURL * _Nullable)url;
7153
- (instancetype _Nonnull)initWithConfiguration:(WKWebViewConfiguration * _Nonnull)configuration url:(NSURL * _Nullable)url backArrowImage:(UIImage * _Nullable)backArrowImage forwardArrowImage:(UIImage * _Nullable)forwardArrowImage;
7254
- (void)goForward:(id _Nonnull)sender;

0 commit comments

Comments
 (0)