mirror of
https://github.com/oxen-io/session-ios.git
synced 2023-12-13 21:30:14 +01:00
Refactored the SignalApp class to Swift Fixed a horizontal alignment issue in the ConversationTitleView Fixed an issue where expiration timer update messages weren't migrated or rendering correctly Fixed an issue where expiring messages weren't migrated correctly Fixed an issue where closed groups which had been left were causing migration failures (due to data incorrectly being assumed to be required) Shifted the Legacy Attachment types into the 'SMKLegacy' namespace Moved all of the NSCoding logic for the TSMessage
28 lines
1.3 KiB
Swift
28 lines
1.3 KiB
Swift
// Copyright © 2022 Rangeproof Pty Ltd. All rights reserved.
|
|
|
|
import UIKit
|
|
|
|
public extension UITableView {
|
|
func register<View>(view: View.Type) where View: UITableViewCell {
|
|
register(view.self, forCellReuseIdentifier: view.defaultReuseIdentifier)
|
|
}
|
|
|
|
func registerHeaderFooterView<View>(view: View.Type) where View: UITableViewHeaderFooterView {
|
|
register(view.self, forHeaderFooterViewReuseIdentifier: view.defaultReuseIdentifier)
|
|
}
|
|
|
|
func dequeue<T>(type: T.Type, for indexPath: IndexPath) -> T where T: UITableViewCell {
|
|
// Note: We need to use `type.defaultReuseIdentifier` rather than `T.defaultReuseIdentifier`
|
|
// otherwise we may get a subclass rather than the actual type we specified
|
|
let reuseIdentifier = type.defaultReuseIdentifier
|
|
return dequeueReusableCell(withIdentifier: reuseIdentifier, for: indexPath) as! T
|
|
}
|
|
|
|
func dequeueHeaderFooterView<T>(type: T.Type) -> T where T: UITableViewHeaderFooterView {
|
|
// Note: We need to use `type.defaultReuseIdentifier` rather than `T.defaultReuseIdentifier`
|
|
// otherwise we may get a subclass rather than the actual type we specified
|
|
let reuseIdentifier = type.defaultReuseIdentifier
|
|
return dequeueReusableHeaderFooterView(withIdentifier: reuseIdentifier) as! T
|
|
}
|
|
}
|