SwiftEntryKit icon indicating copy to clipboard operation
SwiftEntryKit copied to clipboard

Dynamic LabelContent inside EKImageNoteMessageView

Open charvoa opened this issue 6 years ago • 8 comments

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

charvoa avatar Aug 30 '18 12:08 charvoa

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 avatar Aug 31 '18 15:08 huri000

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

kylebrowning avatar Feb 13 '19 17:02 kylebrowning

@huri000 bump.

kylebrowning avatar Apr 09 '19 00:04 kylebrowning

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 avatar Apr 09 '19 05:04 huri000

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

kylebrowning avatar Apr 09 '19 15:04 kylebrowning

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.

albert102000 avatar Jun 01 '19 22:06 albert102000

Thanks @albert102000 ! Might give it a try this week !

charvoa avatar Jun 02 '19 16:06 charvoa

Is there any update on this?

bkunarola avatar Jul 26 '19 05:07 bkunarola