Skip to content

Commit 645d0f3

Browse files
author
Jasper
committed
新增WebViewController
1 parent ba383ff commit 645d0f3

File tree

11 files changed

+416
-16
lines changed

11 files changed

+416
-16
lines changed

CYUtilProject/.DS_Store

0 Bytes
Binary file not shown.

CYUtilProjectSwift/CYUtilProjectSwift/CYUtilProjectSwift.xcodeproj/project.pbxproj

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@
3131
A3636A9E1ED2C77800B0F8E9 /* CycleBannerTestViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A3636A9D1ED2C77800B0F8E9 /* CycleBannerTestViewController.swift */; };
3232
A3636AAC1ED31E7600B0F8E9 /* RedPacketViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A3636AAB1ED31E7600B0F8E9 /* RedPacketViewController.swift */; };
3333
A3636B0B1ED52BAA00B0F8E9 /* RedPacketAssets.bundle in Resources */ = {isa = PBXBuildFile; fileRef = A3636B0A1ED52BAA00B0F8E9 /* RedPacketAssets.bundle */; };
34+
A371504B1F385C020079E9C5 /* WebViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A371504A1F385C020079E9C5 /* WebViewController.swift */; };
35+
A371504D1F3875350079E9C5 /* WebViewProgress.swift in Sources */ = {isa = PBXBuildFile; fileRef = A371504C1F3875350079E9C5 /* WebViewProgress.swift */; };
3436
A37D5B461ED7036200A63AB9 /* SendRedPacketViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A37D5B451ED7036200A63AB9 /* SendRedPacketViewController.swift */; };
3537
A37D5B481ED7037500A63AB9 /* SendRedPacketView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A37D5B471ED7037500A63AB9 /* SendRedPacketView.swift */; };
3638
A38580201DEFCFA800FF989F /* CYLineProgressBar.swift in Sources */ = {isa = PBXBuildFile; fileRef = A385801F1DEFCFA800FF989F /* CYLineProgressBar.swift */; };
@@ -84,6 +86,8 @@
8486
A3636A9D1ED2C77800B0F8E9 /* CycleBannerTestViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CycleBannerTestViewController.swift; sourceTree = "<group>"; };
8587
A3636AAB1ED31E7600B0F8E9 /* RedPacketViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RedPacketViewController.swift; sourceTree = "<group>"; };
8688
A3636B0A1ED52BAA00B0F8E9 /* RedPacketAssets.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; path = RedPacketAssets.bundle; sourceTree = "<group>"; };
89+
A371504A1F385C020079E9C5 /* WebViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WebViewController.swift; sourceTree = "<group>"; };
90+
A371504C1F3875350079E9C5 /* WebViewProgress.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WebViewProgress.swift; sourceTree = "<group>"; };
8791
A37D5B451ED7036200A63AB9 /* SendRedPacketViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SendRedPacketViewController.swift; sourceTree = "<group>"; };
8892
A37D5B471ED7037500A63AB9 /* SendRedPacketView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SendRedPacketView.swift; sourceTree = "<group>"; };
8993
A385801F1DEFCFA800FF989F /* CYLineProgressBar.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CYLineProgressBar.swift; sourceTree = "<group>"; };
@@ -161,6 +165,7 @@
161165
61091D6F1CDAFCB0008B7EA3 /* CYUtils */ = {
162166
isa = PBXGroup;
163167
children = (
168+
A37150491F385BF40079E9C5 /* WebViewController */,
164169
A32F8C991F31C095003BA93B /* FloatingView */,
165170
A3D086F91EEE3B17007752ED /* HerizontalTable */,
166171
A3636A861ED28FA600B0F8E9 /* CycleBanner */,
@@ -259,6 +264,15 @@
259264
path = CycleBanner;
260265
sourceTree = "<group>";
261266
};
267+
A37150491F385BF40079E9C5 /* WebViewController */ = {
268+
isa = PBXGroup;
269+
children = (
270+
A371504A1F385C020079E9C5 /* WebViewController.swift */,
271+
A371504C1F3875350079E9C5 /* WebViewProgress.swift */,
272+
);
273+
path = WebViewController;
274+
sourceTree = "<group>";
275+
};
262276
A385A69C1ED138810022C2EB /* CYRedPacketUI */ = {
263277
isa = PBXGroup;
264278
children = (
@@ -431,6 +445,7 @@
431445
A32F8C9F1F31CBC2003BA93B /* FloatingViewTestViewController.swift in Sources */,
432446
A3CCAF331D17A57900A40969 /* CYJSParametersSerialization.swift in Sources */,
433447
61091D5E1CDAF8E4008B7EA3 /* AppDelegate.swift in Sources */,
448+
A371504B1F385C020079E9C5 /* WebViewController.swift in Sources */,
434449
A306D5631CE330A8008341F3 /* CYAlertViewAction.swift in Sources */,
435450
A385A6A31ED13C220022C2EB /* CYRedPacketOpenView.swift in Sources */,
436451
A3D086FB1EEE3B30007752ED /* HerizontalTableView.swift in Sources */,
@@ -444,6 +459,7 @@
444459
A385A6A51ED150C40022C2EB /* CYRedPacketDetailHeaderView.swift in Sources */,
445460
A385A6AC1ED16A8E0022C2EB /* CYRedPacketViewModel.swift in Sources */,
446461
A34F17F11EF8B78200538F20 /* HerizontalTableViewTestViewController.swift in Sources */,
462+
A371504D1F3875350079E9C5 /* WebViewProgress.swift in Sources */,
447463
A3636A8A1ED297D200B0F8E9 /* CycleBannerViewItem.swift in Sources */,
448464
A33913CE1CF3EE4400C8C147 /* Dictionary+CYUtils.swift in Sources */,
449465
A3B700981E1B449C00823B7B /* CYProgressWebView.swift in Sources */,

CYUtilProjectSwift/CYUtilProjectSwift/CYUtilProjectSwift/Base.lproj/Main.storyboard

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,23 @@
121121
</subviews>
122122
</tableViewCellContentView>
123123
</tableViewCell>
124+
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" id="JFB-ij-Ob7">
125+
<rect key="frame" x="0.0" y="220" width="375" height="44"/>
126+
<autoresizingMask key="autoresizingMask"/>
127+
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="JFB-ij-Ob7" id="Lvc-u0-Plu">
128+
<rect key="frame" x="0.0" y="0.0" width="375" height="44"/>
129+
<autoresizingMask key="autoresizingMask"/>
130+
<subviews>
131+
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="WebViewController" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="hcX-Ob-Ktj">
132+
<rect key="frame" x="24" y="11" width="323" height="21"/>
133+
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
134+
<fontDescription key="fontDescription" type="system" pointSize="17"/>
135+
<nil key="textColor"/>
136+
<nil key="highlightedColor"/>
137+
</label>
138+
</subviews>
139+
</tableViewCellContentView>
140+
</tableViewCell>
124141
</cells>
125142
</tableViewSection>
126143
</sections>

CYUtilProjectSwift/CYUtilProjectSwift/CYUtilProjectSwift/Info.plist

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,5 +43,93 @@
4343
<string>UIInterfaceOrientationLandscapeLeft</string>
4444
<string>UIInterfaceOrientationLandscapeRight</string>
4545
</array>
46+
47+
<key>NSAppTransportSecurity</key>
48+
<dict>
49+
<key>NSAllowsArbitraryLoads</key>
50+
<true/>
51+
<key>NSAllowsArbitraryLoadsInWebContent</key>
52+
<true/>
53+
<key>NSExceptionDomains</key>
54+
<dict>
55+
<key>sina.cn</key>
56+
<dict>
57+
<key>NSIncludesSubdomains</key>
58+
<true/>
59+
<key>NSThirdPartyExceptionRequiresForwardSecrecy</key>
60+
<false/>
61+
</dict>
62+
<key>sina.com.cn</key>
63+
<dict>
64+
<key>NSIncludesSubdomains</key>
65+
<true/>
66+
<key>NSThirdPartyExceptionAllowsInsecureHTTPLoads</key>
67+
<true/>
68+
<key>NSThirdPartyExceptionRequiresForwardSecrecy</key>
69+
<false/>
70+
</dict>
71+
<key>sinaimg.cn</key>
72+
<dict>
73+
<key>NSIncludesSubdomains</key>
74+
<true/>
75+
<key>NSThirdPartyExceptionAllowsInsecureHTTPLoads</key>
76+
<true/>
77+
<key>NSThirdPartyExceptionRequiresForwardSecrecy</key>
78+
<false/>
79+
</dict>
80+
<key>sinajs.cn</key>
81+
<dict>
82+
<key>NSIncludesSubdomains</key>
83+
<true/>
84+
<key>NSThirdPartyExceptionAllowsInsecureHTTPLoads</key>
85+
<true/>
86+
<key>NSThirdPartyExceptionRequiresForwardSecrecy</key>
87+
<false/>
88+
</dict>
89+
<key>umeng.co</key>
90+
<dict>
91+
<key>NSExceptionAllowsInsecureHTTPLoads</key>
92+
<true/>
93+
<key>NSIncludesSubdomains</key>
94+
<true/>
95+
<key>NSThirdPartyExceptionRequiresForwardSecrecy</key>
96+
<false/>
97+
</dict>
98+
<key>weibo.cn</key>
99+
<dict>
100+
<key>NSIncludesSubdomains</key>
101+
<true/>
102+
<key>NSThirdPartyExceptionRequiresForwardSecrecy</key>
103+
<false/>
104+
</dict>
105+
<key>weibo.com</key>
106+
<dict>
107+
<key>NSIncludesSubdomains</key>
108+
<true/>
109+
<key>NSThirdPartyExceptionAllowsInsecureHTTPLoads</key>
110+
<true/>
111+
<key>NSThirdPartyExceptionRequiresForwardSecrecy</key>
112+
<false/>
113+
</dict>
114+
<key>xiaoniuapp-agreement-test.oss-cn-shenzhen.aliyuncs.com</key>
115+
<dict>
116+
<key>NSIncludesSubdomains</key>
117+
<true/>
118+
<key>NSThirdPartyExceptionAllowsInsecureHTTPLoads</key>
119+
<true/>
120+
<key>NSThirdPartyExceptionRequiresForwardSecrecy</key>
121+
<false/>
122+
</dict>
123+
<key>xiaoniuapp.com</key>
124+
<dict>
125+
<key>NSIncludesSubdomains</key>
126+
<true/>
127+
<key>NSThirdPartyExceptionAllowsInsecureHTTPLoads</key>
128+
<true/>
129+
<key>NSThirdPartyExceptionRequiresForwardSecrecy</key>
130+
<false/>
131+
</dict>
132+
</dict>
133+
</dict>
46134
</dict>
47135
</plist>

CYUtilProjectSwift/CYUtilProjectSwift/CYUtilProjectSwift/Test/FloatingViewTestViewController.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import UIKit
1111
class FloatingViewTestViewController: UIViewController {
1212

1313
var floatingView: FloatingView?
14+
var test: Any?
1415

1516
override func viewDidLoad() {
1617
super.viewDidLoad()

CYUtilProjectSwift/CYUtilProjectSwift/CYUtilProjectSwift/ViewController.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,10 @@ class ViewController: UITableViewController {
158158
navigationController?.pushViewController(HerizontalTableViewTestViewController(), animated: true)
159159
} else if indexPath.row == 4 {
160160
navigationController?.pushViewController(FloatingViewTestViewController(), animated: true)
161+
} else if indexPath.row == 5 {
162+
let web = WebViewController()
163+
_ = web.load(URLRequest(url: URL(string: "http://www.qq.com")!))
164+
navigationController?.pushViewController(web, animated: true)
161165
}
162166
}
163167
}

CYUtilProjectSwift/CYUtilProjectSwift/CYUtils/CYJSONUtils/CYJSONUtils.swift

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

99
import Foundation
1010

11-
class CYJSONUtils {
11+
public class CYJSONUtils {
1212

1313
// data from JSONObject, transfer object to json data
14-
static func dataFromJSONObject(_ JSONObject: AnyObject) -> Data? {
14+
public static func dataFromJSONObject(_ JSONObject: AnyObject) -> Data? {
1515

1616
if JSONSerialization.isValidJSONObject(JSONObject) {
1717

@@ -27,7 +27,7 @@ class CYJSONUtils {
2727
return nil
2828
}
2929

30-
static func stringFromJSONObject(_ JSONObject: AnyObject) -> String? {
30+
public static func stringFromJSONObject(_ JSONObject: AnyObject) -> String? {
3131

3232
if let JSONData = self.dataFromJSONObject(JSONObject) {
3333

@@ -38,7 +38,7 @@ class CYJSONUtils {
3838

3939

4040
// JSON Object from data
41-
static func JSONObjectFromData(_ data: Data) -> AnyObject? {
41+
public static func JSONObjectFromData(_ data: Data) -> AnyObject? {
4242

4343
do {
4444

@@ -51,7 +51,7 @@ class CYJSONUtils {
5151
return nil
5252
}
5353

54-
static func dictionaryFromJSONData(_ data: Data) -> [String : AnyObject]? {
54+
public static func dictionaryFromJSONData(_ data: Data) -> [String : AnyObject]? {
5555

5656
if let JSONObject = self.JSONObjectFromData(data) {
5757

@@ -60,7 +60,7 @@ class CYJSONUtils {
6060
return nil
6161
}
6262

63-
static func arrayFromJSONData(_ data: Data) -> [AnyObject]? {
63+
public static func arrayFromJSONData(_ data: Data) -> [AnyObject]? {
6464

6565
if let JSONObject = self.JSONObjectFromData(data) {
6666

@@ -70,7 +70,7 @@ class CYJSONUtils {
7070
}
7171

7272
// JSON Object from String, must UTF8 encoding string, otherwise use JSONObjectFromData
73-
static func JSONObjectFromString(_ JSONString: String) -> AnyObject? {
73+
public static func JSONObjectFromString(_ JSONString: String) -> AnyObject? {
7474

7575
if let data = JSONString.data(using: String.Encoding.utf8) {
7676

@@ -79,7 +79,7 @@ class CYJSONUtils {
7979
return nil
8080
}
8181

82-
static func dictionaryFromJSONString(_ JSONString: String) -> [String : AnyObject]? {
82+
public static func dictionaryFromJSONString(_ JSONString: String) -> [String : AnyObject]? {
8383

8484
if let data = JSONString.data(using: String.Encoding.utf8) {
8585

@@ -88,7 +88,7 @@ class CYJSONUtils {
8888
return nil
8989
}
9090

91-
static func arrayFromJSONString(_ JSONString: String) -> [AnyObject]? {
91+
public static func arrayFromJSONString(_ JSONString: String) -> [AnyObject]? {
9292

9393
if let data = JSONString.data(using: String.Encoding.utf8) {
9494

CYUtilProjectSwift/CYUtilProjectSwift/CYUtils/CYProgressWeb/CYProgressWebViewController.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ class CYProgressWebViewController: UIViewController, UIWebViewDelegate {
5454
override func viewDidLoad() {
5555
super.viewDidLoad()
5656

57-
let barTextAttributesNormal = UIBarButtonItem.appearance().titleTextAttributes(for: .normal)
58-
let barTextAttributesHighlighted = UIBarButtonItem.appearance().titleTextAttributes(for: .highlighted)
57+
// let barTextAttributesNormal = UIBarButtonItem.appearance().titleTextAttributes(for: .normal)
58+
// let barTextAttributesHighlighted = UIBarButtonItem.appearance().titleTextAttributes(for: .highlighted)
5959
// let backColor
6060

6161
// 返回按钮

CYUtilProjectSwift/CYUtilProjectSwift/CYUtils/CycleBanner/CycleBannerViewItem.swift

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,4 @@ public class CycleBannerViewItem: UIView {
6868
}
6969
}
7070

71-
override public func layoutSubviews() {
72-
73-
super.layoutSubviews()
74-
}
75-
7671
}

0 commit comments

Comments
 (0)