-
Couldn't load subscription status.
- Fork 0
Sprint 11 #3
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: main
Are you sure you want to change the base?
Sprint 11 #3
Conversation
| case .failure: | ||
| UIBlockingProgressHUD.dismiss() | ||
| print("failure fetchProfile") | ||
| break |
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.
break здесь не нужен
| self.present(alert, animated: true, completion: nil) | ||
|
|
||
| UIBlockingProgressHUD.dismiss() | ||
| break |
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.
break здесь не нужен
| // | ||
|
|
||
| import UIKit | ||
| import ProgressHUD |
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.
здесь не нужен импорт фреймворка. Частично в этом был смысл выделения отдельного файла-обертки над ProgressHUD
| override func viewDidAppear(_ animated: Bool) { | ||
| super.viewDidAppear(animated) | ||
|
|
||
| if let token = oauth2Service.authToken { |
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.
token не используется. Обращайте внимание на ворсинки и старайтесь относиться к ним как к ошибкам
| httpMethod: String, | ||
| baseURL: URL = DefaultBaseURL) -> URLRequest { | ||
|
|
||
| var request = URLRequest(url: URL(string: path, relativeTo: baseURL)!) |
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.
рекомендую избегать использования форс анрапов
| } | ||
|
|
||
| struct UserResult: Codable { | ||
| let profile_image: ImageResult |
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.
snake_case не используют при именовании полей в Swift. Используйте CodingKeys
Другой вариант - использовать keyDecodingStrategy/keyEncodingStrategy
https://developer.apple.com/documentation/foundation/jsondecoder/keydecodingstrategy/convertfromsnakecase
|
|
||
| static let shared = ProfileImageService() | ||
|
|
||
| static let DidChangeNotification = Notification.Name(rawValue: "ProfileImageProviderDidChange") |
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.
didChangeNotification
| self.switchToTabBarController() | ||
| case .failure: | ||
| UIBlockingProgressHUD.dismiss() | ||
| print("failure fetchProfile") |
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.
нет обработки ошибки
No description provided.