BastiaanJansen / toast-swift

Customizable Swift Toast view built with UIKit. 🍞
MIT License
489 stars 77 forks source link

UIStackView.init(frame:) must be used from main thread only #57

Open mehulparmar4ever opened 7 months ago

mehulparmar4ever commented 7 months ago

Screenshot 2024-02-19 at 12 00 02 PM

Nikoloutsos commented 7 months ago

Hello 👋 @mehulparmar4ever May you please provide more information on how you calling Toast-swift library (the calling site)?

mehulparmar4ever commented 7 months ago

@Nikoloutsos , Thank you for the reply, Here is what you are looking for..

XCode Version 15.2 (15C500b) Mac mini Apple M2 Pro with MacOS Sonoma 14.3.1 (23D60)

Usage,

AppAlert.shared.showToast(message: error.getLocalisedErrorMessage(), isWarning: true)
AppAlert.shared.showToast(message: LocalizedText.getText(key: .codeSMS))

on main thread,

func main_thread(closure:@escaping ()->()) {
        let when = DispatchTime.now()
        DispatchQueue.main.asyncAfter(deadline: when, execute: closure)
}

Screenshot 2024-02-20 at 12 27 07 PM