forked from zelo72/mastodon-ios
chore: code format and add layer.cornerCurve = .continuous
This commit is contained in:
parent
a59208a643
commit
7bf6328252
|
@ -33,6 +33,7 @@ class SearchRecommendAccountsCollectionViewCell: UICollectionViewCell {
|
||||||
let imageView = UIImageView()
|
let imageView = UIImageView()
|
||||||
imageView.contentMode = .scaleAspectFill
|
imageView.contentMode = .scaleAspectFill
|
||||||
imageView.layer.cornerRadius = 10
|
imageView.layer.cornerRadius = 10
|
||||||
|
imageView.layer.cornerCurve = .continuous
|
||||||
imageView.clipsToBounds = true
|
imageView.clipsToBounds = true
|
||||||
imageView.layer.borderWidth = 2
|
imageView.layer.borderWidth = 2
|
||||||
imageView.layer.borderColor = Asset.Colors.Border.searchCard.color.cgColor
|
imageView.layer.borderColor = Asset.Colors.Border.searchCard.color.cgColor
|
||||||
|
@ -65,6 +66,7 @@ class SearchRecommendAccountsCollectionViewCell: UICollectionViewCell {
|
||||||
button.setTitle(L10n.Scene.Search.Recommend.Accounts.follow, for: .normal)
|
button.setTitle(L10n.Scene.Search.Recommend.Accounts.follow, for: .normal)
|
||||||
button.titleLabel?.font = .systemFont(ofSize: 14, weight: .semibold)
|
button.titleLabel?.font = .systemFont(ofSize: 14, weight: .semibold)
|
||||||
button.layer.cornerRadius = 12
|
button.layer.cornerRadius = 12
|
||||||
|
button.layer.cornerCurve = .continuous
|
||||||
button.layer.borderWidth = 2
|
button.layer.borderWidth = 2
|
||||||
button.layer.borderColor = UIColor.white.cgColor
|
button.layer.borderColor = UIColor.white.cgColor
|
||||||
return button
|
return button
|
||||||
|
@ -99,6 +101,7 @@ extension SearchRecommendAccountsCollectionViewCell {
|
||||||
private func configure() {
|
private func configure() {
|
||||||
headerImageView.backgroundColor = Asset.Colors.brandBlue.color
|
headerImageView.backgroundColor = Asset.Colors.brandBlue.color
|
||||||
layer.cornerRadius = 10
|
layer.cornerRadius = 10
|
||||||
|
layer.cornerCurve = .continuous
|
||||||
clipsToBounds = false
|
clipsToBounds = false
|
||||||
applyShadow(color: Asset.Colors.Shadow.searchCard.color, alpha: 0.1, x: 0, y: 3, blur: 12, spread: 0)
|
applyShadow(color: Asset.Colors.Shadow.searchCard.color, alpha: 0.1, x: 0, y: 3, blur: 12, spread: 0)
|
||||||
contentView.addSubview(headerImageView)
|
contentView.addSubview(headerImageView)
|
||||||
|
|
|
@ -68,6 +68,7 @@ extension SearchRecommendTagsCollectionViewCell {
|
||||||
private func configure() {
|
private func configure() {
|
||||||
backgroundColor = Asset.Colors.brandBlue.color
|
backgroundColor = Asset.Colors.brandBlue.color
|
||||||
layer.cornerRadius = 10
|
layer.cornerRadius = 10
|
||||||
|
layer.cornerCurve = .continuous
|
||||||
clipsToBounds = false
|
clipsToBounds = false
|
||||||
layer.borderWidth = 2
|
layer.borderWidth = 2
|
||||||
layer.borderColor = Asset.Colors.Border.searchCard.color.cgColor
|
layer.borderColor = Asset.Colors.Border.searchCard.color.cgColor
|
||||||
|
|
|
@ -28,7 +28,7 @@ extension APIService.CoreData {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
|
|
||||||
if let oldTag = oldTag {
|
if let oldTag = oldTag {
|
||||||
APIService.CoreData.merge(tag: oldTag, entity: entity, into: managedObjectContext)
|
APIService.CoreData.merge(tag: oldTag, entity: entity, into: managedObjectContext)
|
||||||
return (oldTag, false)
|
return (oldTag, false)
|
||||||
|
@ -40,8 +40,8 @@ extension APIService.CoreData {
|
||||||
return (tagInCoreData, true)
|
return (tagInCoreData, true)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static func merge(tag:Tag,entity:Mastodon.Entity.Tag,into managedObjectContext: NSManagedObjectContext) {
|
static func merge(tag: Tag, entity: Mastodon.Entity.Tag, into managedObjectContext: NSManagedObjectContext) {
|
||||||
tag.update(url: tag.url)
|
tag.update(url: tag.url)
|
||||||
guard let tagHistories = tag.histories else { return }
|
guard let tagHistories = tag.histories else { return }
|
||||||
guard let entityHistories = entity.history?.prefix(2) else { return }
|
guard let entityHistories = entity.history?.prefix(2) else { return }
|
||||||
|
@ -49,7 +49,7 @@ extension APIService.CoreData {
|
||||||
if entityHistoriesCount == 0 {
|
if entityHistoriesCount == 0 {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
for n in 0..<tagHistories.count {
|
for n in 0 ..< tagHistories.count {
|
||||||
if n < entityHistories.count {
|
if n < entityHistories.count {
|
||||||
let entityHistory = entityHistories[n]
|
let entityHistory = entityHistories[n]
|
||||||
tag.updateHistory(index: n, day: entityHistory.day, uses: entityHistory.uses, account: entityHistory.accounts)
|
tag.updateHistory(index: n, day: entityHistory.day, uses: entityHistory.uses, account: entityHistory.accounts)
|
||||||
|
@ -58,7 +58,7 @@ extension APIService.CoreData {
|
||||||
if entityHistoriesCount <= tagHistories.count {
|
if entityHistoriesCount <= tagHistories.count {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
for n in 1...(entityHistoriesCount - tagHistories.count) {
|
for n in 1 ... (entityHistoriesCount - tagHistories.count) {
|
||||||
let entityHistory = entityHistories[entityHistoriesCount - n]
|
let entityHistory = entityHistories[entityHistoriesCount - n]
|
||||||
tag.appendHistory(history: History.insert(into: managedObjectContext, property: History.Property(day: entityHistory.day, uses: entityHistory.uses, accounts: entityHistory.accounts)))
|
tag.appendHistory(history: History.insert(into: managedObjectContext, property: History.Property(day: entityHistory.day, uses: entityHistory.uses, accounts: entityHistory.accounts)))
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue