ScrollStackController icon indicating copy to clipboard operation
ScrollStackController copied to clipboard

Row Highlight Issue

Open Andy0570 opened this issue 2 years ago • 0 comments

When I set a default callback for onTap property on ScrollStackRow instances. And set ScrollStackRowHighlightable for UIViewController instance, row highlight color is not work.

Example Code

I tested it on the official example.

ScrollStackController/ScrollStackControllerDemo/ViewController.swift

...
stackView.addRows(controllers: [welcomeVC, notesVC, tagsVC, galleryVC, pricingVC], animated: false)

// Add callback for `onTap` property for first row
stackView.firstRow?.onTap = { row in
    print("First Row Tapped!")
}

ScrollStackController/Child View Controllers/WelcomeVC.swift

extension WelcomeVC: ScrollStackRowHighlightable {
    public var isHighlightable: Bool {
        print("Func: \(#function), line: \(#line)")
        return true
    }

    public func setIsHighlighted(_ isHighlighted: Bool) {
        print("Func: \(#function), line: \(#line)")
        self.view.backgroundColor = (isHighlighted ? .red : .white)
    }
}

Andy0570 avatar Dec 08 '23 06:12 Andy0570