Skip to content

Commit

Permalink
[Feat] Keyneez#46 - 상세뷰 사이트 연결
Browse files Browse the repository at this point in the history
  • Loading branch information
kpk0616 committed Jan 13, 2023
1 parent 301590a commit 5b61fb6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Keyneez/Keyneez/Global/Auth/UserSession.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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"

}
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand All @@ -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)
}
}

Expand Down

0 comments on commit 5b61fb6

Please sign in to comment.