|
@@ -76,6 +76,7 @@ class CardContentTitleTableViewCell: UITableViewCell {
|
|
subtitleLabel.textColor = k313334Color
|
|
subtitleLabel.textColor = k313334Color
|
|
subtitleLabel.font = kRegularFont14
|
|
subtitleLabel.font = kRegularFont14
|
|
subtitleLabel.numberOfLines = 0
|
|
subtitleLabel.numberOfLines = 0
|
|
|
|
+ subtitleLabel.sizeToFit()
|
|
return subtitleLabel
|
|
return subtitleLabel
|
|
}()
|
|
}()
|
|
|
|
|
|
@@ -99,13 +100,15 @@ class CardContentTitleTableViewCell: UITableViewCell {
|
|
|
|
|
|
var cardContentTitleTableViewCellType: CardContentTitleTableViewCellType? {
|
|
var cardContentTitleTableViewCellType: CardContentTitleTableViewCellType? {
|
|
didSet {
|
|
didSet {
|
|
|
|
+ var str = communityRecommendDataModel?.content ?? ""
|
|
|
|
+ str = str.replacingOccurrences(of: "\n", with: "").replacingOccurrences(of: "\r", with: "")
|
|
|
|
+ var titleStr = communityRecommendDataModel?.title ?? ""
|
|
|
|
+ titleStr = titleStr.replacingOccurrences(of: "\n", with: "").replacingOccurrences(of: "\r", with: "")
|
|
switch cardContentTitleTableViewCellType {
|
|
switch cardContentTitleTableViewCellType {
|
|
case .noTitleMoreThan?:
|
|
case .noTitleMoreThan?:
|
|
titleLabel.isHidden = true
|
|
titleLabel.isHidden = true
|
|
if PostType(rawValue: communityRecommendDataModel?.type ?? "image") != .html {
|
|
if PostType(rawValue: communityRecommendDataModel?.type ?? "image") != .html {
|
|
subtitleLabel.isHidden = false
|
|
subtitleLabel.isHidden = false
|
|
- var str = communityRecommendDataModel?.content ?? ""
|
|
|
|
-
|
|
|
|
if str.count >= 45 {
|
|
if str.count >= 45 {
|
|
str = String(str.prefix(45) + "...更多")
|
|
str = String(str.prefix(45) + "...更多")
|
|
let str1 = str.suffix(2)
|
|
let str1 = str.suffix(2)
|
|
@@ -128,7 +131,7 @@ class CardContentTitleTableViewCell: UITableViewCell {
|
|
case .noTitleNoMoreThan?:
|
|
case .noTitleNoMoreThan?:
|
|
titleLabel.isHidden = true
|
|
titleLabel.isHidden = true
|
|
if PostType(rawValue: communityRecommendDataModel?.type ?? "image") != .html {
|
|
if PostType(rawValue: communityRecommendDataModel?.type ?? "image") != .html {
|
|
- subtitleLabel.text = communityRecommendDataModel?.content
|
|
|
|
|
|
+ subtitleLabel.text = str
|
|
subtitleLabel.isHidden = false
|
|
subtitleLabel.isHidden = false
|
|
}else {
|
|
}else {
|
|
subtitleLabel.isHidden = true
|
|
subtitleLabel.isHidden = true
|
|
@@ -142,10 +145,9 @@ class CardContentTitleTableViewCell: UITableViewCell {
|
|
break
|
|
break
|
|
case .titleMoreThan?:
|
|
case .titleMoreThan?:
|
|
titleLabel.isHidden = false
|
|
titleLabel.isHidden = false
|
|
- titleLabel.text = communityRecommendDataModel?.title
|
|
|
|
|
|
+ titleLabel.text = titleStr
|
|
if PostType(rawValue: communityRecommendDataModel?.type ?? "image") != .html {
|
|
if PostType(rawValue: communityRecommendDataModel?.type ?? "image") != .html {
|
|
subtitleLabel.isHidden = false
|
|
subtitleLabel.isHidden = false
|
|
- var str = communityRecommendDataModel?.content ?? ""
|
|
|
|
if str.count >= 45 {
|
|
if str.count >= 45 {
|
|
str = String(str.prefix(45) + "...更多")
|
|
str = String(str.prefix(45) + "...更多")
|
|
let str1 = str.suffix(2)
|
|
let str1 = str.suffix(2)
|
|
@@ -180,9 +182,9 @@ class CardContentTitleTableViewCell: UITableViewCell {
|
|
break
|
|
break
|
|
case .titleNoMoreThan?:
|
|
case .titleNoMoreThan?:
|
|
titleLabel.isHidden = false
|
|
titleLabel.isHidden = false
|
|
- titleLabel.text = communityRecommendDataModel?.title
|
|
|
|
|
|
+ titleLabel.text = titleStr
|
|
if PostType(rawValue: communityRecommendDataModel?.type ?? "image") != .html {
|
|
if PostType(rawValue: communityRecommendDataModel?.type ?? "image") != .html {
|
|
- subtitleLabel.text = communityRecommendDataModel?.content
|
|
|
|
|
|
+ subtitleLabel.text = str
|
|
subtitleLabel.isHidden = false
|
|
subtitleLabel.isHidden = false
|
|
titleLabel.snp_remakeConstraints { (make) in
|
|
titleLabel.snp_remakeConstraints { (make) in
|
|
make.top.equalToSuperview()
|
|
make.top.equalToSuperview()
|
|
@@ -231,13 +233,15 @@ class CardContentTitleTableViewCell: UITableViewCell {
|
|
|
|
|
|
var cardContentTitleTableViewCellType1: CardContentTitleTableViewCellType? {
|
|
var cardContentTitleTableViewCellType1: CardContentTitleTableViewCellType? {
|
|
didSet {
|
|
didSet {
|
|
|
|
+ var str = communityFollowDataModel?.relateData?.content ?? ""
|
|
|
|
+ str = str.replacingOccurrences(of: "\n", with: "").replacingOccurrences(of: "\r", with: "")
|
|
|
|
+ var titleStr = communityFollowDataModel?.relateData?.title ?? ""
|
|
|
|
+ titleStr = titleStr.replacingOccurrences(of: "\n", with: "").replacingOccurrences(of: "\r", with: "")
|
|
switch cardContentTitleTableViewCellType1 {
|
|
switch cardContentTitleTableViewCellType1 {
|
|
case .noTitleMoreThan?:
|
|
case .noTitleMoreThan?:
|
|
titleLabel.isHidden = true
|
|
titleLabel.isHidden = true
|
|
if PostType(rawValue: communityFollowDataModel?.relateData?.type ?? "image") != .html {
|
|
if PostType(rawValue: communityFollowDataModel?.relateData?.type ?? "image") != .html {
|
|
subtitleLabel.isHidden = false
|
|
subtitleLabel.isHidden = false
|
|
- var str = communityFollowDataModel?.relateData?.content ?? ""
|
|
|
|
-
|
|
|
|
if str.count >= 45 {
|
|
if str.count >= 45 {
|
|
str = String(str.prefix(45) + "...更多")
|
|
str = String(str.prefix(45) + "...更多")
|
|
let str1 = str.suffix(2)
|
|
let str1 = str.suffix(2)
|
|
@@ -260,7 +264,7 @@ class CardContentTitleTableViewCell: UITableViewCell {
|
|
case .noTitleNoMoreThan?:
|
|
case .noTitleNoMoreThan?:
|
|
titleLabel.isHidden = true
|
|
titleLabel.isHidden = true
|
|
if PostType(rawValue: communityFollowDataModel?.relateData?.type ?? "image") != .html {
|
|
if PostType(rawValue: communityFollowDataModel?.relateData?.type ?? "image") != .html {
|
|
- subtitleLabel.text = communityFollowDataModel?.relateData?.content
|
|
|
|
|
|
+ subtitleLabel.text = str
|
|
subtitleLabel.isHidden = false
|
|
subtitleLabel.isHidden = false
|
|
}else {
|
|
}else {
|
|
subtitleLabel.isHidden = true
|
|
subtitleLabel.isHidden = true
|
|
@@ -274,10 +278,9 @@ class CardContentTitleTableViewCell: UITableViewCell {
|
|
break
|
|
break
|
|
case .titleMoreThan?:
|
|
case .titleMoreThan?:
|
|
titleLabel.isHidden = false
|
|
titleLabel.isHidden = false
|
|
- titleLabel.text = communityFollowDataModel?.relateData?.title
|
|
|
|
|
|
+ titleLabel.text = titleStr
|
|
if PostType(rawValue: communityFollowDataModel?.relateData?.type ?? "image") != .html {
|
|
if PostType(rawValue: communityFollowDataModel?.relateData?.type ?? "image") != .html {
|
|
subtitleLabel.isHidden = false
|
|
subtitleLabel.isHidden = false
|
|
- var str = communityFollowDataModel?.relateData?.content ?? ""
|
|
|
|
if str.count >= 45 {
|
|
if str.count >= 45 {
|
|
str = String(str.prefix(45) + "...更多")
|
|
str = String(str.prefix(45) + "...更多")
|
|
let str1 = str.suffix(2)
|
|
let str1 = str.suffix(2)
|
|
@@ -312,9 +315,9 @@ class CardContentTitleTableViewCell: UITableViewCell {
|
|
break
|
|
break
|
|
case .titleNoMoreThan?:
|
|
case .titleNoMoreThan?:
|
|
titleLabel.isHidden = false
|
|
titleLabel.isHidden = false
|
|
- titleLabel.text = communityFollowDataModel?.relateData?.title
|
|
|
|
|
|
+ titleLabel.text = titleStr
|
|
if PostType(rawValue: communityFollowDataModel?.relateData?.type ?? "image") != .html {
|
|
if PostType(rawValue: communityFollowDataModel?.relateData?.type ?? "image") != .html {
|
|
- subtitleLabel.text = communityFollowDataModel?.relateData?.content
|
|
|
|
|
|
+ subtitleLabel.text = str
|
|
subtitleLabel.isHidden = false
|
|
subtitleLabel.isHidden = false
|
|
titleLabel.snp_remakeConstraints { (make) in
|
|
titleLabel.snp_remakeConstraints { (make) in
|
|
make.top.equalToSuperview()
|
|
make.top.equalToSuperview()
|