mirror of
https://github.com/zhigang1992/GitHawk.git
synced 2026-06-05 06:49:56 +08:00
46 lines
1.2 KiB
Swift
46 lines
1.2 KiB
Swift
//
|
|
// StatusBar.swift
|
|
// Freetime
|
|
//
|
|
// Created by Ryan Nystrom on 5/17/17.
|
|
// Copyright © 2017 Ryan Nystrom. All rights reserved.
|
|
//
|
|
|
|
import Foundation
|
|
import JDStatusBarNotification
|
|
|
|
enum StatusBar {
|
|
|
|
private static func provideHapticFeedback() {
|
|
UINotificationFeedbackGenerator().notificationOccurred(.error)
|
|
}
|
|
|
|
static func showRevokeError() {
|
|
JDStatusBarNotification.show(
|
|
withStatus: NSLocalizedString("Your access token was revoked.", comment: ""),
|
|
dismissAfter: 3,
|
|
styleName: JDStatusBarStyleError
|
|
)
|
|
provideHapticFeedback()
|
|
}
|
|
|
|
static func showNetworkError() {
|
|
JDStatusBarNotification.show(
|
|
withStatus: NSLocalizedString("Network connection lost.", comment: ""),
|
|
dismissAfter: 3,
|
|
styleName: JDStatusBarStyleError
|
|
)
|
|
provideHapticFeedback()
|
|
}
|
|
|
|
static func showGenericError() {
|
|
JDStatusBarNotification.show(
|
|
withStatus: NSLocalizedString("Something went wrong.", comment: ""),
|
|
dismissAfter: 3,
|
|
styleName: JDStatusBarStyleError
|
|
)
|
|
provideHapticFeedback()
|
|
}
|
|
|
|
}
|