mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-23 14:45:21 +00:00
Camera and editor improvements
This commit is contained in:
@@ -67,4 +67,33 @@ public final class MediaEditorPreviewView: MTKView, MTKViewDelegate, RenderTarge
|
||||
}
|
||||
self.renderer?.renderFrame()
|
||||
}
|
||||
|
||||
private var transitionView: UIImageView?
|
||||
public func setTransitionImage(_ image: UIImage) {
|
||||
self.transitionView?.removeFromSuperview()
|
||||
|
||||
let transitionView = UIImageView(image: image)
|
||||
transitionView.frame = self.bounds
|
||||
self.addSubview(transitionView)
|
||||
|
||||
self.transitionView = transitionView
|
||||
}
|
||||
|
||||
public func removeTransitionImage() {
|
||||
if let transitionView = self.transitionView {
|
||||
// transitionView.layer.animateAlpha(from: 1.0, to: 0.0, duration: 0.1, removeOnCompletion: false, completion: { [weak transitionView] _ in
|
||||
//
|
||||
// })
|
||||
transitionView.removeFromSuperview()
|
||||
self.transitionView = nil
|
||||
}
|
||||
}
|
||||
|
||||
public override func layoutSubviews() {
|
||||
super.layoutSubviews()
|
||||
|
||||
if let transitionView = self.transitionView {
|
||||
transitionView.frame = self.bounds
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user