Company logo
  • Jobs
  • Bootcamp
  • About Us
  • For professionals
    • Home
    • Jobs
    • Courses and challenges
    • Questions
    • Teachers
    • Bootcamp
  • For business
    • Home
    • Our process
    • Plans
    • Assessments
    • Payroll
    • Blog
    • Sales
    • Calculator

0

86
Views
Perform an action after an entry's button is pressed in SwiftEntryKit

I have added 2 buttons to my SwiftEntryKit popup but cannot figure out how to do something after a button is pressed.

I follow the pattern set with their example for alerts.

I tried entering something into the dismiss action, but it did not work:

// Ok Button
let okButtonLabelStyle = EKProperty.LabelStyle(font: buttonFont, color: buttonColor)
let okButtonLabel = EKProperty.LabelContent(text: "OK, ACCEPT", style: okButtonLabelStyle)
let okButton = EKProperty.ButtonContent(label: okButtonLabel, backgroundColor: .clear, highlightedBackgroundColor:  buttonColor.withAlphaComponent(0.05)) {
    SwiftEntryKit.dismiss {
        print("okButton")
    }

}

Thank you.

9 months ago · Santiago Trujillo
1 answers
Answer question

0

You have to set entryInteraction to .absorbTouches for the attributes property of SwiftEntryKit.display.

var attributes = EKAttributes()
attributes.entryInteraction = .absorbTouches

[...]

SwiftEntryKit.display(entry: <entry variable>, using: attributes)
9 months ago · Santiago Trujillo Report
Answer question
Find remote jobs