Contents

hckim96/basictoast

BasicToast is a library shows basic toast on the view.

Description

BasicToast is a library shows basic toast on the view.

Demo App

To run the example project, clone the repo, and run pod install from the Example directory first.

<p> <img src="https://user-images.githubusercontent.com/62205797/174001852-29094ac8-11c5-47c9-81e4-ad679c078193.png" width="30%"> <img src="https://user-images.githubusercontent.com/62205797/174001862-41a44996-31c4-499d-90b4-3ffacc77ec0e.png" width="30%"> <img src="https://user-images.githubusercontent.com/62205797/174001871-c6dbd487-23d4-4a19-8b3a-95e139fd90ab.png" width="30%"> </p>

Example

//
//  ViewController.swift
//  BasicToast
//
//  Created by 62205797 on 06/16/2022.
//  Copyright (c) 2022 62205797. All rights reserved.
//

import UIKit
import BasicToast
class ViewController: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()
        // Do any additional setup after loading the view, typically from a nib.
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }

    @IBAction func topTabbed(_ sender: Any) {
        if #available(iOS 13.0, *) {
            BasicToast.show(self: self, message: "this is a top toast", duration: 3.0, position: .top)
        } else {
            // Fallback on earlier versions
        }
    }
    
    @IBAction func middleTabbed(_ sender: Any) {
        if #available(iOS 13.0, *) {
            BasicToast.show(self: self, message: "this is a middle toast", duration: 3.0, position: .middle)
        } else {
            // Fallback on earlier versions
        }
    }

    @IBAction func bottomTabbed(_ sender: Any) {
        if #available(iOS 13.0, *) {
            BasicToast.show(self: self, message: "this is a bottom toast", duration: 3.0, position: .bottom)
        } else {
            // Fallback on earlier versions
        }
    }

}

Feature

BasicToast.show(self: UIViewController, message: String, duration: TimeInterval = 5.0, position: pos = .bottom, font: UIFont = UIFont.systemFont(ofSize: 14.0))

Installation

BasicToast is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'BasicToast'

Author

62205797, hyeoncheolkim96@gmail.com

License

BasicToast is available under the MIT license. See the LICENSE file for more info.

Package Metadata

Repository: hckim96/basictoast

Default branch: master

README: README.md