在SDWebImage3.7.5源码阅读二中看完后,已经知道SDWebImageCombinedOperation类的在cacheOperation搜索完缓存之后:
1 | operation.cacheOperation = [self.imageCache queryDiskCacheForKey:key done:^(UIImage *image, SDImageCacheType cacheType) { |
在SDWebImage3.7.5源码阅读二中看完后,已经知道SDWebImageCombinedOperation类的在cacheOperation搜索完缓存之后:
1 | operation.cacheOperation = [self.imageCache queryDiskCacheForKey:key done:^(UIImage *image, SDImageCacheType cacheType) { |
github地址: https://github.com/rs/SDWebImage
功能
方法在SDWebImageManager.m中
1 | id <SDWebImageOperation>)downloadImageWithURL:(NSURL *)url |
参数:
1 | //从名字可以看出来第一个参数是已经接受了数据的大小 |
1 |
|
然后一看这个方法实现……麻蛋 好长!
步骤
AudioServicesCreateSystemSoundID( CFURLRef inFileURL, SystemSoundID* outSystemSoundID)函数获得系统声音ID。AudioServicesAddSystemSoundCompletion( SystemSoundID inSystemSoundID, CFRunLoopRef inRunLoop, CFStringRef inRunLoopMode, AudioServicesSystemSoundCompletionProc inCompletionRoutine, void* inClientData)方法注册回调函数。AudioServicesPlaySystemSound(SystemSoundID inSystemSoundID) 或者AudioServicesPlayAlertSound(SystemSoundID inSystemSoundID) 方法播放音效(后者带有震动效果)。比如在tableview中:
1 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{ |