iOS 下载按钮 DownloadButton
- 授权协议: Apache 2.0
- 开发语言: Objective-C
- 操作系统: iOS
- 软件首页: https://github.com/PavelKatunin/DownloadButton
软件介绍
DownloadButton 是可自定义的 App Store 风格的下载按钮。可自定义设计组件,用 IB 进行编辑。
使用示例:
#pragma mark - PKDownloadButtonDelegate
- (void)downloadButtonTapped:(PKDownloadButton *)downloadButton
currentState:(PKDownloadButtonState)state {
switch (state) {
case kPKDownloadButtonState_StartDownload:
self.downloadButton.state = kPKDownloadButtonState_Pending;
[self.pendingSimulator startDownload];
break;
case kPKDownloadButtonState_Pending:
[self.pendingSimulator cancelDownload];
self.downloadButton.state = kPKDownloadButtonState_StartDownload;
break;
case kPKDownloadButtonState_Downloading:
[self.downloaderSimulator cancelDownload];
self.downloadButton.state = kPKDownloadButtonState_StartDownload;
break;
case kPKDownloadButtonState_Downloaded:
self.downloadButton.state = kPKDownloadButtonState_StartDownload;
self.imageView.hidden = YES;
break;
default:
NSAssert(NO, @"unsupported state");
break;
}
}
#pragma mark - DownloaderSimulatorDelegate
- (void)simulator:(PKDownloaderSimulator *)simulator didUpdateProgress:(double)progress {
if (simulator == self.pendingSimulator) {
if (progress == 1.) {
self.downloadButton.state = kPKDownloadButtonState_Downloading;
[self.downloaderSimulator startDownload];
}
}
else if (simulator == self.downloaderSimulator) {
self.downloadButton.stopDownloadButton.progress = progress;
if (progress == 1) {
self.downloadButton.state = kPKDownloadButtonState_Downloaded;
self.imageView.hidden = NO;
}
}
}1024·人与机器共同进化
东西文库 / 译言·东西文库/电子工业出版社 / 2013-12-20 / 55元
《1024》:国内第一本专注于科技文化的mook。 本期创刊号将目光定焦在“人与机器”这个超热点领域。 如果把机器获得思维能力看作是一种进化, 那人类具备不朽之躯同样也是一种进化。 这是一个野心勃勃但又充满不确定性的未来。 在我们一厢情愿地猜测机器将在不远的将来赶超自己而惶惶不可终日时,人类其实还有一个机会——变得更像机器。这并非科幻小说,而是正在发生的现实。人类创造......一起来看看 《1024·人与机器共同进化》 这本书的介绍吧!
