Skip to content

Commit

Permalink
[fix] sentence table make round
Browse files Browse the repository at this point in the history
  • Loading branch information
Juhyeoklee committed Nov 8, 2020
1 parent 390f10c commit b284a6d
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 7 deletions.
4 changes: 2 additions & 2 deletions Mongle/Mongle/Resource/Storyboard/SentenceInfo.storyboard
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
</button>
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" contentInsetAdjustmentBehavior="never" dataMode="prototypes" style="grouped" separatorStyle="none" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="18" sectionFooterHeight="18" translatesAutoresizingMaskIntoConstraints="NO" id="pCd-12-Rm6">
<rect key="frame" x="0.0" y="184" width="375" height="537"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<prototypes>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" insetsLayoutMarginsFromSafeArea="NO" selectionStyle="blue" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" reuseIdentifier="SentenceInfoTVC" id="rzz-hj-wEs" customClass="SentenceInfoTVC" customModule="Mongle" customModuleProvider="target">
<rect key="frame" x="0.0" y="55.333332061767578" width="375" height="400.66665649414062"/>
Expand Down Expand Up @@ -396,7 +396,7 @@
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="๋‚œ ์—ฌ๋ฆ„์— ์ฒซ์‚ฌ๋ž‘์ด๋ž‘ ๋ฐ์ดํŠธํ•œ ์  ์—†๋Š”๋ฐโ€ฆ ๊ธฐ์–ต์กฐ์ž‘ ์ผ์œผํ‚ค๋Š” ํ•œ ๋ฌธ์žฅ" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="2" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="0MD-b1-XnF">
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" verticalCompressionResistancePriority="749" text="๋‚œ ์—ฌ๋ฆ„์— ์ฒซ์‚ฌ๋ž‘์ด๋ž‘ ๋ฐ์ดํŠธํ•œ ์  ์—†" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="0MD-b1-XnF">
<rect key="frame" x="28" y="103" width="319" height="51"/>
<fontDescription key="fontDescription" name="AppleSDGothicNeo-Medium" family="Apple SD Gothic Neo" pointSize="18"/>
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
Expand Down
1 change: 1 addition & 0 deletions Mongle/Mongle/Source/Cell/SentenceInfoTVC.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ class SentenceInfoTVC: UITableViewCell {

override func awakeFromNib() {
super.awakeFromNib()
self.selectionStyle = .none
sentenceLabel.text = sentence ?? ""
self.curatorProfileImageView.makeRounded(cornerRadius: self.curatorProfileImageView.frame.width / 2)

Expand Down
20 changes: 15 additions & 5 deletions Mongle/Mongle/Source/VCs/SentenceInfoVC.swift
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class SentenceInfoVC: UIViewController {
์ฒ˜์Œ ๋งˆ์ฃผํ•  ๋•Œ์˜ ์ธ์ƒ, ์‚ฌ์†Œํ•œ ๊ฒƒ์œผ๋กœ ์ธํ•ด ์ƒ๊ธฐ๋Š” ํ˜ธ๊ฐ, ์•Œ์•„๊ฐ€๋ฉด์„œ ๋Š๋ผ๋Š” ๋‹ค์–‘ํ•œ ๊ฐ์ •๊ณผ ๋จธ๊ธˆ๊ณ ์žˆ๋Š” ํ’๊ฒฝ๊ณผ ๋ถ„์œ„๊ธฐ๊นŒ์ง€. ์ฒ˜์Œ ๋งˆ์ฃผํ•  ๋•Œ์˜ ์ธ์ƒ, ์‚ฌ์†Œํ•œ ๊ฒƒ์œผ๋กœ ์ธํ•ด ์ƒ๊ธฐ๋Š” ํ˜ธ๊ฐ, ์•Œ์•„๊ฐ€๋ฉด์„œ ๋Š๋ผ๋Š” ๋‹ค์–‘ํ•œ ๊ฐ์ •๊ณผ ๋จธ๊ธˆ๊ณ ์žˆ๋Š” ํ’๊ฒฝ๊ณผ ๋ถ„์œ„๊ธฐ๊นŒ์ง€. ์ฒ˜์Œ ๋งˆ์ฃผํ•  ๋•Œ์˜์ธ์ƒ,์‚ฌ์†Œํ•œ ๊ฒƒ์œผ๋กœ ์ธํ•ด ์ƒ๊ธฐ๋Š” ํ˜ธ๊ฐ,
"""
var sentence: Sentence?
var themeImage: UIImage?
var themeImage: UIImage? = UIImage(named: "curatorImgTheme1")
var otherSentences: [Sentence] = []
var hasTheme: Bool = true
var isMySentence: Bool = true
Expand All @@ -51,12 +51,19 @@ class SentenceInfoVC: UIViewController {
super.viewDidLoad()
addGesture()
bindThemeInfo()
makeRoundTableView()
layoutTableView.delegate = self
layoutTableView.dataSource = self
}
override func viewWillAppear(_ animated: Bool) {
getSentenceInfo()
getOtherSentece()
// getSentenceInfo()
// getOtherSentece()
}

func makeRoundTableView() {
layoutTableView.layer.cornerRadius = 25
layoutTableView.clipsToBounds = true
layoutTableView.layer.maskedCorners = [.layerMinXMinYCorner, .layerMaxXMinYCorner]
}

func getSentenceInfo(){
Expand All @@ -82,7 +89,10 @@ class SentenceInfoVC: UIViewController {

func bindThemeInfo() {
themeImageView.image = themeImage
themeNameLabel.text = themeText
// themeNameLabel.text = themeText
themeNameLabel.text = """
๋‚œ ์—ฌ๋ฆ„์— ์ฒซ์‚ฌ๋ž‘์ด๋ž‘ ๋ฐ์ดํŠธํ•œ ์  ์—†๋Š”๋ฐโ€ฆ
"""
}

func getOtherSentece(){
Expand Down Expand Up @@ -382,7 +392,7 @@ extension SentenceInfoVC: UITableViewDataSource {
guard let cell = tableView.dequeueReusableCell(withIdentifier: SentenceInfoTVC.identifier) as? SentenceInfoTVC else {
return UITableViewCell()
}
cell.setSentenceData(sentence: self.sentence?.sentence ?? "",
cell.setSentenceData(sentence: self.sentence?.sentence ?? self.sentenceText,
profileImg: self.sentence?.writerImg ?? "",
curatorName: self.sentence?.writer ?? "",
isLiked: true,
Expand Down

0 comments on commit b284a6d

Please sign in to comment.