Commit 1ea919be by Daniel Dahan

minor boolean cleanup

parent 7f344994
Subproject commit d3efdaff89c024fc977904c997574b2cd90047df
Subproject commit 1d49a5012d04f705557879f4e29770141022f8a7
......@@ -36,6 +36,7 @@ public enum EditorPlaceholderAnimation {
}
open class Editor: View {
/// Reference to textView.
public let textView = TextView()
/// A boolean indicating whether the textView is in edit mode.
......@@ -327,7 +328,7 @@ private extension Editor {
/// Notification handler for when text editing began.
@objc
func handleTextViewTextDidBegin() {
updateEditorState(animated: true)
updateEditorState(isAnimated: true)
}
/// Notification handler for when text changed.
......@@ -339,17 +340,17 @@ private extension Editor {
/// Notification handler for when text editing ended.
@objc
func handleTextViewTextDidEnd() {
updateEditorState(animated: true)
updateEditorState(isAnimated: true)
}
/// Updates editor.
func updateEditorState(animated: Bool = false) {
func updateEditorState(isAnimated: Bool = false) {
updatePlaceholderVisibility()
updatePlaceholderLabelColor()
updateDividerHeight()
updateDividerColor()
guard animated && isPlaceholderAnimated else {
guard isAnimated && isPlaceholderAnimated else {
layoutPlaceholderLabel()
return
}
......
......@@ -161,7 +161,7 @@ extension UIImage {
*/
open func crop(toWidth tw: CGFloat, toHeight th: CGFloat) -> UIImage? {
let g: UIImage?
let b: Bool = width > height
let b = width > height
let s: CGFloat = b ? th / height : tw / width
let t: CGSize = CGSize(width: tw, height: th)
......
......@@ -135,7 +135,7 @@ open class TextView: UITextView {
public let placeholderLabel = UILabel()
/// A property to enable/disable operations on the placeholderLabel
internal var isPlaceholderLabelEnabled: Bool = true
internal var isPlaceholderLabelEnabled = true
/// Placeholder normal text
@IBInspectable
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment