Skip to content

Conversation

@pepix
Copy link

@pepix pepix commented Jun 1, 2021

No description provided.

@pepix pepix requested a review from kevinwl02 as a code owner June 1, 2021 03:21
progressView.setProgress(progress ?? 0, animated: true)
}

if let uiStackView = view as? UIStackView {
Copy link
Contributor

Choose a reason for hiding this comment

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

you can add else to this if condition so the flow is clearer.

if let progressView = view as? UIProgressView {
} else if let uiStackView = view...

Copy link
Author

Choose a reason for hiding this comment

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

Fixed


extension ProgressView: Renderable {
public func createView(context: Context) -> UIView {
if (progress != nil) {
Copy link
Contributor

Choose a reason for hiding this comment

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

You can move this 4 view creation flows to a separate function each, and call them from this function, in order to make this one cleaner.

Copy link
Author

Choose a reason for hiding this comment

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

Fixed plz check

if (progress != nil) {
/// Determinate Progress View
if (title != nil) {
let titleView = UITextView()
Copy link
Contributor

Choose a reason for hiding this comment

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

You can use a UILabel instead of a TextView. A text view can have the contents edited directly by the user (I think this is not the intended behavior right?)

Copy link
Author

Choose a reason for hiding this comment

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

You're right. Fixed.

let indicatorView = UIActivityIndicatorView(style: .whiteLarge)
indicatorView.color = .gray
indicatorView.startAnimating()
let titleView = UITextView()
Copy link
Contributor

Choose a reason for hiding this comment

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

Same here, you can use a label

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