Fix fake chat view glitch

This commit is contained in:
Niels Andriesse 2019-12-09 11:50:45 +11:00
parent 99ce25ff6b
commit 9493074926
3 changed files with 18 additions and 3 deletions

View File

@ -2,6 +2,11 @@
final class FakeChatView : UIView {
private let spacing = Values.mediumSpacing
var contentOffset: CGPoint {
get { return scrollView.contentOffset }
set { scrollView.contentOffset = newValue }
}
private lazy var chatBubbles = [
getChatBubble(withText: NSLocalizedString("What is Loki Messenger? A completely decentralised private messaging application for all platforms.", comment: ""), wasSentByCurrentUser: true),
getChatBubble(withText: NSLocalizedString("So no metadata collection, or personally identifiable information? How does it work?", comment: ""), wasSentByCurrentUser: false),

View File

@ -1,5 +1,6 @@
final class LandingVC : UIViewController {
private var fakeChatViewContentOffset: CGPoint!
// MARK: Components
private lazy var fakeChatView: FakeChatView = {
@ -77,8 +78,17 @@ final class LandingVC : UIViewController {
topSpacer.heightAnchor.constraint(equalTo: bottomSpacer.heightAnchor, multiplier: 1).isActive = true
}
override func viewDidDisappear(_ animated: Bool) {
super.viewDidAppear(animated)
fakeChatView.contentOffset = fakeChatViewContentOffset
}
// MARK: Interaction
@objc private func register() {
fakeChatViewContentOffset = fakeChatView.contentOffset
DispatchQueue.main.async {
self.fakeChatView.contentOffset = self.fakeChatViewContentOffset
}
let publicKeyVC = PublicKeyVC()
navigationController!.pushViewController(publicKeyVC, animated: true)
}

View File

@ -122,9 +122,9 @@ public class OnboardingController: NSObject {
}
public func pushDisplayNameVC(from viewController: UIViewController) {
AssertIsOnMainThread()
let displayNameVC = DisplayNameVC(onboardingController: self)
viewController.navigationController?.pushViewController(displayNameVC, animated: true)
// AssertIsOnMainThread()
// let displayNameVC = DisplayNameVC(onboardingController: self)
// viewController.navigationController?.pushViewController(displayNameVC, animated: true)
}
public func onboardingRegistrationSucceeded(viewController: UIViewController) {