Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
xx messenger iOS
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mobile
iOS
xx messenger iOS
Commits
ab1e6079
Commit
ab1e6079
authored
2 years ago
by
Bruno Muniz
Browse files
Options
Downloads
Patches
Plain Diff
Fixes bug on scroll view reseting offset
parent
86a23f4f
No related branches found
Branches containing commit
No related tags found
2 merge requests
!54
Releasing 1.1.4
,
!50
Search UI 2.0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Sources/SearchFeature/Controllers/SearchContainerController.swift
+11
-1
11 additions, 1 deletion
...SearchFeature/Controllers/SearchContainerController.swift
with
11 additions
and
1 deletion
Sources/SearchFeature/Controllers/SearchContainerController.swift
+
11
−
1
View file @
ab1e6079
...
...
@@ -12,6 +12,7 @@ public final class SearchContainerController: UIViewController {
lazy
private
var
screenView
=
SearchContainerView
()
private
var
contentOffset
:
CGPoint
?
private
var
cancellables
=
Set
<
AnyCancellable
>
()
private
let
viewModel
=
SearchContainerViewModel
()
private
let
leftController
=
SearchLeftController
()
...
...
@@ -29,11 +30,21 @@ public final class SearchContainerController: UIViewController {
navigationController
?
.
navigationBar
.
customize
(
backgroundColor
:
Asset
.
neutralWhite
.
color
)
if
let
contentOffset
=
self
.
contentOffset
{
screenView
.
scrollView
.
setContentOffset
(
contentOffset
,
animated
:
true
)
}
}
public
override
func
viewWillDisappear
(
_
animated
:
Bool
)
{
super
.
viewWillDisappear
(
animated
)
contentOffset
=
screenView
.
scrollView
.
contentOffset
}
public
override
func
viewDidAppear
(
_
animated
:
Bool
)
{
super
.
viewDidAppear
(
animated
)
viewModel
.
didAppear
()
rightController
.
viewModel
.
viewWillAppear
()
}
public
override
func
viewDidLoad
()
{
...
...
@@ -68,7 +79,6 @@ public final class SearchContainerController: UIViewController {
let
point
=
CGPoint
(
x
:
screenView
.
frame
.
width
,
y
:
0.0
)
screenView
.
scrollView
.
setContentOffset
(
point
,
animated
:
true
)
leftController
.
endEditing
()
rightController
.
viewModel
.
viewWillAppear
()
}
else
{
screenView
.
scrollView
.
setContentOffset
(
.
zero
,
animated
:
true
)
leftController
.
viewModel
.
didSelectItem
(
$0
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment