Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Row Highlight Issue #27

Open
Andy0570 opened this issue Dec 8, 2023 · 0 comments
Open

Row Highlight Issue #27

Andy0570 opened this issue Dec 8, 2023 · 0 comments

Comments

@Andy0570
Copy link

Andy0570 commented Dec 8, 2023

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)
    }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant