 import CloudKit
 
 class ViewController: NSViewController {
+    var timer : Timer?
     lazy var menus : [ListCategrory] = {
         guard let fileURL = Bundle.main.url(forResource: "categrory", withExtension: "plist") else {
             return [ListCategrory]()

    }

    @IBAction func start(_ sender: Any) {
        action.isEnabled = false
        tor = menus.makeIterator()
        let bot = FetchBot.shareBot
        bot.delegate = self
        bot.startPage = startIndex
        bot.pageOffset = pageOffset
        site.categrory = tor?.next()
        DispatchQueue.global().async {
            bot.start(withSite: self.site)
        }
    }
    
}

    var tor: IndexingIterator<[ListCategrory]>?
    var site = Site.netdisk
    var startIndex: UInt = 1
    let pageOffset: UInt = 5
    var startTime: Date!
    @IBOutlet weak var action: NSButton!
    @IBOutlet weak var label: NSTextField!
