bastiaanjansen / toast-swift Goto Github PK
View Code? Open in Web Editor NEWCustomizable Swift Toast view built with UIKit. ๐
License: MIT License
Customizable Swift Toast view built with UIKit. ๐
License: MIT License
On Toast.swift, line 256 throws an error saying "Binary operator '>' cannot be applied to operands of type 'CGFloat' and 'Double'".
Is it possible to show chain of Toasts, each one under the previous one?
Thanks
On your code page you have an example for CustomToastView, could you add some sample code of what would go into the func createView(for toast: Toast).
/* Its not a issue its suggestion */
โ> it would be great if ya provide where to show toast like top, bottom, center .....
โ> toast need a dynamic height like what if your title and subtile have more then 3 lines ?
thank you... its suggestion not a complain ๐
I don't see where I can apply the dark style toast, there is no parameters ?
With the current version the closeTimer?.invalidate()
in the pan gesture handler is breaking the gesture with the following error: [SystemGestureGate] <0x143508050> Gesture: System gesture gate timed out.
. The gesture handler is then not called anymore and the toast is then frozen and is not disappearing anymore.
Does someone else has a similar behavior?
It tested it on Xcode 14.0.1, 14.1 - iOS 16 Simulator and device with SwiftUI and UIKit in a plain project.
If I remove the invalidation everything works well, but I cannot figure out why this happens.
This lib could be useful for visionOS apps. Haven't done a lot yet with visionOS apps but since some people already made visionOS precompile conditional statements, someone else could join in on this discussion.
Currently visionOS isn't listed as a supported platform in SwiftPM Package.swift
or Cocoapods podspec. (They were out of sync so I created PR #54 to fix that)
If the library works out of the box we could add visionOS platform support, but maybe other changes are needed to get it to work or to polish it.
Just wanted to start the discussion.
(I live in EU, no Apple Vision Pro for me ๐ญ)
what I read your code at "ToastConfiguration.swift" and did find this:
public struct ToastConfiguration {
...
public let view: UIView?
I'm not sure it will make memory at some condition.....
https://github.com/scalessec/Toast-Swift
There is a library with the same name, so wouldn't this be a problem??
I think there can be confusion for people.
https://github.com/danielgindi/Charts
In the case of the existing Charts library, there is a case where the name was changed to DGCharts because the name overlapped with the SwiftUI library.
I think it is worth adding some snapshot tests on the views.
That way we can be more confident merging PRs.
Also, we can add a Github action workflow for running the snapshot tests in every pull request.
IIRC github actions are free for open source project โค๏ธ
What do you think? @BastiaanJansen
Is there a way to know when the toast is dismissed? Something like a delegate or a callback?
Thinking of making a PR that will give the ability to choose the toast entering/exiting animation.
let config = ToastConfiguration(
direction: .up,
autoHide: true,
enablePanToClose: true,
displayTime: 5,
animationTime: 0.2
+ animationType: .slide
)
also fade
animation type can be an option.
What do you think ๐ค
The Toast
owns AppleToastView as ToastView
, and AppleToastView
owns Toast
after calling createView
Does it support l10n
I got problems attaching the toast to the top of the tabBar
without attach argument it show in the top of the view controller, I want it to show to the bottom of it
when trying
utilsUi.showToast(title: "tet", message: "test", attachTo: self.tabBarController?.tabBar)
I got crash
Great library. The problem is when enablePanToClose = true and direction = .bottom, when try to swipe from top to bottom - the whole app is trying to collapse (default for ios). Can you, please, add direction of swiping too?
Hello - Thanks for this, really like it.
A little feature request. Please could you implement an option in the config for a 'tap to dismiss' option?
Cheers :)
After the first popover pops up, click the button to pop up the second popover and repeat to N pop-ups. It's going to add up, the shadow looks heavy, and what I need is the first one to close when the second one pops up, so how do I do that?
It would be useful to let developer choose the background colour of the toast
The toast icon is the either black or white (depends on the mode).
Im not aware on if/how you can change the color.
Can I change font for Toast title?
No any information about this
Hello, I have a problem with compiling:
a resolved file is required when automatic dependency resolution is disabled and should be placed at /Volumes/workspace/repository/UOnLoad.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved. Running resolver because the following dependencies were added: 'toast-swift' (https://github.com/BastiaanJansen/toast-swift)2022-12-09 11:43:56.738 xcodebuild[4147:18228] Writing error result bundle to /var/folders/r0/yrl1s4f524n1lpryy_y16t2r0000gn/T/ResultBundle_2022-09-12_11-43-0056.xcresult
Our app is a hybrid SwiftUI / UIKit app that forces Dark Mode at all times.
I've tried everything to get the image to appear, but it is always just a blank spot. Even the sample code doesn't work:
let toast = Toast.default(
image: UIImage(systemName: "airpodspro")!,
title: "Airpods Pro",
subtitle: "Connected"
)
toast.show()
The toast shows up as expected, but with a blank area instead of an image.
Is it possible to customize the font family, text & background colors, etc?
Thanks for the awesome library!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.