-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
[feat] 웹뷰 로딩하기
- Loading branch information
Showing
7 changed files
with
472 additions
and
78 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
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,76 @@ | ||
// | ||
// MyPageEditView.swift | ||
// KkuMulKum | ||
// | ||
// Created by 이지훈 on 8/22/24. | ||
// | ||
|
||
import UIKit | ||
|
||
import SnapKit | ||
import Then | ||
|
||
class MyPageEditView: BaseView { | ||
let titleLabel = UILabel().then { | ||
$0.setText("프로필을 설정해 주세요", style: .head01, color: .gray8) | ||
$0.textAlignment = .left | ||
} | ||
|
||
let profileImageView = UIImageView().then { | ||
$0.image = .imgProfile | ||
$0.contentMode = .scaleAspectFill | ||
$0.clipsToBounds = true | ||
} | ||
|
||
let cameraButton = UIButton().then { | ||
$0.setImage(.iconCamera, for: .normal) | ||
$0.tintColor = .white | ||
$0.setLayer(borderWidth: 0, borderColor: .clear, cornerRadius: 15) | ||
} | ||
|
||
let skipButton = UIButton().then { | ||
$0.setTitle("기본 프로필로 설정", style: .body05, color: .gray5) | ||
$0.addUnderline() | ||
} | ||
|
||
let confirmButton = UIButton().then { | ||
$0.setTitle("확인", style: .body03, color: .white) | ||
$0.backgroundColor = .maincolor | ||
$0.setLayer(borderWidth: 0, borderColor: .clear, cornerRadius: 8) | ||
} | ||
|
||
override func setupView() { | ||
backgroundColor = .white | ||
|
||
addSubviews(titleLabel, profileImageView, cameraButton, skipButton, confirmButton) | ||
} | ||
|
||
override func setupAutoLayout() { | ||
titleLabel.snp.makeConstraints { | ||
$0.top.equalTo(safeAreaLayoutGuide).offset(24) | ||
$0.leading.trailing.equalToSuperview().inset(20) | ||
} | ||
|
||
profileImageView.snp.makeConstraints { | ||
$0.top.equalTo(titleLabel.snp.bottom).offset(120) | ||
$0.centerX.equalToSuperview() | ||
$0.size.equalTo(Screen.width(150)) | ||
} | ||
|
||
cameraButton.snp.makeConstraints { | ||
$0.bottom.trailing.equalTo(profileImageView) | ||
$0.size.equalTo(Screen.width(42)) | ||
} | ||
|
||
skipButton.snp.makeConstraints { | ||
$0.bottom.equalTo(confirmButton.snp.top).offset(-20) | ||
$0.centerX.equalToSuperview() | ||
} | ||
|
||
confirmButton.snp.makeConstraints { | ||
$0.bottom.equalTo(safeAreaLayoutGuide).offset(-20) | ||
$0.leading.trailing.equalToSuperview().inset(20) | ||
$0.height.equalTo(Screen.height(50)) | ||
} | ||
} | ||
} |
47 changes: 47 additions & 0 deletions
47
KkuMulKum/Source/MyPage/ViewController/MyPageAskViewController.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,47 @@ | ||
// | ||
// MyPageAskViewController.swift | ||
// KkuMulKum | ||
// | ||
// Created by 이지훈 on 8/22/24. | ||
// | ||
|
||
import UIKit | ||
import WebKit | ||
|
||
class MyPageAskViewController: BaseViewController { | ||
|
||
private let viewModel: MyPageViewModel | ||
private var webView: WKWebView! | ||
|
||
init(viewModel: MyPageViewModel) { | ||
self.viewModel = viewModel | ||
super.init(nibName: nil, bundle: nil) | ||
} | ||
|
||
required init?(coder: NSCoder) { | ||
fatalError("init(coder:) has not been implemented") | ||
} | ||
|
||
override func loadView() { | ||
let webConfiguration = WKWebViewConfiguration() | ||
webView = WKWebView(frame: .zero, configuration: webConfiguration) | ||
webView.uiDelegate = self | ||
view = webView | ||
} | ||
|
||
override func viewDidLoad() { | ||
super.viewDidLoad() | ||
|
||
let myURL = URL(string: "https://docs.google.com/forms/d/e/1FAIpQLSdRR65ARe2M7JxQEAx8vpFz-I8tyEYwlpLwtSnJjniGOapPVQ/viewform") | ||
let myRequest = URLRequest(url: myURL!) | ||
webView.load(myRequest) | ||
} | ||
|
||
override func setupView() { | ||
super.setupView() | ||
setupNavigationBarTitle(with: "문의하기") | ||
setupNavigationBarBackButton() | ||
} | ||
} | ||
|
||
extension MyPageAskViewController: WKUIDelegate {} |
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
47 changes: 47 additions & 0 deletions
47
KkuMulKum/Source/MyPage/ViewController/MyPageTermsViewController.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,47 @@ | ||
// | ||
// MyPageTermsViewController.swift | ||
// KkuMulKum | ||
// | ||
// Created by 이지훈 on 8/22/24. | ||
// | ||
|
||
import UIKit | ||
import WebKit | ||
|
||
class MyPageTermsViewController: BaseViewController { | ||
|
||
private let viewModel: MyPageViewModel | ||
private var webView: WKWebView! | ||
|
||
init(viewModel: MyPageViewModel) { | ||
self.viewModel = viewModel | ||
super.init(nibName: nil, bundle: nil) | ||
} | ||
|
||
required init?(coder: NSCoder) { | ||
fatalError("init(coder:) has not been implemented") | ||
} | ||
|
||
override func loadView() { | ||
let webConfiguration = WKWebViewConfiguration() | ||
webView = WKWebView(frame: .zero, configuration: webConfiguration) | ||
webView.uiDelegate = self | ||
view = webView | ||
} | ||
|
||
override func viewDidLoad() { | ||
super.viewDidLoad() | ||
|
||
let myURL = URL(string: "https://arrow-frog-4b9.notion.site/a66033a3ff4a40bfaa6eff0a5bee737d") | ||
let myRequest = URLRequest(url: myURL!) | ||
webView.load(myRequest) | ||
} | ||
|
||
override func setupView() { | ||
super.setupView() | ||
setupNavigationBarTitle(with: "이용약관") | ||
setupNavigationBarBackButton() | ||
} | ||
} | ||
|
||
extension MyPageTermsViewController: WKUIDelegate {} |
Oops, something went wrong.