|
|
@ -89,6 +89,13 @@ final class JoinOpenGroupVC: BaseVC, UIPageViewControllerDataSource, UIPageViewC
|
|
|
|
scanQRCodePlaceholderVC.constrainHeight(to: height)
|
|
|
|
scanQRCodePlaceholderVC.constrainHeight(to: height)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
override func viewWillTransition(to size: CGSize, with coordinator: UIViewControllerTransitionCoordinator) {
|
|
|
|
|
|
|
|
super.viewWillTransition(to: size, with: coordinator)
|
|
|
|
|
|
|
|
enterURLVC.viewWidth?.constant = size.width
|
|
|
|
|
|
|
|
enterURLVC.suggestionGrid.refreshLayout(with: size.width - 2 * Values.largeSpacing)
|
|
|
|
|
|
|
|
scanQRCodePlaceholderVC.viewWidth?.constant = size.width
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// MARK: - General
|
|
|
|
// MARK: - General
|
|
|
|
|
|
|
|
|
|
|
|
func pageViewController(_ pageViewController: UIPageViewController, viewControllerBefore viewController: UIViewController) -> UIViewController? {
|
|
|
|
func pageViewController(_ pageViewController: UIPageViewController, viewControllerBefore viewController: UIViewController) -> UIViewController? {
|
|
|
@ -230,7 +237,7 @@ private final class EnterURLVC: UIViewController, UIGestureRecognizerDelegate, O
|
|
|
|
return result
|
|
|
|
return result
|
|
|
|
}()
|
|
|
|
}()
|
|
|
|
|
|
|
|
|
|
|
|
private lazy var suggestionGrid: OpenGroupSuggestionGrid = {
|
|
|
|
lazy var suggestionGrid: OpenGroupSuggestionGrid = {
|
|
|
|
let maxWidth: CGFloat = (UIScreen.main.bounds.width - Values.largeSpacing * 2)
|
|
|
|
let maxWidth: CGFloat = (UIScreen.main.bounds.width - Values.largeSpacing * 2)
|
|
|
|
let result: OpenGroupSuggestionGrid = OpenGroupSuggestionGrid(maxWidth: maxWidth)
|
|
|
|
let result: OpenGroupSuggestionGrid = OpenGroupSuggestionGrid(maxWidth: maxWidth)
|
|
|
|
result.delegate = self
|
|
|
|
result.delegate = self
|
|
|
@ -238,6 +245,8 @@ private final class EnterURLVC: UIViewController, UIGestureRecognizerDelegate, O
|
|
|
|
return result
|
|
|
|
return result
|
|
|
|
}()
|
|
|
|
}()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var viewWidth: NSLayoutConstraint?
|
|
|
|
|
|
|
|
|
|
|
|
// MARK: - Lifecycle
|
|
|
|
// MARK: - Lifecycle
|
|
|
|
|
|
|
|
|
|
|
|
override func viewDidLoad() {
|
|
|
|
override func viewDidLoad() {
|
|
|
@ -270,7 +279,7 @@ private final class EnterURLVC: UIViewController, UIGestureRecognizerDelegate, O
|
|
|
|
bottomConstraint = view.pin(.bottom, to: .bottom, of: stackView, withInset: bottomMargin)
|
|
|
|
bottomConstraint = view.pin(.bottom, to: .bottom, of: stackView, withInset: bottomMargin)
|
|
|
|
|
|
|
|
|
|
|
|
// Constraints
|
|
|
|
// Constraints
|
|
|
|
view.set(.width, to: UIScreen.main.bounds.width)
|
|
|
|
viewWidth = view.set(.width, to: UIScreen.main.bounds.width)
|
|
|
|
|
|
|
|
|
|
|
|
// Dismiss keyboard on tap
|
|
|
|
// Dismiss keyboard on tap
|
|
|
|
let tapGestureRecognizer = UITapGestureRecognizer(target: self, action: #selector(dismissKeyboard))
|
|
|
|
let tapGestureRecognizer = UITapGestureRecognizer(target: self, action: #selector(dismissKeyboard))
|
|
|
@ -374,6 +383,8 @@ private final class EnterURLVC: UIViewController, UIGestureRecognizerDelegate, O
|
|
|
|
private final class ScanQRCodePlaceholderVC: UIViewController {
|
|
|
|
private final class ScanQRCodePlaceholderVC: UIViewController {
|
|
|
|
weak var joinOpenGroupVC: JoinOpenGroupVC?
|
|
|
|
weak var joinOpenGroupVC: JoinOpenGroupVC?
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var viewWidth: NSLayoutConstraint?
|
|
|
|
|
|
|
|
|
|
|
|
// MARK: - Lifecycle
|
|
|
|
// MARK: - Lifecycle
|
|
|
|
|
|
|
|
|
|
|
|
override func viewDidLoad() {
|
|
|
|
override func viewDidLoad() {
|
|
|
@ -403,7 +414,7 @@ private final class ScanQRCodePlaceholderVC: UIViewController {
|
|
|
|
stackView.alignment = .center
|
|
|
|
stackView.alignment = .center
|
|
|
|
|
|
|
|
|
|
|
|
// Constraints
|
|
|
|
// Constraints
|
|
|
|
view.set(.width, to: UIScreen.main.bounds.width)
|
|
|
|
viewWidth = view.set(.width, to: UIScreen.main.bounds.width)
|
|
|
|
view.addSubview(stackView)
|
|
|
|
view.addSubview(stackView)
|
|
|
|
stackView.pin(.leading, to: .leading, of: view, withInset: Values.massiveSpacing)
|
|
|
|
stackView.pin(.leading, to: .leading, of: view, withInset: Values.massiveSpacing)
|
|
|
|
view.pin(.trailing, to: .trailing, of: stackView, withInset: Values.massiveSpacing)
|
|
|
|
view.pin(.trailing, to: .trailing, of: stackView, withInset: Values.massiveSpacing)
|
|
|
|