diff --git a/Keyneez/Keyneez/Global/Auth/UserSession.swift b/Keyneez/Keyneez/Global/Auth/UserSession.swift index 79d9c39..343a7f2 100644 --- a/Keyneez/Keyneez/Global/Auth/UserSession.swift +++ b/Keyneez/Keyneez/Global/Auth/UserSession.swift @@ -21,6 +21,6 @@ final class UserSession { private init() { } var profile: Profile? - var accessToken: String? = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX2tleSI6Mjk5LCJpYXQiOjE2NzM2Mzk3MDIsImV4cCI6MTY3MzY0NjkwMn0.aL2yxuMvSaCuTEiDZPnexm2c3tpRUZrxZeXU5_5djH4" + var accessToken: String? = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX2tleSI6MzEyLCJpYXQiOjE2NzM2NDExOTUsImV4cCI6MTY3MzY0ODM5NX0.thu5Mu3sVDYgC_lnKDbXthIo0z4ubl-Col67OTm4Eh8" } diff --git a/Keyneez/Keyneez/Tab/Home/Controllers/ContentDetailViewController.swift b/Keyneez/Keyneez/Tab/Home/Controllers/ContentDetailViewController.swift index 948d25a..694a769 100644 --- a/Keyneez/Keyneez/Tab/Home/Controllers/ContentDetailViewController.swift +++ b/Keyneez/Keyneez/Tab/Home/Controllers/ContentDetailViewController.swift @@ -8,10 +8,12 @@ import UIKit import Then import SnapKit +import SafariServices final class ContentDetailViewController: NiblessViewController, NavigationBarProtocol { var isLiked: Bool = false + private var contentLink: String = "" lazy var navigationView: UIView = NavigationViewBuilder(barViews: [.iconButton(with: backButton), .flexibleBox, .iconButton(with: shareButton), .sizedBox(width: 16), .iconButton(with: likeButton)]).build() private lazy var backButton = makeIconButton(imageName: "ic_arrowback_search", action: touchUpBackButton) @@ -204,7 +206,7 @@ extension ContentDetailViewController { } @objc private func touchUpUrlRoundButton() { - print("touch up Url Button") + goToSite(url: contentLink) } func bindContentDetailData(model: ContentDetailResponseDto) { contentTitle.text = deleteNewLine(fullString: model.contentTitle) @@ -219,6 +221,11 @@ extension ContentDetailViewController { guard let url = model.contentImg else { return } contentImageView.setImage(url: url) categoryView.setCategory(with: model.category[0]) + contentLink = model.contentLink + } + private func goToSite(url: String) { + let safariView: SFSafariViewController = SFSafariViewController(url: URL(string: url)!) + self.present(safariView, animated: true, completion: nil) } }