Skip to content
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

Babacros todayextension #17

Open
wants to merge 22 commits into
base: babacros
Choose a base branch
from

Conversation

babacros
Copy link

No description provided.

view.addSubview(balanceStack)

let balanceTitle = UILabel()
// we are not able to use swiftgen, because of retain cycle
Copy link
Contributor

Choose a reason for hiding this comment

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

❔ Jaký retain cycle máš na mysli?

Copy link
Author

Choose a reason for hiding this comment

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

Kompilátor hlásí rectain cycle, pokud přidám file s vygenerovanými enumy k targetu. Doplním do komentáře.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ja spis neverim, ze se ti tohle deje 😊

import Result

class TodayViewController: UIViewController, NCWidgetProviding {
private weak var isicImageView: UIButton?
Copy link
Contributor

Choose a reason for hiding this comment

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

❔ má nějaký důvod proč použít UIButton? místo UIButton!?

Copy link
Author

Choose a reason for hiding this comment

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

Ne, nejspíš moje nepozornost.


// MARK: - Bindings

func setupBindings() {
Copy link
Contributor

Choose a reason for hiding this comment

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

❕ co může být private nechť je private

}

let isicImage = UIImage(named: "todayExtension")
let isicImageView = UIButton(type: .custom)
Copy link
Contributor

Choose a reason for hiding this comment

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

❗️ pojmenovat něco isicImageView, když je to instance UIButton, je velice špatné

Copy link
Author

Choose a reason for hiding this comment

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

Jo on to byl první imageView, ale předělal jsem na button a nechal původní jméno.


// MARK: - Actions

@objc func isicImageTapped() {
Copy link
Contributor

Choose a reason for hiding this comment

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

konvence vypadá takto:

@objc
private func isicImageTapped(sender: UIButton) {
    // Implementation
}

Copy link
Author

Choose a reason for hiding this comment

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

Ok, začnu používat :)

}

protocol TodayViewModelingActions {
var getBalance: Action<(),Balance,RequestError> { get }
Copy link
Contributor

Choose a reason for hiding this comment

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

konvence: Action<Void, Balance, RequestError> { get }

Copy link
Author

Choose a reason for hiding this comment

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

Dobrá :)


let balance: Property<Int>
let localeBalance: Property<String>
let getBalance: Action<(),Balance,RequestError>
Copy link
Contributor

Choose a reason for hiding this comment

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

konvence viz výše

final class TodayViewModel: BaseViewModel, TodayViewModeling, TodayViewModelingActions {
typealias Dependencies = HasRequestManager

let balance: Property<Int>
Copy link
Contributor

Choose a reason for hiding this comment

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

❔ používáš někde balance jako Int?

Copy link
Author

Choose a reason for hiding this comment

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

Používám. Cpu ho numberFormatteru

Copy link
Contributor

Choose a reason for hiding this comment

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

Zvenku ho cpes do numberFormatteru nebo jenom interne ve viewModelu?

Podfile Outdated

target 'ISICbalanceExtension' do
# UI
pod 'SnapKit', '~> 4.0'
Copy link
Contributor

Choose a reason for hiding this comment

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

vyupdatuj závislosti, máš tu spoustu zastaralých verzí

Podfile Outdated
pod 'ACKategories', '~> 6.0'
pod 'Alamofire', '~> 4.0'
pod 'SwiftSoup', '~> 1.7'
pod 'SwiftKeychainWrapper', '~> 3.2'
Copy link
Contributor

Choose a reason for hiding this comment

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

pokud máš více targetů, které sdílejí stejné závislosti, můžeš si v Podfilu vytvořit globální funkci a v ní jednotlivé závislosti vypsat

def shared_pods
    pod 'SnapKit', '~> 5.0'
    pod 'ReactiveSwift', '~> 5.0'
end

potom pro každý target můžeš zavolat

target 'ISICbalanceExtension' do
    shared_pods
end

Podfile.lock Outdated
SwiftSoup: 92f5b348c131aed8af04f4326db1579ab19fa08c

PODFILE CHECKSUM: cab1eaf6010bbd2bcccbce071e41555f9c529f8c
PODFILE CHECKSUM: 5aeffec0e081013dde4c9372a1aea3b6a96466f8

COCOAPODS: 1.7.1
Copy link
Contributor

Choose a reason for hiding this comment

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

A pouzivas starou verzi Cocoapods

@@ -19,7 +18,7 @@ protocol AccountViewModeling {
}

protocol AccountViewModelingActions {
var login: Action<(),(),LoginError> { get }
var login: Action<Void,Void,LoginError> { get }
Copy link
Contributor

Choose a reason for hiding this comment

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

ještě mezery a bude to 🔝 nejlepší by bylo, kdybys nasadil Swiftlint

import ReactiveSwift
import ACKReactiveExtensions

class TodayViewController: UIViewController, NCWidgetProviding {
Copy link
Contributor

Choose a reason for hiding this comment

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

💡 co může být final nechť je final

self.balanceLabel = balanceLabel
balanceStack.addArrangedSubview(balanceLabel)

balanceStack.snp.makeConstraints { make in
Copy link
Contributor

Choose a reason for hiding this comment

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

přesuň layoutování tam, kde vytváříš balanceStack, takhle to není moc přehledné

// MARK: - Bindings

private func setupBindings() {
balanceLabel?.reactive.text <~ viewModel.localeBalance
Copy link
Contributor

@LukasHromadnik LukasHromadnik Jul 1, 2019

Choose a reason for hiding this comment

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

❔ proč tady může být otazník, když je to nahoře zadefinováno jako UILabel!? A jaký to má rozdíl proti tomu, když tam ten otazník nebude?

}
}

extension Int {
Copy link
Contributor

Choose a reason for hiding this comment

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

❕ přesunul bych extensionu do vlastního filu


COCOAPODS: 1.7.1
COCOAPODS: 1.7.2
Copy link
Contributor

Choose a reason for hiding this comment

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

zajímavý je, že je venku už 1.7.3 😄

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