CocoaPods trunk is moving to be read-only. Read more on the blog, there are 18 months to go.
TestsTested | ✗ |
LangLanguage | SwiftSwift |
License | MIT |
ReleasedLast Release | Sep 2016 |
SPMSupports SPM | ✗ |
Maintained by David Tisserand.
A toast center inspired from TKAlertCenter (tapku library) for displaying quick toast to the user written in full swift with great animation.
Toasts are bounded to keyWindow to handle screen rotation and resize/move when keyboard is shown/hidden.
Embedded frameworks require a minimum deployment target of iOS 8 or OS X Mavericks.
For application targets that do not support embedded frameworks, such as iOS 7, DTIToastCenter can be integrated by including the
*.swift
source files directly.
cd
-ing into your top-level project directory, and entering the command git submodule add https://github.com/dtissera/DTIToastCenter-Swift.git
DTIToastCenter
folder, and drag DTIToastCenter.xcodeproj
into the file navigator of your app project.DTIToastCenter.framework
.+
button at the top left of the panel and select “New Copy Files Phase”. Rename this new phase to “Copy Frameworks”, set the “Destination” to “Frameworks”, and add DTIToastCenter.framework
.objc target
, flag Embedded Content Contains Swift Code
in the Build Settings
needs to be set to YES
.Initialize center in your application delegate to listen keyboard events
Register center
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// Override point for customization after application launch.
[[DTIToastCenter defaultCenter] registerCenter];
return YES;
}
Post alert with text
[[DTIToastCenter defaultCenter] makeText:@"Hey! This is the toast system."];
Post alert with image
[[DTIToastCenter defaultCenter] makeImage:[UIImage imageNamed:@"swift"]];
Post alert with image and text
[[DTIToastCenter defaultCenter] makeText:@"Toast with image !" image:[UIImage imageNamed:@"swift"]];