Skip to content

handleCustomTap not working #428

Open
@Duchv2008

Description

@Duchv2008
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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions