Skip to content
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

๐Ÿ”€ :: ๊ฒ€์ƒ‰ ์ „ > ํ”Œ๋ ˆ์ด ๋ฆฌ์ŠคํŠธ UI ์งค๋ฆผ ์ˆ˜์ • #386

Merged
merged 3 commits into from
Nov 14, 2023
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ extension TextPopupViewController {
let paragraphStyle = NSMutableParagraphStyle()
paragraphStyle.lineHeightMultiple = 1.3
paragraphStyle.alignment = .center
paragraphStyle.lineBreakStrategy = .hangulWordPriority

let contentAttributedString = NSMutableAttributedString(
string: contentString,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ public final class BeforeSearchContentViewController: BaseViewController,ViewCon
extension BeforeSearchContentViewController {
private func configureUI() {
self.tableView.backgroundColor = DesignSystemAsset.GrayColor.gray100.color
self.tableView.tableFooterView = UIView(frame: .init(x: 0, y: 0, width: APP_WIDTH(), height: PLAYER_HEIGHT()))
self.tableView.scrollIndicatorInsets = UIEdgeInsets(top: 0, left: 0, bottom: PLAYER_HEIGHT(), right: 0)
self.indicator.type = .circleStrokeSpin
self.indicator.color = DesignSystemAsset.PrimaryColor.point.color
self.indicator.startAnimating()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import DataMappingModule
import MessageUI
import CommonFeature
import SafariServices

public final class QuestionViewController: BaseViewController,ViewControllerFromStoryBoard {

Expand Down Expand Up @@ -165,7 +166,7 @@
}
}

private func bindRx(){

Check warning on line 169 in Projects/Features/StorageFeature/Sources/ViewControllers/QuestionViewController.swift

View workflow job for this annotation

GitHub Actions / SwiftLint

Cyclomatic Complexity Violation: Function should have complexity 10 or less; currently complexity is 13 (cyclomatic_complexity)
closeButton.rx.tap
.subscribe(onNext: { [weak self] in
self?.dismiss(animated: true)
Expand Down Expand Up @@ -239,34 +240,35 @@
)
imageViews[i].isHidden = i == index ? false : true
superViews[i].layer.borderColor = i == index ? self.selectedColor.cgColor : self.unSelectedColor.cgColor
superViews[i].addShadow(offset: CGSize(width: 0, height: 2),color: colorFromRGB("080F34"),opacity: i == index ? 0.08 : 0)
superViews[i].addShadow(offset: CGSize(width: 0, height: 2), color: colorFromRGB("080F34"), opacity: i == index ? 0.08 : 0)
}
})
.disposed(by: disposeBag)

nextButton.rx.tap
.withLatestFrom(output.mailSource)
.filter { $0 != .unknown }
.subscribe(onNext: { [weak self] in
guard let self = self else {
return
}

if MFMailComposeViewController.canSendMail() {
let compseVC = MFMailComposeViewController()
compseVC.mailComposeDelegate = self
compseVC.setToRecipients([$0.receiver])
compseVC.setSubject($0.title)
compseVC.setMessageBody($0.body + $0.suffix, isHTML: false)
self.present(compseVC, animated: true, completion: nil)

}else {
let vc = TextPopupViewController.viewController(
text: "๋ฉ”์ผ ๊ณ„์ •์ด ์„ค์ •๋˜์–ด ์žˆ์ง€ ์•Š์Šต๋‹ˆ๋‹ค.\n์„ค์ • > Mail ์•ฑ > ๊ณ„์ •์„ ์„ค์ •ํ•ด์ฃผ์„ธ์š”.",
cancelButtonIsHidden: true,
confirmButtonText: "ํ™•์ธ"
.subscribe(onNext: { [weak self] (source) in
guard let self = self else { return }
if source == .addSong {
let link: String = "https://whimsical.com/E3GQxrTaafVVBrhm55BNBS"
let textPopup = TextPopupViewController.viewController(
text: "ยท ์ด์„ธ๋Œ ๋ถ„๋“ค์ด ๋ถ€๋ฅด์‹  ๊ฑธ ์ดํŒŒ๋ฆฌ๋ถ„๋“ค์ด ๊ฐœ์ธ ์†Œ์žฅ์šฉ์œผ๋กœ ์ผ๋ถ€ ๊ณต๊ฐœํ•œ ์˜์ƒ์„ ์˜ฌ๋ฆฌ๊ธธ ์›ํ•˜์‹œ๋ฉด โ€˜์€์ˆ˜์ €โ€™ ๋‹˜์—๊ฒŒ ์™๋ฌผ์› ์ฑ„ํŒ…์œผ๋กœ ๋ถ€ํƒ๋“œ๋ฆฝ๋‹ˆ๋‹ค.\nยท ์™๋ฎค์— ๋“ค์–ด๊ฐˆ ์ˆ˜ ์žˆ๋Š” ๊ธฐ์ค€์„ ์ถฉ์กฑํ•˜๋Š”์ง€ ๊ผญ ํ™•์ธํ•˜์‹œ๊ณ  ์ถ”๊ฐ€ ์š”์ฒญํ•ด ์ฃผ์„ธ์š”.",
cancelButtonIsHidden: false,
confirmButtonText: "๋‹ค์Œ",
cancelButtonText: "์ถฉ์กฑ ๊ธฐ์ค€ ๋ณด๊ธฐ",
completion: {
self.goToMail(source: source)
},
cancelCompletion: {
guard let URL = URL(string: link) else { return }
let safari = SFSafariViewController(url: URL)
self.present(safari, animated: true)
}
)
self.showPanModal(content: vc)
self.showPanModal(content: textPopup)
}else{
self.goToMail(source: source)
}
})
.disposed(by: disposeBag)
Expand All @@ -288,6 +290,26 @@
}
}

extension QuestionViewController {
private func goToMail(source: InquiryType) {
if MFMailComposeViewController.canSendMail() {
let compseVC = MFMailComposeViewController()
compseVC.mailComposeDelegate = self
compseVC.setToRecipients([source.receiver])
compseVC.setSubject(source.title)
compseVC.setMessageBody(source.body + source.suffix, isHTML: false)
self.present(compseVC, animated: true, completion: nil)

}else {
let vc = TextPopupViewController.viewController(
text: "๋ฉ”์ผ ๊ณ„์ •์ด ์„ค์ •๋˜์–ด ์žˆ์ง€ ์•Š์Šต๋‹ˆ๋‹ค.\n์„ค์ • > Mail ์•ฑ > ๊ณ„์ •์„ ์„ค์ •ํ•ด์ฃผ์„ธ์š”.",
cancelButtonIsHidden: true,
confirmButtonText: "ํ™•์ธ"
)
self.showPanModal(content: vc)
}
}
}

extension QuestionViewController : MFMailComposeViewControllerDelegate {
public func mailComposeController(_ controller: MFMailComposeViewController, didFinishWith result: MFMailComposeResult, error: Error?) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,6 @@ extension InquiryType {
"""
case .addSong:
return """
ยท ์ด์„ธ๋Œ ๋ถ„๋“ค์ด ๋ถ€๋ฅด์‹  ๊ฑธ ์ดํŒŒ๋ฆฌ๋ถ„๋“ค์ด ๊ฐœ์ธ ์†Œ์žฅ์šฉ์œผ๋กœ ์ผ๋ถ€ ๊ณต๊ฐœํ•œ ์˜์ƒ์„ ์˜ฌ๋ฆฌ๊ธธ ์›ํ•˜์‹œ๋ฉด โ€˜์€์ˆ˜์ €โ€™๋‹˜์—๊ฒŒ ์™๋ฌผ์› ์ฑ„ํŒ…์œผ๋กœ ๋ถ€ํƒ๋“œ๋ฆฝ๋‹ˆ๋‹ค.
ยท ์™๋ฎค์— ๋“ค์–ด๊ฐˆ ์ˆ˜ ์žˆ๋Š” ๊ธฐ์ค€์„ ์ถฉ์กฑํ•˜๋Š”์ง€ ๊ผญ ํ™•์ธํ•˜์‹œ๊ณ  ์ถ”๊ฐ€ ์š”์ฒญํ•ด ์ฃผ์„ธ์š”.
\n์•„ํ‹ฐ์ŠคํŠธ:\n\n๋…ธ๋ž˜ ์ œ๋ชฉ:\n\n์œ ํŠœ๋ธŒ ๋งํฌ:\n\n๋‚ด์šฉ:\n\n\n\n
"""
case .modifySong:
Expand Down
Loading