Commit 321d6814 authored by MissYasiky's avatar MissYasiky
Browse files

LIVE-30581 升级云课堂 SDK 至 0.14.0,升级云课堂 Demo 代码,升级云课堂 RN LoginModule 代码。

parent 5ef00254
......@@ -5,7 +5,7 @@ target 'PolyvRNCloudClassDemo' do
pod 'Masonry', '~> 1.1.0'
pod 'SDWebImage', '4.4.0'
pod 'PolyvCloudClassSDK', '0.9.0'
pod 'PolyvCloudClassSDK', '0.14.0'
#pod 'RNReanimated', :path => '../node_modules/react-native-reanimated'
#pod 'RNGestureHandler', :path => '../node_modules/react-native-gesture-handler'
......
PODS:
- AgoraRtcEngine_iOS (2.9.0.102)
- Masonry (1.1.0)
- PolyvAliHttpDNS (1.7.4):
- PolyvAliHttpDNS/AlicloudHttpDNS (= 1.7.4)
- PolyvAliHttpDNS/AlicloudUtils (= 1.7.4)
- PolyvAliHttpDNS/UTDID (= 1.7.4)
- PolyvAliHttpDNS/AlicloudHttpDNS (1.7.4)
- PolyvAliHttpDNS/AlicloudUtils (1.7.4)
- PolyvAliHttpDNS/UTDID (1.7.4)
- PolyvBusinessSDK (0.13.0):
- PolyvFoundationSDK (~> 0.11.0)
- PolyvCloudClassSDK (0.14.0):
- PolyvCloudClassSDK/Core (= 0.14.0)
- PolyvCloudClassSDK/Player (= 0.14.0)
- PolyvCloudClassSDK/ThirdPart (= 0.14.0)
- PolyvCloudClassSDK/Core (0.14.0):
- PolyvBusinessSDK (~> 0.13.0)
- PolyvCloudClassSDK/Player (0.14.0):
- PolyvIJKPlayer (~> 0.6.3)
- PolyvCloudClassSDK/ThirdPart (0.14.0):
- AgoraRtcEngine_iOS (= 2.9.0.102)
- PolyvAliHttpDNS (~> 1.7.3)
- Socket.IO-Client-Swift (~> 14.0.0)
- PolyvFoundationSDK (0.11.0)
- PolyvIJKPlayer (0.6.3)
- SDWebImage (4.4.0):
- SDWebImage/Core (= 4.4.0)
- SDWebImage/Core (4.4.0)
- Socket.IO-Client-Swift (14.0.0):
- Starscream (~> 3.0.6)
- Starscream (3.0.6)
DEPENDENCIES:
- Masonry (~> 1.1.0)
- PolyvCloudClassSDK (= 0.14.0)
- SDWebImage (= 4.4.0)
SPEC REPOS:
https://github.com/cocoapods/specs.git:
- AgoraRtcEngine_iOS
- Masonry
- PolyvAliHttpDNS
- PolyvBusinessSDK
- PolyvCloudClassSDK
- PolyvFoundationSDK
- PolyvIJKPlayer
- SDWebImage
- Socket.IO-Client-Swift
- Starscream
SPEC CHECKSUMS:
AgoraRtcEngine_iOS: 9755a9dcd45ab1d177ece9fe15dea23124d63d50
Masonry: 678fab65091a9290e40e2832a55e7ab731aad201
PolyvAliHttpDNS: 6e7783feba44d25abc4f9584da83f93e7e4ef957
PolyvBusinessSDK: 016a5363f7ea64a96b25717f433ab6a884ae3160
PolyvCloudClassSDK: 4faaee7e5a074544991ad1687f19decce3dcb63f
PolyvFoundationSDK: 5ff64db951623be6f4ae66b770f94a41b1b3356d
PolyvIJKPlayer: 5b9dd60ee6f85285bf5f5a6972a687ee574824c4
SDWebImage: b534502786e43dde36dfcaee89356fe6df30e203
Socket.IO-Client-Swift: 21e6a8a23a7d367d5ddfab6cbbd3c679cf3c25d6
Starscream: ef3ece99d765eeccb67de105bfa143f929026cf5
PODFILE CHECKSUM: ef6974d06bed75c1c04aeb7c72a5afe85827642d
COCOAPODS: 1.7.2
Copyright (c) 2011-2017 Charles Powell
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
IN THE SOFTWARE.
\ No newline at end of file
Overview
============
MarqueeLabel is a UILabel subclass adds a scrolling marquee effect when the text of the label outgrows the available width. The label scrolling direction and speed/rate can be specified as well. All standard UILabel properties (where it makes sense) are available in MarqueeLabel, with the intent of MarqueeLabel behaving just like a UILabel.
MarqueeLabel is compatible with both iOS and tvOS, and currently works with Swift 3.0 and the iOS 10.0 SDK! (But if you're looking for Swift 2.x compatibility, [you can use release 2.8](https://github.com/cbpowell/MarqueeLabel/releases/tag/2.8.0))
## Check it out!
![GIF of MarqueeLabelDemo in action](https://raw.githubusercontent.com/cbpowell/MarqueeLabel/master/Metadata/MarqueeLabelDemo.gif)
## How To Get Started
1. Clone MarqueeLabel from GitHub, and check out the demo project.
2. Read the [MarqueeLabel CocoaDocs documentation](http://cocoadocs.org/docsets/MarqueeLabel/).
3. Take a look at the [special notes](https://github.com/cbpowell/MarqueeLabel/blob/master/README.mdown#special-notes) section to be aware of any gotchas.
4. Drop in MarqueeLabel as a replacement to your lengthy UILabels!
5. Help out with bug fixes and new features.
### Installation
#### [CocoaPods](http://cocoapods.org)
MarqueeLabel has [subspecs](https://guides.cocoapods.org/syntax/podspec.html#subspec) for both Objective-C and Swift! Currently, Objective-C is the default subspec.
That means to use MarqueeLabel in an Objective-C project, add the following to your project's Podfile:
```ruby
pod 'MarqueeLabel'
```
But if you're using Swift, add the following instead to specify the Swift subspec:
```ruby
pod 'MarqueeLabel/Swift'
```
#### Carthage
Add the following to your project's Cartfile:
```ruby
github "cbpowell/MarqueeLabel"
```
#### Manual Installation
1. Add MarqueeLabel.h and MarqueeLabel.m, or MarqueeLabel.swift, to your project.
2. Add **QuartzCore.framework** to your project frameworks.
3. Import MarqueeLabel and replace your UILabels with MarqueeLabels as needed.
#### Using MarqueeLabel in your own Swift Framework?
See the [Special Note below](https://github.com/cbpowell/MarqueeLabel/blob/master/README.mdown#swiftframeworkusage) on supporting Cocoapods and Carthage simultaneously in a Swift framework!
## Usage
MarqueeLabel automatically scrolls its text, at either a defined rate (points per second) or over a duration (seconds), whenever the length of the label's text exceeds the space available given the label's frame.
There are several options for the Marquee type, and the default is `Continuous` (which looks just like what Apple typically uses). The animation curve of this scroll can be defined, and defaults to `UIViewAnimationOptionCurveLinear`.
There are also several optional features to help with your integration of the scrolling nature of MarqueeLabel:
- An optional edge fade at the left and right edges of the view, in order to fade the label text into the background rather than simply being clipped off
- Leading and trailing buffers to offset the label text inside its frame, giving you better control over alignment
- "Labelization" to make your MarqueeLabel _exactly_ like a UILabel.
- Scroll animation "holding" and pausing
See the included demo project for several use case examples!
### Code
These lines of code create a MarqueeLabel that will scroll across its content in 8.0 seconds, and adds 10.0 point long fade at the left and right boundaries.
#### Objective-C
Replace:
UILabel *lengthyLabel = [[UILabel alloc] initWithFrame:aFrame];
With:
MarqueeLabel *lengthyLabel = [[MarqueeLabel alloc] initWithFrame:aFrame duration:8.0 andFadeLength:10.0f];
#### Swift
Replace:
var lengthyLabel = UILabel.init(frame:aFrame)
With:
var lengthyLabel = MarqueeLabel.init(frame: aFrame, duration: 8.0, fadeLength: 10.0)
### Storyboards
If you're using Storyboards/Interface Builder you can create a MarqueeLabel instance by adding a normal UILabel view to your Storyboard, and then manually changing the view's class to `MarqueeLabel` in the "Custom Class" field of the Identity Inspector tab on the Utilities panel (the right-side panel).
_Note:_ If you forget to change the Custom Class field to `MarqueeLabel` and then try to access/set MarqueeLabel-specific properties in your code, you will get crashes!
You can then configure the normal UILabel properties, as well as most of the MarqueeLabel configuration properties, via the Attributes tab of the Utility panel!
### Even More
Check out the [MarqueeLabel documentation](http://cocoadocs.org/docsets/MarqueeLabel/) for more about all the features, including:
- Bulk-manipulation class methods to conveniently restart, pause, and unpause all labels in a view controller
- Scrolling direction: left->right, right->left, and continuous looping (both left and right)
## Extras
Also check out [the Extras folder](/Extras), a collection of subclasses, extensions, and modifications for MarqueeLabel to implement various functionality that has been requested or suggested, but not merged into the MarqueeLabel code.
## Special Notes<a id="specialnotes"></a>
#### IBDesignables
MarqueeLabel includes support for IBInspectable and IBDesignable, to allow configuration of the label inside Interface Builder/Storyboards. However, if you see these warnings when building:
IB Designables: Failed to update auto layout status: Failed to load designables from path (null)
IB Designables: Failed to render instance of MarqueeLabel: Failed to load designables from path (null)
...then you are likely using MarqueeLabel as a static library, which does not support IBInspectable/IBDesignable. Some workarounds include:
- Install MarqueeLabel as a dynamic framework using CocoaPods with use_frameworks! in your Podfile
- Install MarqueeLabel with Carthage
- Install MarqueeLabel by manually importing the source files into your project (may be only option if you're targeting iOS 7.0)
#### Automatic Scrolling
MarqueeLabel tries its best to automatically begin scrolling when appropriate, but sometimes the way your view/view controller appears onscreen can trip it up.
To combat this, you can try:
- Using the `restartLabel` instance method to manually start scrolling on a MarqueeLabel
- Try using the bulk manipulation class methods - but note that these don't currently play well with UIViewController containment. You'll need to pass them the lowest UIViewController in your hierarchy.
#### Use in UITableView and UICollectionView
As noted above, MarqueeLabel can sometimes have trouble detecting when the scroll animation should start when used in UITableViews and UICollectionViews - although recent reviews have improved this.
Usually you'll configure the MarqueeLabel instance when building the cell in `tableView:cellForRowAtIndexPath:` (or similar for UICollectionView), but at this point the cell is not onscreen so MarqueeLabel will not begin the scrolling animation. Even when the cell is eventually placed onscreen as the user scrolls, due to timing it's possible that the animation will not fire.
To make sure the scrolling animation _does_ begin as the cell scrolls onscreen, you can use the the `restartLabel` method on your MarqueeLabels inside the `tableView:willDisplayCell:forRowAtIndexPath:` delegate method (or similar for UICollectionView).
**That said** - the UITableView/UICollectionView best practice is to minimize things like excessive animation, subviews, and custom drawing in your cells, in order to get glassy smooth scrolling. In general I would recommend against allowing your labels to automatically animate during user scrolling of the UITableView/UICollectionView. I suggest [holding scrolling](http://cocoadocs.org/docsets/MarqueeLabel/3.0.3/Classes/MarqueeLabel.html#//api/name/holdScrolling) or [labelizing](http://cocoadocs.org/docsets/MarqueeLabel/3.0.3/Classes/MarqueeLabel.html#//api/name/labelize) the labels while the user scrolls. See the table view example in the demo!
#### Important Animation Note<a id="importantanimationnote"></a>
MarqueeLabel is based on Core Animation, which does cause some problems when views appear and disappear and the repeating animation is stopped by iOS and does not automatically restart.
To address this, MarqueeLabel provides a few class methods that allow easy "restarting" of all MarqueeLabels associated with a UIViewController. Specifically, the class method `restartLabelsOfController:` should be called by your view controller (which passes in `self` for the `controller` parameter) when it is revealed or about to be revealed. Keep in mind that presenting a modal view controller can pause repeating UIView animations in the controller that is being covered!
`controllerLabelsShouldLabelize:` and `controllerLabelsShouldAnimate:` are for convenience, allowing labelizing and re-animating all labels of a UIViewController. Labelizing can be useful for performance, such as labelizing all MarqueeLabels when a UITableView/UIScrollView starts scrolling.
#### Using MarqueeLabel as a dependency with Cocoapods and Carthage - Swift only!<a id="swiftframeworkusage"></a>
If you're developing your own Swift framework that uses MarqueeLabel as a dependency, and want to support both Cocoapods _and_ Carthage, you may need to do a little extra work. Because of the current naming of MarqueeLabel frameworks (and Carthage building all targets in the project), the name of Swift dynamic framework to import varies between Cocoapods and Carthage.
When building the Swift subspec with Cocoapods, MarqueeLabel is imported with `import MarqueeLabel`. However, because Carthage requires distinct names for each target, when building with Carthage the import statement for the Swift target is `import MarqueeLabelSwift`.
A suggested workaround is to use a [conditional compilation block](https://developer.apple.com/library/content/documentation/Swift/Conceptual/Swift_Programming_Language/Statements.html#//apple_ref/doc/uid/TP40014097-CH33-ID538) (aka preprocessor macro) to switch between the two import statements based on whether or not the target is intended for use with Carthage. To specify the target, you can add an "Other Swift Flag" in the Swift Compiler - Custom Flags section of your Carthage target (i.e. the framework) build settings:
<img src="https://raw.githubusercontent.com/cbpowell/MarqueeLabel/master/Metadata/carthage_config.png" width="600">
And then include the following conditional compilation statement to use the appropriate framework name:
```swift
#if CARTHAGE_CONFIG
import MarqueeLabelSwift //Carthage build name
#else
import MarqueeLabel // Cocoapods build name
#endif
```
## Todo
- Ideas?
## About
Charles Powell
- [GitHub](http://github.com/cbpowell)
- [Twitter](http://twitter.com/seventhcolumn)
Give me a shout if you're using this in your project!
......@@ -28,13 +28,15 @@
@property (nonatomic, assign) BOOL circulation;
/**
通过标题及其控制器初始化分页控制器
设置分页控制器
@param titles 子控制器标题
@param controllers 子控制器
@return 分页控制
*/
- (instancetype)initWithTitles:(NSArray<NSString *> *)titles controllers:(NSArray<UIViewController *> *)controllers barHeight:(CGFloat)barHeight touchHeight:(CGFloat)touchHeight;
- (void)setTitles:(NSArray<NSString *> *)titles
controllers:(NSArray<UIViewController *> *)controllers
barHeight:(CGFloat)barHeight
touchHeight:(CGFloat)touchHeight;
/**
新增页
......@@ -66,6 +68,8 @@
/// 是否圆角
- (void)cornerRadius:(BOOL)flag;
- (void)scrollEnable:(BOOL)enable;
@end
@protocol FTPageControllerDelegate <NSObject>
......
......@@ -42,21 +42,20 @@ static NSString *TitleCellIdentifier = @"PageTitleCell";
#pragma mark - Initialize
- (instancetype)initWithTitles:(NSArray<NSString *> *)titles controllers:(NSArray<UIViewController *> *)controllers barHeight:(CGFloat)barHeight touchHeight:(CGFloat)touchHeight {
self = [super init];
if (self) {
self.barHeight = barHeight;
self.touchHeight = touchHeight;
_selectedIndexPath = [NSIndexPath indexPathForItem:0 inSection:0];
self.titles = [[NSMutableArray alloc] initWithArray:titles];
self.controllers = [[NSMutableArray alloc] initWithArray:controllers];
[self setupTitles];
[self setupPageController];
[self.view bringSubviewToFront:self.topLineView];
}
return self;
- (void)setTitles:(NSArray<NSString *> *)titles
controllers:(NSArray<UIViewController *> *)controllers
barHeight:(CGFloat)barHeight
touchHeight:(CGFloat)touchHeight {
self.barHeight = barHeight;
self.touchHeight = touchHeight;
_selectedIndexPath = [NSIndexPath indexPathForItem:0 inSection:0];
self.titles = [[NSMutableArray alloc] initWithArray:titles];
self.controllers = [[NSMutableArray alloc] initWithArray:controllers];
[self setupTitles];
[self setupPageController];
[self.view bringSubviewToFront:self.topLineView];
}
- (void)changeFrame {
......@@ -81,7 +80,7 @@ static NSString *TitleCellIdentifier = @"PageTitleCell";
-(void)setupTitles {
UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc] init];
layout.scrollDirection = UICollectionViewScrollDirectionHorizontal;
self.titleCollectionView = [[UICollectionView alloc] initWithFrame:CGRectMake(0, self.touchHeight - 1.0, kWidth, self.barHeight - self.touchHeight) collectionViewLayout:layout];
self.titleCollectionView = [[UICollectionView alloc] initWithFrame:CGRectMake(0, self.touchHeight, kWidth, self.barHeight - self.touchHeight) collectionViewLayout:layout];
self.titleCollectionView.backgroundColor = [UIColor whiteColor];
self.titleCollectionView.dataSource = self;
self.titleCollectionView.delegate = self;
......@@ -89,7 +88,6 @@ static NSString *TitleCellIdentifier = @"PageTitleCell";
[self.view addSubview:self.titleCollectionView];
self.titleCollectionView.showsVerticalScrollIndicator = NO;
self.titleCollectionView.showsHorizontalScrollIndicator = NO;
[self.titleCollectionView registerClass:[FTTitleViewCell class] forCellWithReuseIdentifier:TitleCellIdentifier];
if (self.touchHeight > 0.0) {
......@@ -185,6 +183,19 @@ static NSString *TitleCellIdentifier = @"PageTitleCell";
}
}
- (void)scrollEnable:(BOOL)enable {
dispatch_async(dispatch_get_main_queue(), ^{
UIScrollView *scrollView;
for(id subview in self.pageViewController.view.subviews) {
if([subview isKindOfClass:UIScrollView.class]) {
scrollView=subview;
break;
}
}
scrollView.scrollEnabled = enable;
});
}
#pragma mark - Life Cycle
- (void)viewDidLoad {
......@@ -223,9 +234,7 @@ static NSString *TitleCellIdentifier = @"PageTitleCell";
}
-(CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath {
NSString *text = self.titles[indexPath.item];
CGFloat width = [text sizeWithAttributes:@{NSFontAttributeName : [UIFont systemFontOfSize:16.0]}].width;
return CGSizeMake(width + 32.0, CGRectGetHeight(collectionView.bounds));
return CGSizeMake([FTTitleViewCell cellWidth], collectionView.frame.size.height);
}
-(UIEdgeInsets)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout insetForSectionAtIndex:(NSInteger)section {
......@@ -249,6 +258,8 @@ static NSString *TitleCellIdentifier = @"PageTitleCell";
[self.pageViewController setViewControllers:showController direction:UIPageViewControllerNavigationDirectionForward animated:NO completion:^(BOOL finished) {
//NSLog(@"setViewControllers finished."); // first low
}];
[collectionView scrollToItemAtIndexPath:indexPath atScrollPosition:UICollectionViewScrollPositionCenteredHorizontally animated:YES];
}
-(void)collectionView:(UICollectionView *)collectionView didDeselectItemAtIndexPath:(NSIndexPath *)indexPath {
......
......@@ -10,24 +10,34 @@
@implementation FTTitleViewCell
- (void)awakeFromNib {
[super awakeFromNib];
// Initialization code
self.clicked = NO;
}
- (instancetype)initWithFrame:(CGRect)frame {
self = [super initWithFrame:frame];
if (self) {
CGFloat width = 100.0;
//CGFloat height = 44.0;
self.frame = CGRectMake(frame.origin.x, frame.origin.y, width, frame.size.height);
_titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, width, frame.size.height)];
CGFloat width = frame.size.width;
CGFloat height = frame.size.height;
_titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, -5, width, height)];
_titleLabel.textColor = [UIColor darkGrayColor];
_titleLabel.font = [UIFont systemFontOfSize:16];
_titleLabel.font = [UIFont boldSystemFontOfSize:16];
_titleLabel.textAlignment = NSTextAlignmentCenter;
_titleLabel.numberOfLines = 1;
[self addSubview:_titleLabel];
_indicatorView = [[UIView alloc] initWithFrame:CGRectMake(34, frame.size.height - 3, 32, 3)];
_indicatorView.backgroundColor = [UIColor colorWithRed:0x21/255.0 green:0x96/255.0 blue:0xf3/255.0 alpha:1.0];
float indicatorViewW = 32.0;
float indicatorViewH = 3.0;
_indicatorView = [[UIView alloc] initWithFrame:CGRectMake((width - indicatorViewW) / 2.0, height - indicatorViewH, indicatorViewW, indicatorViewH)];
_indicatorView.backgroundColor = [UIColor colorWithRed:33/255.0 green:150/255.0 blue:243/255.0 alpha:1.0];
[self addSubview:_indicatorView];
_indicatorView.hidden = YES;
_indicatorView.layer.cornerRadius = 1.5;
_indicatorView.layer.masksToBounds = YES;
}
return self;
}
......@@ -39,4 +49,8 @@
_titleLabel.textColor = clicked ? [UIColor colorWithRed:33/255.0 green:150/255.0 blue:243/255.0 alpha:1.0] : [UIColor darkGrayColor];
}
+ (CGFloat)cellWidth {
return 90.0;
}
@end
......@@ -9,6 +9,7 @@
#import "PLVCameraViewController.h"
#import <AVFoundation/AVFoundation.h>
#import "SDWebImageDecoder.h"
#import "MyTool.h"
#define WIDTH [[UIScreen mainScreen] bounds].size.width
#define HEIGHT [[UIScreen mainScreen] bounds].size.height
......@@ -165,7 +166,7 @@
#pragma mark - private
- (UIButton *)createButton:(NSString *)normalImage frame:(CGRect)frame action:(SEL)action {
UIButton *btn = [[UIButton alloc] initWithFrame:frame];
[btn setBackgroundImage:[UIImage imageNamed:normalImage] forState:UIControlStateNormal];
[btn setBackgroundImage:[MyTool getImageWithImageName:normalImage] forState:UIControlStateNormal];
[btn addTarget:self action:action forControlEvents:UIControlEventTouchUpInside];
[self.view addSubview:btn];
return btn;
......
......@@ -365,7 +365,7 @@
arrowRect = CGRectMake(titleRect.size.width < 50.0 ? 53.0 : titleRect.size.width + 2.0, -2.0, 10.0, 10.0);
}
if (self.arrowDownImgView == nil) {
self.arrowDownImgView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"arrowDown.png"]];
self.arrowDownImgView = [[UIImageView alloc] initWithImage:[MyTool getImageWithImageName:@"arrowDown.png"]];
[self.albumsBtn addSubview:self.arrowDownImgView];
}
if (self.assetCollection != nil) {
......@@ -735,16 +735,20 @@
[weak_self uploadImage:imgInfo.originImg];
}
} else if (flag) {
weak_self.sendBtn.enabled = YES;
[MyTool presentAlertController:@"下载iCloud的图片失败,请保证网络正常,重新再试" inViewController:weak_self];
dispatch_async(dispatch_get_main_queue(), ^{
weak_self.sendBtn.enabled = YES;
[MyTool presentAlertController:@"下载iCloud的图片失败,请保证网络正常,重新再试" inViewController:weak_self];
});
}
} dataHandler:nil errorHandler:^(NSDictionary *info) {
[weak_self cancelImageRequest:imgInfo];
if (++time < 3) {
[weak_self requestImage:imgInfo count:time onQueue:dispatch_get_global_queue(0, DISPATCH_QUEUE_PRIORITY_DEFAULT) flag:flag];
} else if (flag) {
weak_self.sendBtn.enabled = YES;
[MyTool presentAlertController:@"下载iCloud的图片失败,请保证网络正常,重新再试" inViewController:weak_self];
dispatch_async(dispatch_get_main_queue(), ^{
weak_self.sendBtn.enabled = YES;
[MyTool presentAlertController:@"下载iCloud的图片失败,请保证网络正常,重新再试" inViewController:weak_self];
});
}
}];
}
......