Respond to CR.

This commit is contained in:
Matthew Chen 2018-06-29 12:41:30 -04:00
parent 3d5cff1ed0
commit d2f2e1cb22
2 changed files with 42 additions and 0 deletions

View File

@ -896,6 +896,8 @@ NS_ASSUME_NONNULL_BEGIN
[wrapper addSubview:downloadView];
[downloadView autoPinWidthToSuperview];
[downloadView autoVCenterInSuperview];
[downloadView autoPinEdgeToSuperviewMargin:ALEdgeTop relation:NSLayoutRelationGreaterThanOrEqual];
[downloadView autoPinEdgeToSuperviewMargin:ALEdgeBottom relation:NSLayoutRelationGreaterThanOrEqual];
self.loadCellContentBlock = ^{
// Do nothing.

View File

@ -0,0 +1,40 @@
//
// Copyright (c) 2018 Open Whisper Systems. All rights reserved.
//
import Foundation
@objc
class OWSLayerView: UIView {
let layoutCallback: ((UIView) -> Void)
@objc
public required init(frame: CGRect, layoutCallback : @escaping (UIView) -> Void) {
self.layoutCallback = layoutCallback
super.init(frame: frame)
}
required init?(coder aDecoder: NSCoder) {
self.layoutCallback = { _ in
}
super.init(coder: aDecoder)
}
override var bounds: CGRect {
didSet {
layoutCallback(self)
}
}
override var frame: CGRect {
didSet {
layoutCallback(self)
}
}
override var center: CGPoint {
didSet {
layoutCallback(self)
}
}
}