Skip to content

Conversation

@flyingBear66
Copy link
Owner

No description provided.

flyingBear66 and others added 5 commits April 22, 2019 23:22
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 {
Copy link
Collaborator

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.

Copy link
Owner Author

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?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just adding

Suggested change
class Session {
private init() {
}

if your class can only be used on ' shared ' variable.

Comment on lines +36 to +43
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 {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

inline guard with ,

Copy link
Owner Author

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?

Suggested change
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 }

Copy link
Collaborator

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 }

Comment on lines +56 to +60
guard let viewController = Session.shared.currentViewController else {
return
}

guard let navigationController = viewController.navigationController else {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+inline

Copy link
Owner Author

@flyingBear66 flyingBear66 Jan 12, 2020

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?

Suggested change
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 {
Copy link
Collaborator

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.

@flyingBear66 flyingBear66 added enhancement New feature or request onProgress labels Jan 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request onProgress

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants