All Projects → SimformSolutionsPvtLtd → Sstoastmessage

SimformSolutionsPvtLtd / Sstoastmessage

Licence: mit
SSToastMessage is written purely in SwiftUI. It will add toast, alert, and floating message view over the top of any view. It is intended to be simple, lightweight, and easy to use. It will be a popup with a single line of code.

Programming Languages

swift
15916 projects

Projects that are alternatives of or similar to Sstoastmessage

Color
Color utilities for macOS, iOS, tvOS, and watchOS
Stars: ✭ 145 (+76.83%)
Mutual labels:  cocoapods, spm
Ftindicator
A light wight UI package contains local notification, progress HUD, toast, with blur effect, elegant API and themes support.
Stars: ✭ 292 (+256.1%)
Mutual labels:  cocoapods, toast
Modernavplayer
ModernAVPlayer is a persistence AVPlayer wrapper
Stars: ✭ 179 (+118.29%)
Mutual labels:  cocoapods, spm
Sparse
Sparse is a simple parser-combinator library written in Swift.
Stars: ✭ 104 (+26.83%)
Mutual labels:  cocoapods, spm
Validatedpropertykit
Easily validate your Properties with Property Wrappers 👮
Stars: ✭ 701 (+754.88%)
Mutual labels:  cocoapods, spm
Buymeacoffee
Buy Me a Coffee framework for iOS
Stars: ✭ 145 (+76.83%)
Mutual labels:  cocoapods, spm
Aksidemenu
Beautiful iOS side menu library with parallax effect. Written in Swift
Stars: ✭ 216 (+163.41%)
Mutual labels:  cocoapods, spm
Swiftuiblurview
This view is also part of SwiftUIKit: https://github.com/danielsaidi/SwiftUIKit
Stars: ✭ 120 (+46.34%)
Mutual labels:  cocoapods, spm
Bow
🏹 Bow is a cross-platform library for Typed Functional Programming in Swift
Stars: ✭ 538 (+556.1%)
Mutual labels:  cocoapods, spm
Simpleimageviewer
A snappy image viewer with zoom and interactive dismissal transition.
Stars: ✭ 408 (+397.56%)
Mutual labels:  cocoapods, spm
Sheeeeeeeeet
Sheeeeeeeeet is a Swift library for creating menus, custom action sheets, context menus etc.
Stars: ✭ 1,177 (+1335.37%)
Mutual labels:  cocoapods, spm
Swiftysound
SwiftySound is a simple library that lets you play sounds with a single line of code.
Stars: ✭ 995 (+1113.41%)
Mutual labels:  cocoapods, spm
Shsearchbar
The search bar that doesn't suck.
Stars: ✭ 206 (+151.22%)
Mutual labels:  cocoapods, spm
Gzipswift
Swift framework that enables gzip/gunzip Data using zlib
Stars: ✭ 356 (+334.15%)
Mutual labels:  cocoapods, spm
Parsel
Create complex parsers by combining simple ones with Parsel!
Stars: ✭ 21 (-74.39%)
Mutual labels:  cocoapods, spm
Sketchkit
A lightweight auto-layout DSL library for iOS & tvOS.
Stars: ✭ 40 (-51.22%)
Mutual labels:  cocoapods, spm
Localizationkit ios
Realtime Dynamic localization translation delivery system for iOS and Mac OSX in Swift. Create and update texts from localization.com without needing to recompile or redeploy. Cocapod for iOS devices (iPad, iPhone, iPod Touch and Mac)
Stars: ✭ 1,206 (+1370.73%)
Mutual labels:  cocoapods
Realm Loginkit
A generic interface for logging in to Realm Mobile Platform apps
Stars: ✭ 70 (-14.63%)
Mutual labels:  cocoapods
Ktoast
Customizable toast messages.
Stars: ✭ 70 (-14.63%)
Mutual labels:  toast
Silentscrolly
Scroll to hide navigationBar, tabBar and toolBar.
Stars: ✭ 79 (-3.66%)
Mutual labels:  cocoapods

SSToastMessage

CocoaPods Version Platform License swiftUI Swift Version PRs Welcome Twitter

SSToastMessage is written in SwiftUI. It will add toast, alert, and floating message view over the top of any view. It is intended to be simple, lightweight, and easy to use. It will be a popup with a single line of code.

Screenshots

SSToastMessage Screenshots

Setup Instructions

CocoaPods

To integrate Toast-Swift into your Xcode project using CocoaPods, specify it in your Podfile:

pod 'SSToastMessage', '~> 1.0.0'

and in your code add import SSToastMessage.

Swift Package Manager

When using Xcode 11 or later, you can install SSToastMessage by going to your Project settings > Swift Packages and add the repository by providing the GitHub URL. Alternatively, you can go to File > Swift Packages > Add Package Dependencies...

Manually

  1. Add MessageView.swift, DispatchWorkHolder.swift and View+Extension.swift to your project.
  2. Grab yourself a cold 🍺.

Requirements

  • iOS 13+
  • Xcode 11+

Usage

  1. Put all your body code into a ZStack, VStack, or HStack.
  2. Add a binding bool to control popup presentation state
  3. Add .present modifier to your stack
  4. If you are using NavigationBar or Custom Navigation view then add .present modifier to NavigationBar or Custom Navigation view.

Basic Examples

struct ContentView: View {
    @State var showToast = false
    var body: some View {
        VStack {
            // your screen main stack
            Button(action: {
                self.showToast.toggle()
            }) {
                Text("Show Toast")
                    .foregroundColor(.black)
            }
        }
        .present(isPresented: self.$showToast, type: .toast, position: .top) {
           /// create your own view for toast
            self.createTopToastView()
        }
    }
    
    func createTopToastView() -> some View {
        VStack {
            Spacer(minLength: 20)
            HStack() {
                Image("mike")
                    .resizable()
                    .aspectRatio(contentMode: ContentMode.fill)
                    .frame(width: 50, height: 50)
                    .cornerRadius(25)

                VStack(alignment: .leading, spacing: 2) {
                    HStack {
                        Text("Mike")
                            .foregroundColor(.white)
                            .fontWeight(.bold)
                        Spacer()
                        Text("10:10")
                            .font(.system(size: 12))
                            .foregroundColor(Color(red: 0.9, green: 0.9, blue: 0.9))
                    }

                    Text("Hey, Don't miss the WWDC on tonight at 10 AM PST.")
                        .lineLimit(2)
                        .font(.system(size: 14))
                        .foregroundColor(.white)
                }
            }.padding(15)
        }
        .frame(width: UIScreen.main.bounds.width, height: 110)
        .background(Color(red: 0.85, green: 0.65, blue: 0.56))
    }
}



Way easy to customize!

Required parameters

presented - binding to determine if the message view should be seen on-screen or hidden
view - view you want to display on your message view

Available customizations - optional parameters

Element Declaration Description
type type: MessageType set type of view alert, toast and float.
position position: Position top or bottom (for default case it just determines animation direction).
animation animation: Animation custom animation for message view sliding onto screen.
autohideDuration autohideDuration: Double? time after which message view should disappear.
closeOnTap closeOnTap: Bool on message view tap it should disappear.
onTap onTap: () -> Void on message view tap perform any action or navigation.
closeOnTapOutside closeOnTapOutside: Bool on outside tap message view should disappear.

See the demo project for more examples.

🗂 Check out our other libraries→

MIT License

Copyright (c) 2020 Simform Solutions

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES, OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].