-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add submitting and loading states for submission button
Showing
10 changed files
with
225 additions
and
127 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
PlatformParticles/PlatformParticles/_Actions/DismissPresentedAction.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// | ||
// DismissPresentedAction.swift | ||
// PlatformParticles | ||
// | ||
// Created by Mike Maguire on 9/15/24. | ||
// Copyright © 2024 dYdX. All rights reserved. | ||
// | ||
|
||
import ParticlesKit | ||
import RoutingKit | ||
import Utilities | ||
|
||
public class DismissPresentedActionBuilder: NSObject, ObjectBuilderProtocol { | ||
public func build<T>() -> T? { | ||
let action = DismissPresentedAction() | ||
return action as? T | ||
} | ||
} | ||
|
||
private class DismissPresentedAction: NSObject, NavigableProtocol { | ||
@objc open func navigate(to request: RoutingRequest?, animated: Bool, completion: RoutingCompletionBlock?) { | ||
if request?.path == "/action/dismiss_presented" { | ||
let viewController = UIViewController.topmost() | ||
if viewController?.presentingViewController !== nil { | ||
viewController?.dismiss(animated: true, completion: { | ||
completion?(nil, true) | ||
}) | ||
} | ||
} else { | ||
completion?(nil, false) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.