-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FEAT] #168 - 공유하기 뷰 구현 #186
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
0801071
[FEAT] #168 - 공유하기 뷰 생성
dlwns33 c678f63
[FEAT] #168 - QR이미지 추가
dlwns33 056375b
[FEAT] #168 - ID label 스택뷰 UI
dlwns33 4b8db7f
[FEAT] #168 - stackView 수정
dlwns33 cbb7e95
[FEAT] #168 - 토스트메세지 함수 수정
dlwns33 58739a3
[FEAT] #168 - 갤러리 추가 toast
dlwns33 98a4bae
[FEAT] #168 - 공유버튼 누르면 바텀시트로 notification
dlwns33 37a9007
[FEAT] #168 - notification const에 추가
dlwns33 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
23 changes: 23 additions & 0 deletions
23
NADA-iOS-forRelease/Resouces/Assets/Assets.xcassets/qrCodeImg21.imageset/Contents.json
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,23 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"filename" : "qrCodeImg21.png", | ||
"scale" : "1x", | ||
"idiom" : "universal" | ||
}, | ||
{ | ||
"filename" : "qrCodeImg21@2x.png", | ||
"scale" : "2x", | ||
"idiom" : "universal" | ||
}, | ||
{ | ||
"filename" : "qrCodeImg21@3x.png", | ||
"scale" : "3x", | ||
"idiom" : "universal" | ||
} | ||
], | ||
"info" : { | ||
"version" : 1, | ||
"author" : "xcode" | ||
} | ||
} |
Binary file added
BIN
+1.58 KB
...forRelease/Resouces/Assets/Assets.xcassets/qrCodeImg21.imageset/qrCodeImg21.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+1.94 KB
...Release/Resouces/Assets/Assets.xcassets/qrCodeImg21.imageset/qrCodeImg21@2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+2.21 KB
...Release/Resouces/Assets/Assets.xcassets/qrCodeImg21.imageset/qrCodeImg21@3x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
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
119 changes: 119 additions & 0 deletions
119
...S-forRelease/Sources/ViewControllers/BottomSheet/CardShareBottomSheetViewController.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,119 @@ | ||
// | ||
// CardShareBottomSheetViewController.swift | ||
// NADA-iOS-forRelease | ||
// | ||
// Created by Yi Joon Choi on 2021/12/21. | ||
// | ||
|
||
import UIKit | ||
|
||
class CardShareBottomSheetViewController: CommonBottomSheetViewController { | ||
|
||
// MARK: - Properties | ||
var cardID: String? = "1D856A" | ||
|
||
private let qrImage: UIImageView = { | ||
// 여기를 만든 QR이미지로 바꿔주시면 됩니당 | ||
let imageView = UIImageView() | ||
imageView.image = UIImage(named: "qrCodeImg21") | ||
|
||
return imageView | ||
}() | ||
|
||
private let idTitleLabel: UILabel = { | ||
let label = UILabel() | ||
label.text = "ID" | ||
label.textColor = .secondary | ||
label.font = .title01 | ||
|
||
return label | ||
}() | ||
|
||
private let idLabel: UILabel = { | ||
let label = UILabel() | ||
label.textColor = .secondary | ||
label.font = .textRegular01 | ||
|
||
return label | ||
}() | ||
|
||
private let copyButton: UIButton = { | ||
let button = UIButton() | ||
button.setImage(UIImage(named: "iconCopy"), for: .normal) | ||
button.addTarget(self, action: #selector(copyId), for: .touchUpInside) | ||
|
||
return button | ||
}() | ||
|
||
private let idStackView: UIStackView = { | ||
let stackView = UIStackView() | ||
stackView.axis = .horizontal | ||
stackView.spacing = 10 | ||
stackView.distribution = .fill | ||
return stackView | ||
}() | ||
|
||
private let saveAsImageButton: UIButton = { | ||
let button = UIButton() | ||
button.setImage(UIImage(named: "buttonShareImg"), for: .normal) | ||
button.addTarget(self, action: #selector(saveAsImage), for: .touchUpInside) | ||
|
||
return button | ||
}() | ||
|
||
// MARK: - View Life Cycle | ||
override func viewDidLoad() { | ||
super.viewDidLoad() | ||
setupUI() | ||
} | ||
|
||
// MARK: - @Functions | ||
// UI 세팅 작업 | ||
private func setupUI() { | ||
idStackView.addArrangedSubview(idTitleLabel) | ||
idStackView.addArrangedSubview(idLabel) | ||
idStackView.addArrangedSubview(copyButton) | ||
|
||
view.addSubview(qrImage) | ||
view.addSubview(idStackView) | ||
view.addSubview(saveAsImageButton) | ||
|
||
idLabel.text = cardID | ||
|
||
setupLayout() | ||
} | ||
|
||
// 레이아웃 세팅 | ||
private func setupLayout() { | ||
qrImage.translatesAutoresizingMaskIntoConstraints = false | ||
NSLayoutConstraint.activate([ | ||
qrImage.topAnchor.constraint(equalTo: titleLabel.bottomAnchor, constant: 8), | ||
qrImage.centerXAnchor.constraint(equalTo: bottomSheetView.centerXAnchor), | ||
qrImage.widthAnchor.constraint(equalToConstant: 160), | ||
qrImage.heightAnchor.constraint(equalToConstant: 160) | ||
]) | ||
|
||
idStackView.translatesAutoresizingMaskIntoConstraints = false | ||
NSLayoutConstraint.activate([ | ||
idStackView.topAnchor.constraint(equalTo: qrImage.bottomAnchor, constant: 9), | ||
idStackView.centerXAnchor.constraint(equalTo: bottomSheetView.centerXAnchor) | ||
]) | ||
|
||
saveAsImageButton.translatesAutoresizingMaskIntoConstraints = false | ||
NSLayoutConstraint.activate([ | ||
saveAsImageButton.topAnchor.constraint(equalTo: idStackView.bottomAnchor, constant: 32), | ||
saveAsImageButton.centerXAnchor.constraint(equalTo: bottomSheetView.centerXAnchor), | ||
saveAsImageButton.leadingAnchor.constraint(equalTo: view.leadingAnchor, constant: 107) | ||
]) | ||
} | ||
|
||
@objc func copyId() { | ||
UIPasteboard.general.string = cardID | ||
showToast(message: "명함 아이디가 복사되었습니다.", font: UIFont.button02, view: "copyID") | ||
} | ||
|
||
@objc func saveAsImage() { | ||
showToast(message: "갤러리에 저장되었습니다.", font: UIFont.button02, view: "saveImage") | ||
} | ||
|
||
} |
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍🏻