-
Notifications
You must be signed in to change notification settings - Fork 0
Add Whisper Display Message Pod #41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
Merge PR with issue to Master
# Conflicts: # LibrariesPrototype.xcodeproj/project.pbxproj # LibrariesPrototype/Navigation.swift # LibrariesPrototype/Screens/Main/ViewModels/MainViewModel.swift # Podfile # Podfile.lock # Pods/Manifest.lock # Pods/Pods.xcodeproj/project.pbxproj # Pods/Target Support Files/Alamofire/Alamofire-Info.plist # Pods/Target Support Files/Pods-LibrariesPrototype/Pods-LibrariesPrototype-acknowledgements.markdown # Pods/Target Support Files/Pods-LibrariesPrototype/Pods-LibrariesPrototype-acknowledgements.plist # Pods/Target Support Files/Pods-LibrariesPrototype/Pods-LibrariesPrototype-frameworks.sh # Pods/Target Support Files/Pods-LibrariesPrototype/Pods-LibrariesPrototype.debug.xcconfig # Pods/Target Support Files/Pods-LibrariesPrototype/Pods-LibrariesPrototype.release.xcconfig # Pods/Target Support Files/Pods-LibrariesPrototypeTests/Pods-LibrariesPrototypeTests.debug.xcconfig # Pods/Target Support Files/Pods-LibrariesPrototypeTests/Pods-LibrariesPrototypeTests.release.xcconfig # Pods/Target Support Files/Pods-LibrariesPrototypeUITests/Pods-LibrariesPrototypeUITests.debug.xcconfig # Pods/Target Support Files/Pods-LibrariesPrototypeUITests/Pods-LibrariesPrototypeUITests.release.xcconfig # Pods/Target Support Files/RxCocoa/RxCocoa-Info.plist # Pods/Target Support Files/RxSwift/RxSwift-Info.plist # Pods/Target Support Files/Swinject/Swinject.xcconfig
|
|
||
| import Foundation | ||
|
|
||
| class Session { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just a comment, private init looks nice on singleton.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
like what? Can you please write some here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just adding
| class Session { | |
| private init() { | |
| } |
if your class can only be used on ' shared ' variable.
| guard let viewController = Session.shared.currentViewController else { | ||
| return | ||
| } | ||
|
|
||
| // Show and hide a message after delay | ||
| // Whisper.show(whisper: message, to: navigationController, action: .show) | ||
|
|
||
| guard let navigationController = viewController.navigationController else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
inline guard with ,
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You mean like this, right?
| guard let viewController = Session.shared.currentViewController else { | |
| return | |
| } | |
| // Show and hide a message after delay | |
| // Whisper.show(whisper: message, to: navigationController, action: .show) | |
| guard let navigationController = viewController.navigationController else { | |
| guard let navigationController = viewController.navigationController else { return } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if we are just checking is it nil.
guard let viewController = Session.shared.currentViewController, let navigationController viewController.navigationController else { return }
| guard let viewController = Session.shared.currentViewController else { | ||
| return | ||
| } | ||
|
|
||
| guard let navigationController = viewController.navigationController else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+inline
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You mean like this, right?
| guard let viewController = Session.shared.currentViewController else { | |
| return | |
| } | |
| guard let navigationController = viewController.navigationController else { | |
| guard let navigationController = viewController.navigationController else { return } |
|
|
||
| import UIKit | ||
|
|
||
| enum WhisperMenuCase: Int { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as you already know enum auto increment can be used with negative numbers as well.
No description provided.