SwiftEntryKit
SwiftEntryKit copied to clipboard
Dynamic LabelContent inside EKImageNoteMessageView
Is your feature request related to a problem? Please describe. I'd like to display a notification like ; "4:25mn remaining on your subscription" and the '4:25mn' should be updated every second
Describe the solution you'd like An update function, like :
banner.update(labelContent content: String) {}
///
Is it possible to do it with the current library ?
Thanks
Hi @charvoa, Sorry, but that is not currently possible. SwiftEntryKit doesn't support that level of customization for its presets, and probably won't be in future. But - you can fork and customize its presets (or alternatively create your own) to suit your needs.
@huri000 I dont want to open an old ticket, but very curious why this wont ever happen?
Its seems pretty trivial to make things var's instead of lets....
@huri000 bump.
Apologies, @kylebrowning. This seemed to have escaped me.
The data is 'fed' to preset views using their corresponding structures, not directly to the UI properties (e.g labels, images). I don't want to publicly expose UI properties, but I could maybe create a computed property to access labels' text
. Let me think it a bit longer.
In the meantime, reopening.
@huri000 Thanks. I can think of the following use cases.
- Button text change once a button is a select. (So we don't have to dismiss)
- Button text change and then being enabled. (Think like a 3 second countdown before you can select ok)
- Title/body text change after button selection before it gets dismissed
- Countdown timers inside the description
I understand all of this can be done with Custom Views but adding in some sort of Dynamic LabelContent
would allow some flexibility and overrides.
I managed to work around this as follows:
showSignupForm(titleText: "Please fill in your info", by: [.fullName, .mobile, .email, .password], action: {
if let topController = UIApplication.shared.keyWindow?.rootViewController,
let view = topController.view.viewWithTag(392) as? EKFormMessageView,
let scrollView = view.subviews[0] as? UIScrollView,
let formTitleLabel = scrollView.viewWithTag(200) as? UILabel {
view.shake(duration: 0.5)
formTitleLabel.text = "Wrong Email"
}
})
Far from an ideal solution - it also required me to set the tags for the titleLabel
in the EKFormMessageView
and the EKFormMessageView
itself...just thought I'd drop this here for anyone looking for a quick solution.
The use case here was to have access to the title label when the button on the form is pressed so that any error messages can be displayed in the title label.
Thanks @albert102000 ! Might give it a try this week !
Is there any update on this?