Skip to content
John Lui edited this page Sep 23, 2016 · 9 revisions

#Documentation

how to use

self.pleaseWait()

self.noticeTop("OK!")

self.noticeSuccess("Success!")
self.noticeError("Error!")
self.noticeInfo("Info")

self.noticeOnlyText("Only Text")

self.clearAllNotice() // clear

use custom images in self.pleaseWait()

var imagesArray = Array<UIImage>()
for i in 1...7 {
    imagesArray.append(UIImage(named: "loading\(i)")!)
}
self.pleaseWaitWithImages(imagesArray, timeInterval: 50)

make it auto-clear

self.noticeTop("OK!", autoClear: true)

self.noticeSuccess("Success!", autoClear: true)
self.noticeError("Error!", autoClear: true)
self.noticeInfo("Info", autoClear: true)

auto-clear and set auto-clear-time

self.noticeTop("OK!", autoClear: true, autoClearTime: 1)

self.noticeSuccess("Success!", autoClear: true, autoClearTime: 10)
self.noticeError("Error!", autoClear: true, autoClearTime: 10)
self.noticeInfo("Info", autoClear: true, autoClearTime: 10)

old api with full power

self.notice("Success!", type: NoticeType.success, autoClear: true)
self.notice("Error!", type: NoticeType.error, autoClear: true)
self.notice("Info", type: NoticeType.info, autoClear: true)

use SwiftNotice anywhere

SwiftNotice.wait()
SwiftNotice.noticeOnSatusBar("noticeOnSatusBar", autoClear: true, autoClearTime: 1)
SwiftNotice.showText("showText")
SwiftNotice.showNoticeWithText(NoticeType.success, text:"showNoticeWithText", autoClear: true, autoClearTime: 3)
SwiftNotice.clear()