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
71123aab
Commit
71123aab
authored
2 years ago
by
Dariusz Rybicki
Browse files
Options
Downloads
Patches
Plain Diff
Improve show/hide HUD
Schedule operations on main queue
parent
1e75ffe6
No related branches found
No related tags found
1 merge request
!98
Fix invitation deep link handling
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Sources/HUDFeature/HUDManager.swift
+11
-6
11 additions, 6 deletions
Sources/HUDFeature/HUDManager.swift
Sources/HUDFeature/HUDPresenter.swift
+0
-1
0 additions, 1 deletion
Sources/HUDFeature/HUDPresenter.swift
with
11 additions
and
7 deletions
Sources/HUDFeature/HUDManager.swift
+
11
−
6
View file @
71123aab
...
@@ -19,18 +19,23 @@ public struct HUDManager {
...
@@ -19,18 +19,23 @@ public struct HUDManager {
extension
HUDManager
{
extension
HUDManager
{
public
static
func
live
()
->
HUDManager
{
public
static
func
live
()
->
HUDManager
{
let
subject
=
PassthroughSubject
<
HUDModel
?,
Never
>
()
let
subject
=
PassthroughSubject
<
HUDModel
?,
Never
>
()
@Dependency
(\
.
mainQueue
)
var
mainQueue
return
HUDManager
(
return
HUDManager
(
show
:
.
init
{
model
in
show
:
.
init
{
model
in
let
model
=
model
??
HUDModel
(
hasDotAnimation
:
true
)
mainQueue
.
schedule
{
subject
.
send
(
model
)
let
model
=
model
??
HUDModel
(
hasDotAnimation
:
true
)
if
model
.
isAutoDismissable
{
subject
.
send
(
model
)
DispatchQueue
.
main
.
asyncAfter
(
deadline
:
.
now
()
+
2
)
{
if
model
.
isAutoDismissable
{
subject
.
send
(
nil
)
mainQueue
.
schedule
(
after
:
mainQueue
.
now
.
advanced
(
by
:
2
))
{
subject
.
send
(
nil
)
}
}
}
}
}
},
},
hide
:
{
hide
:
{
subject
.
send
(
nil
)
mainQueue
.
schedule
{
subject
.
send
(
nil
)
}
},
},
observe
:
{
observe
:
{
subject
.
eraseToAnyPublisher
()
subject
.
eraseToAnyPublisher
()
...
...
This diff is collapsed.
Click to expand it.
Sources/HUDFeature/HUDPresenter.swift
+
0
−
1
View file @
71123aab
...
@@ -6,7 +6,6 @@ import SwiftUI
...
@@ -6,7 +6,6 @@ import SwiftUI
public
final
class
HUDPresenter
{
public
final
class
HUDPresenter
{
public
init
()
{
public
init
()
{
hudManager
.
observe
()
hudManager
.
observe
()
.
receive
(
on
:
DispatchQueue
.
main
)
.
sink
{
[
unowned
self
]
model
in
.
sink
{
[
unowned
self
]
model
in
if
let
model
=
model
{
if
let
model
=
model
{
show
(
model
)
show
(
model
)
...
...
This diff is collapsed.
Click to expand it.
Dariusz Rybicki
@darrarski.xx
mentioned in commit
0b14a376
·
2 years ago
mentioned in commit
0b14a376
mentioned in commit 0b14a37655733b87e92435fb09d951712b5d5497
Toggle commit list
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