Skip to content

Conversation

@MaxCode2023
Copy link
Owner

No description provided.

case .failure:
UIBlockingProgressHUD.dismiss()
print("failure fetchProfile")
break
Copy link

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
Copy link

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
Copy link

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 {
Copy link

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)!)
Copy link

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
Copy link

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/keyEncodingStrategyhttps://developer.apple.com/documentation/foundation/jsondecoder/keydecodingstrategy/convertfromsnakecase


static let shared = ProfileImageService()

static let DidChangeNotification = Notification.Name(rawValue: "ProfileImageProviderDidChange")
Copy link

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")
Copy link

Choose a reason for hiding this comment

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

нет обработки ошибки

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants