Enums

The following enums are available globally.

  • There are two sort mode: manual mode(.manual) and predefined mode(the follow latter four types). Task order in downloadList of SDEDownloadManager is determined by sortType and sortOrder together.

    case manual: You determine task location.

    case addTime: Sorted by time when task is added.

    case fileName: Sorted by file display name.

    case fileSize: Sorted by file size.

    case fileType: Sorted and grouped by file type.

    See more

    Declaration

    Swift

    @objc public enum ComparisonType: Int
  • Task order in the list.

    case ascending: A -> Z; Old -> New; Small -> Big.

    case descending: Z -> A; New -> Old; Big -> Small.

    See more

    Declaration

    Swift

    @objc public enum ComparisonOrder: Int
  • The state of download task in SDEDownloadManager.

    case notInList: The URL which you query is not in the download manager. I set this value to make the framework be compatible with Objective-C. Because Int? can’t be presented in Objective-C.

    case pending: Not downloading and it’s sure that task has no resume data.

    case downloading: Downloading.

    case paused: Download is paused.

    case stopped: Not downloading and it’s sure that task has resume data to continue download.

    case finished: File is downloaded successfully.

    See more

    Declaration

    Swift

    @objc public enum DownloadState: Int
  • Select the content to display in DownloadListController.

    case downloadList: All tasks in downloadList, not include tasks in the trash(toDeleteList).

    case unfinishedList: All unfinished tasks, not include tasks in trash. Sorted by add time.

    case toDeleteList: Tasks in the trash. Sorted by delete time.

    case subsection: downloadList is a two-dimensional String array, select this case to display specified part. Property subsectionIndex determines which part.

    See more

    Declaration

    Swift

    @objc public enum ListContent: Int
  • Select how to detele a task in DownloadListController.

    case fileAndRecord: Delete task record and relative file both. If SDEDownloadManager’s isTrashOpened == true, task is moved to the trash.

    case onlyFile: Only delete relative file, and keep task record.

    case optional: Offer options: only file or both.

    See more

    Declaration

    Swift

    @objc public enum DeleteMode: Int
  • Appearance style of imageView in UITableViewCell in DownloadListController.

    case thumbnail: Show a thumbnail image at the location of cell’s imageView.

    case index: Show index(begin from 1) at the location of cell’s imageView.

    case none: Hidden cell’s imageView.

    See more

    Declaration

    Swift

    @objc public enum CellImageViewStyle: Int
  • Thumbnail shape of imageView in UITableViewCell in DownloadListController.

    case original: Displayed thumbnail has same width/height ratio with original image.

    case square: Displayed thumbnail’s width/height ratio is 1:1. Sometimes thumbnail is smaller than requested, it’s still displayed in original scale.

    See more

    Declaration

    Swift

    @objc public enum ThumbnailShape: Int
  • Appearance style of accessoryView(a button) of DownloadTrackerCell in DownloadListController. If you want your custom UITableViewCell is compatible with this enum type, look property cellAccessoryButtonStyle of DownloadListController.

    case icon: Accessory button in the cell shows a predefined icon which bind to task state.

    case title: Accessory button in the cell shows a predefined title which bind to task state.

    case none: Hidden accessory button in the cell.

    case custom: Accessory button has no title or image to be visible and touching won’t happen anything in this style. You could configure button in DownloadListController init method, and its closure accessoryButtonTouchHandler. It’s up to you.

    See more

    Declaration

    Swift

    @objc public enum AccessoryButtonStyle: Int
  • Appearance style of predefined UIBarButtonItem which are used in property toolBarActions and leftNavigationItemActions in DownloadListController.

    case icon: BarButtonItem shows an icon.

    case title: BarButtonItem shows a title.

    See more

    Declaration

    Swift

    @objc public enum BarButtonAppearanceStyle: Int
  • Predefined action for UIBarButtonItem in toolBar of DownloadListController by toolBarActions. For example, toolBarActions = [.resumeAll, .stopAll], toolBar will show two UIBarButtonItem to provide these two features.

    case resumeAll: Resume all unfinished tasks. It won’t be displayed if displayContent == .toDeleteList.

    case pauseAll: Pause all downloading tasks. It won’t be displayed if displayContent == .toDeleteList.

    case stopAll: Stop all downloading tasks and cancel all waitting tasks. It won’t be displayed if displayContent == .toDeleteList.

    case deleteAll: Delete all tasks. It won’t be displayed if displayContent == .unfinishedList.

    See more

    Declaration

    Swift

    @objc public enum ToolBarAction: Int
  • Predefined action for UIBarButtonItem in leftBarButtonItems of navigationItem of DownloadListController in multiple selection mode, and relative property: leftNavigationItemActions. For example, leftNavigationItemActions = [.selectAll, .pauseSelected], in DownloadListController’s multiple selection mode, left navigationItem will show two UIBarButtonItem to provide these two features.

    case selectAll: Select/Unselect all tasks(all cells).

    case resumeSelected: Resume resumeable tasks in selected tasks(selected cells). It won’t be displayed if displayContent == .toDeleteList.

    case pauseSelected: Pause downloading tasks in selected tasks(selected cells). It won’t be displayed if displayContent == .toDeleteList.

    case stopSelected: Stop downloading tasks and cancel waitting tasks in selected tasks(selected cells). It won’t be displayed if displayContent == .toDeleteList, neither if allowsStop == false.

    case deleteSelected: Delete selected tasks(selected cells). It won’t be displayed if displayContent == .unfinishedList, or allowsDelete == false in other lists(except for .toDeleteList).

    case restoreSelected: Restore selected deleted tasks back to download list. It is avaiable only if displayContent == .toDeleteList.

    See more

    Declaration

    Swift

    @objc public enum NavigationBarAction: Int