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

handleCustomTap not working #428

Open
Duchv2008 opened this issue Oct 19, 2023 · 0 comments
Open

handleCustomTap not working #428

Duchv2008 opened this issue Oct 19, 2023 · 0 comments

Comments

@Duchv2008
Copy link

private func setupPolicyTermOfUse() {
        let termOfUseType = ActiveType.custom(pattern: "\\sTerms of use\\b")
        let policyType = ActiveType.custom(pattern: "\\sPrivacy policy\\b")

        policyAndTermOfUseLb.enabledTypes = [termOfUseType, policyType]
        policyAndTermOfUseLb.isUserInteractionEnabled = true

        policyAndTermOfUseLb.customize { [weak self] label in
            guard let self = self else { return }
            label.text = "We secure your data inline with our Terms of use and Privacy policy"

            label.customSelectedColor[termOfUseType] = UIColor.green
            label.customSelectedColor[policyType] = UIColor.green

            label.handleCustomTap(for: termOfUseType) { element in
                self.openTermOfUse()
            }
            label.handleCustomTap(for: policyType) { element in
                self.openPolicy()
            }
            label.handleCustomTap(for: ActiveType.custom(pattern: "\\sTerms of use\\b")) { _ in
                print("Custom type tapped policyType")
            }
        }
    }

    private func openTermOfUse() {
        print("Custom type tapped termOfUseType")
    }

    private func openPolicy() {
        print("Custom type tapped termOfUseType")
    }

handleCustomTap not excute handle tap

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