Comments (2)
Should be pretty easy to do in a fork. Here's how I'd do it:
Change the showToast:duration:position:
method in UIView+Toast.m to something like this:
- (void)showToast:(UIView *)toast duration:(NSTimeInterval)duration position:(id)point hidesOnTap:(BOOL)hidesOnTap;
Then in the showToast:duration:position:
method implementation, use hidesOnTap
to add the gesture recognizer instead of CSToastHidesOnTap
.
Then just update the makeToast constructors to include a hidesOnTap: parameter. Eg:
- (void)makeToast:(NSString *)message duration:(NSTimeInterval)duration position:(id)position title:(NSString *)title image:(UIImage *)image hidesOnTap:(BOOL)hidesOnTap;
i'm sure I missed a few things, but that should give you the idea. That should do the trick without needing to subclass.
from toast.
Oh, thanks! Yeah, this works great. I didn't think of adding a method parameter because I forgot the hidesOnTap
variable is needed on only one location so there's no need to store it.
from toast.
Related Issues (20)
- how to bind toast in RoboVM
- The position of activity view is not right HOT 1
- Xcode 10 error HOT 2
- Remove existing Toast HOT 1
- Problem on creating loading view with Toast
- Is there a way to block background view?
- 键盘会挡住 HOT 2
- Could not find module 'Toast_Swift' for target 'armv7-apple-ios'; found: arm64, arm64-apple-ios HOT 1
- Toast not working HOT 1
- makeToast got error HOT 1
- Toast is always showing at bottom
- can you add a setting accessibility?
- feature request: verticalOffset(s)
- Hello
- Is it possible to change the size (width height) of the toast?
- how to change activity color
- Privacy manifest required by Apple HOT 1
- Toast.podspec HOT 4
- how can i show a toast over keyboard? HOT 1
- about the PrivacyInfo.xcprivacy HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from toast.