-
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] #118 - FrontCardCell 에서 인스타 앱, 링크 사파리 연결 #127
Merged
Merged
Changes from all commits
Commits
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,7 +25,9 @@ class FrontCardCell: CardCell { | |
|
||
override func awakeFromNib() { | ||
super.awakeFromNib() | ||
setUI() | ||
|
||
setUI() | ||
setTapGesture() | ||
} | ||
@IBAction func touchShareButton(_ sender: Any) { | ||
} | ||
|
@@ -56,7 +58,39 @@ extension FrontCardCell { | |
linkURLLabel.textColor = .white | ||
linkURLLabel.numberOfLines = 2 | ||
linkURLLabel.lineBreakMode = .byTruncatingTail | ||
shareButton.isHidden = true | ||
} | ||
private func setTapGesture() { | ||
instagramIDLabel.isUserInteractionEnabled = true | ||
let instagramTapGesture = UITapGestureRecognizer(target: self, action: #selector(tapInstagramLabel)) | ||
instagramIDLabel.addGestureRecognizer(instagramTapGesture) | ||
|
||
linkURLLabel.isUserInteractionEnabled = true | ||
let linkURLTapGesture = UITapGestureRecognizer(target: self, action: #selector(tapLinkURLLabel)) | ||
linkURLLabel.addGestureRecognizer(linkURLTapGesture) | ||
} | ||
|
||
// MARK: - @objc Methods | ||
|
||
@objc | ||
private func tapInstagramLabel() { | ||
let instagramID = instagramIDLabel.text ?? "" | ||
let appURL = URL(string: "instagram://user?username=\(instagramID)")! | ||
let webURL = URL(string: "https://instagram.com/\(instagramID)")! | ||
|
||
if UIApplication.shared.canOpenURL(appURL) { | ||
UIApplication.shared.open(appURL, options: [:], completionHandler: nil) | ||
} else { | ||
UIApplication.shared.open(webURL, options: [:], completionHandler: nil) | ||
} | ||
} | ||
Comment on lines
+80
to
+85
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 잘 긁어갑니다~ |
||
@objc | ||
private func tapLinkURLLabel() { | ||
let linkURL = linkURLLabel.text ?? "" | ||
let webURL = URL(string: linkURL)! | ||
|
||
if UIApplication.shared.canOpenURL(webURL) { | ||
UIApplication.shared.open(webURL, options: [:], completionHandler: nil) | ||
} | ||
} | ||
|
||
/// 서버에서 image 를 URL 로 가져올 경우 사용. | ||
|
@@ -99,3 +133,4 @@ extension FrontCardCell { | |
linkURLLabel.text = linkURL | ||
} | ||
} | ||
|
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 |
---|---|---|
|
@@ -119,7 +119,7 @@ extension FrontViewController { | |
"Blog" | ||
]) | ||
linkIDList.append(contentsOf: ["https://github.com/TeamNADAgit.luolix.top/TeamNADAgit.luolix.top/TeamNADAgit.luolix.top/TeamNADAgit.luolix.top/TeamNADA", | ||
"https://github.com/TeamNADA" | ||
"https://www.naver.com" | ||
]) | ||
} | ||
|
||
|
@@ -162,6 +162,7 @@ extension FrontViewController { | |
|
||
// MARK: - VerticalCardSwiperDelegate | ||
extension FrontViewController: VerticalCardSwiperDelegate { | ||
// TODO: - FrontCard 에서 링크를 통한 인스타, 사파리 접속을 위해 주석 처리. | ||
func didTapCard(verticalCardSwiperView: VerticalCardSwiperView, index: Int) { | ||
let frontCell = cardSwiper.cardForItem(at: index) | ||
Comment on lines
164
to
167
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 델리게이트 야무지네용 |
||
let backCell = cardSwiper.cardForItem(at: index) | ||
|
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.
일단 숨겨놔 ㅋ ㅋ
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.
계속 숨겨놓는것도 좋은 방법일 수도.... ^__^