-
Notifications
You must be signed in to change notification settings - Fork 160
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
74a124e
commit 634cacd
Showing
5 changed files
with
59 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 0 additions & 15 deletions
15
Dai-Hentai/ViewControllers/CheckPageViewController/CheckPageViewController.h
This file was deleted.
Oops, something went wrong.
50 changes: 0 additions & 50 deletions
50
Dai-Hentai/ViewControllers/CheckPageViewController/CheckPageViewController.m
This file was deleted.
Oops, something went wrong.
53 changes: 53 additions & 0 deletions
53
Dai-Hentai/ViewControllers/CheckPageViewController/CheckPageViewController.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
// | ||
// CheckPageViewController.swift | ||
// Dai-Hentai | ||
// | ||
// Created by DaidoujiChen on 2018/12/10. | ||
// Copyright © 2018 DaidoujiChen. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
import UIKit | ||
|
||
class CheckPageViewController: UIViewController { | ||
|
||
// MARK: - Property | ||
|
||
private let urlString: String | ||
|
||
// MARK: - Life Cycle | ||
|
||
@objc init(urlString: String) { | ||
self.urlString = urlString | ||
super.init(nibName: nil, bundle: nil) | ||
} | ||
|
||
required init?(coder aDecoder: NSCoder) { | ||
fatalError("init(coder:) has not been implemented") | ||
} | ||
|
||
override func viewDidLoad() { | ||
super.viewDidLoad() | ||
initValues() | ||
} | ||
|
||
// MARK: - Private Function | ||
|
||
private func initValues() { | ||
let cancelButton = UIBarButtonItem(barButtonSystemItem: .cancel, target: self, action: #selector(cancelAction)) | ||
navigationItem.rightBarButtonItem = cancelButton | ||
|
||
guard let url = URL(string: urlString) else { | ||
return | ||
} | ||
// 開一個頁面 | ||
let webView = UIWebView(frame: view.bounds) | ||
webView.loadRequest(URLRequest(url: url)) | ||
view.addSubview(webView) | ||
} | ||
|
||
@objc private func cancelAction() { | ||
dismiss(animated: true, completion: nil) | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters