mirror of
https://github.com/zhigang1992/GitHawk.git
synced 2026-06-05 06:49:56 +08:00
* [ADD] Bookmarks for repo, issues and pull request * [FIX] Bookmark model decoding from archive * [ADD] Clear all option for bookmarks * [ADD] Search bookmarks with search bar * [ADD] Swipe to delete for bookmarks (only when search bar is not active) * [ADD] Bookmark cell accessible and some cleanup * [ADD] Incorporate review comments * [ADD] Reuse notification type instead of bookmark type * [ADD] Incorporate review comments - Enum over struct on bookmark model - Github bookmark tab icon - Smooth deselection, Single tap to scroll to top, cleanup -
30 lines
711 B
Swift
30 lines
711 B
Swift
//
|
|
// NotificationType.swift
|
|
// Freetime
|
|
//
|
|
// Created by Ryan Nystrom on 5/13/17.
|
|
// Copyright © 2017 Ryan Nystrom. All rights reserved.
|
|
//
|
|
|
|
import Foundation
|
|
|
|
// https://github.com/octokit/octokit.objc/blob/master/OctoKit/OCTNotification.m#L63-L65
|
|
enum NotificationType: String {
|
|
case issue = "Issue"
|
|
case pullRequest = "PullRequest"
|
|
case commit = "Commit"
|
|
case repo = "Repository"
|
|
}
|
|
|
|
extension NotificationType {
|
|
|
|
var localizedString: String {
|
|
switch self {
|
|
case .issue, .commit, .repo:
|
|
return NSLocalizedString(self.rawValue, comment: "")
|
|
case .pullRequest:
|
|
return NSLocalizedString("Pull request", comment: "")
|
|
}
|
|
}
|
|
}
|