Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion AnimatedTextInput/Classes/AnimatedTextInput.swift
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ open class AnimatedTextInput: UIControl {
}
}

fileprivate let lineView = AnimatedLine()
public let lineView = AnimatedLine()
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Although this works, I would prefer having 2 new methods than making the line public. Something like:
func hideLine(animated: Bool)
Internally this would either call isHidden or fillLine(with: UIColor.clear).

func showLine(animated: Bool)
Internally this would either call isHidden = false or fillLine(with: style.lineColor)

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

thanks

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

can't be this solve just by making an open var?? e.g.

    open var lineViewHidden: Bool = false {
        didSet {
            if lineViewHidden {
                lineView.fillLine(with: UIColor.clear)
            } else {
                lineView.fillLine(with: style.lineActiveColor)
            }
        }
    }

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Sure, that will work as well.
My concern about making lineView public was that we would be exposing implementation details that should be private.

fileprivate let placeholderLayer = CATextLayer()
fileprivate let counterLabel = UILabel()
fileprivate let lineWidth: CGFloat = 1.0 / UIScreen.main.scale
Expand Down