Skip to content

Swift messages not working in Swift UI  #327

@Mteixeira88

Description

@Mteixeira88

Hi there,

I'm trying to use Swift Messages on Swift UI and for some reason it's not showing

This is the code I'm trying to use:

.onAppear() {
         
 let view = MessageView.viewFromNib(layout: .cardView)
               
view.configureTheme(.warning)
                
view.configureDropShadow()
                
let iconText = ["🤔", "😳", "🙄", "😶"].randomElement()!
                
view.configureContent(title: "Warning", body: "Consider yourself warned.", iconText: iconText)

                view.layoutMarginAdditions = UIEdgeInsets(top: 20, left: 20, bottom: 20, right

                (view.backgroundView as? CornerRoundingView)?.cornerRadius = 10

                SwiftMessages.show(view: view)

        }

I already tried to use in a button click and it didn't work.
Can you help?
Thanks

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions