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

๐Ÿ”€ :: ๋ฌธ์˜ํ•˜๊ธฐ > ๋…ธ๋ž˜ ์ถ”๊ฐ€ > ์ถฉ์กฑ ๊ธฐ์ค€ ๋ณผ ์ˆ˜ ์žˆ๋„๋ก ๋ณ€๊ฒฝ #385

Merged
merged 2 commits into from
Nov 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -14,6 +14,7 @@ import BaseFeature
import DataMappingModule
import MessageUI
import CommonFeature
import SafariServices

public final class QuestionViewController: BaseViewController,ViewControllerFromStoryBoard {

Expand Down Expand Up @@ -239,34 +240,35 @@ extension QuestionViewController {
)
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 {
}
}

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