Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Label ios14 #80

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
Open

Label ios14 #80

wants to merge 12 commits into from

Conversation

BaniChan
Copy link
Contributor

@BaniChan BaniChan requested a review from kevinwl02 as a code owner May 26, 2021 02:10
/// - Parameters:
/// - title: The LocalizedStringKey of right part text of the label
/// - icon: The visual representation of left part image of the label
@available(iOS 14.0, *)
Copy link
Contributor

@kevinwl02 kevinwl02 Jun 1, 2021

Choose a reason for hiding this comment

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

Why are these 3 inits iOS14 available? I think you should be able to remove this constraint.

private func setupView(_ view: UIStackView, context: Context) {
guard let labelStyleType = context.viewValues?.labelStyle?.labelStyleType else { return }

context.viewOperationQueue.addOperation {
Copy link
Contributor

Choose a reason for hiding this comment

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

It's not necessary to use the operation queue in this case.

Note: The operation queue main purpose is to flatten view hierarchy updates that would add strain to the call stack causing potential stack overflows. Usually this is used when you want to call updateView of children views.


public func createView(context: Context) -> UIView {
let hstack = HStack {
Spacer()
Copy link
Contributor

Choose a reason for hiding this comment

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

It seems this view always expands horizontally and always centered. Please confirm this behavior.

import UIKit

@available(iOS 14.0, *)
public typealias LocalizedStringKey = String
Copy link
Contributor

Choose a reason for hiding this comment

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

I think you can remove the constraint for this typealias

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants