52

GitHub - pigfly/A_J_Simple_HUD: High Performance Display Overlay in iOS

 6 years ago
source link: https://github.com/pigfly/A_J_Simple_HUD
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

README.md

logo.png?raw=true

A-J-Simple-HUD

Travis Code Swift npm

A-J-Simple-HUD is an drop-in solution for displaying overlay information in iOS

Features

  • No Dependency, 100% iOS Native
  • Support both iPad and iPhone family
  • High performance, image generaiton is GPU-based
  • Support auto dismiss
  • Full documentation
  • Easy to customise, dynamically support different overlay size

Requirements

  • iOS 9.0+ / macOS 10.10+ / tvOS 9.0+ / watchOS 2.0+
  • Xcode 9.0+
  • Swift 4.0+

Installation

  • drag and drop the entire AJHUD and AJHUDNotice into your project

Full Usage Example

import UIKit

class ViewController: UIViewController {

    @IBAction func onTextButtonTapped(_ sender: UIButton) {
        AJHUD.showText("We ❤️ Swift !")
    }

    @IBAction func onSuccessButtonTapped(_ sender: UIButton) {
        AJHUD.showNoticeWithText(.success, text: "saved successfully ?", autoClear: true, autoClearTime: 2)
    }

    @IBAction func onInfoButtonTapped(_ sender: UIButton) {
        AJHUD.showNoticeWithText(.info, text: "attention ?", autoClear: true, autoClearTime: 2)
    }

    @IBAction func onErrorButtonTapped(_ sender: UIButton) {
        AJHUD.showNoticeWithText(.error, text: "something is wrong ?", autoClear: true, autoClearTime: 2)
    }
}

Folder Structure

├── AJHUD.swift
├── AJHUDNotice.swift
└── ViewController.swift
Class Responsiblity AJHUD display overlay information on UIWindow and auto dismiss AJHUDNoticeType enum type for the supported overlay image icon type AJHUDConfigure overlay related UI element configuration AJHUDNoticeImage GPU-based dynamically generate image icon for different overlay icon type

Demo

demo1.gif?raw=true

demo2.gif?raw=true

Credits

A-J-Simple-HUD is owned and maintained by the Alex Jiang. Thanks iTMan.design for providing computational resources.

License

A-J-Simple-HUD is released under the MIT license.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK