refine waver and sampleview

This commit is contained in:
kevinzhow
2015-05-05 15:49:32 +08:00
parent 00ee523eb6
commit c192502374
3 changed files with 14 additions and 2 deletions
@@ -445,6 +445,7 @@ class ConversationViewController: UIViewController {
// contentInset
setConversaitonCollectionViewOriginalContentInset()
//
scrollToLastMessage()
}
@@ -1173,6 +1174,7 @@ extension ConversationViewController: UICollectionViewDataSource, UICollectionVi
super.viewDidDisappear(animated)
FayeService.sharedManager.delegate = nil
timer.invalidate()
self.waverView.removeFromSuperview()
}
// MARK: UIScrollViewDelegate
+1 -1
View File
@@ -72,7 +72,7 @@ class SampleView: UIView {
for (index, percent) in enumerate(samples) {
let x = CGFloat(index) * sampleWidth + sampleGap * CGFloat(index)
let sampleHeightMax = viewHeight * 0.8
let sampleHeightMax = viewHeight * 0.7
var realSampleHeight = percent * viewHeight
realSampleHeight = realSampleHeight < 1 ? 1 : realSampleHeight
+11 -1
View File
@@ -31,9 +31,19 @@ class YepWaverView: UIView {
}
private func setup() {
waver = Waver(frame: CGRectMake(0, CGRectGetHeight(self.bounds)/2.0 - 50.0, CGRectGetWidth(self.bounds), 100.0))
waver = Waver(frame: CGRectMake(0, CGRectGetHeight(self.bounds)/2.0 - 50.0 - 40.0, CGRectGetWidth(self.bounds), 100.0))
self.backgroundColor = UIColor(white: 1.0, alpha: 0.9)
}
override func willMoveToSuperview(newSuperview: UIView?) {
super.willMoveToSuperview(newSuperview)
self.addSubview(waver)
}
override func removeFromSuperview() {
super.removeFromSuperview()
waver.removeFromSuperview()
}
}