Skip to content
This repository was archived by the owner on Jan 16, 2026. It is now read-only.
This repository was archived by the owner on Jan 16, 2026. It is now read-only.

SetTitleVisible ignores completion flag from UIView function #110

@miradesne

Description

@miradesne

In the code setTitleVisible(animated:):

if animated {
            let animationOptions:UIViewAnimationOptions = .curveEaseOut;
            let duration = self.isTitleVisible() ? titleFadeInDuration : titleFadeOutDuration

            UIView.animate(withDuration: duration, delay: 0, options: animationOptions, animations: { () -> Void in
                updateBlock()
                }, completion: { _ in
                    completion?()
                })
        } else {
            updateBlock()
            completion?()
        }

The function just ignored the flag from:

class func animate(withDuration duration: TimeInterval, 
        animations: @escaping () -> Void, 
        completion: ((Bool *completed*) -> Void)? = nil)

and calls the completion call regardless if the animation is cancelled. It caused a bug where we want to only set some thing if the animation is completed (instead of cancelled).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions