Commit 6a4e5533 authored by 曹云霄's avatar 曹云霄

优化购物车不提示

parent 59d79494
......@@ -388,8 +388,14 @@
[HTTP networkRequestWithURL:SERVERREQUESTURL(ADDSHOPPINGBAG) withRequestType:ZERO withParameter:shopCar withReturnValueBlock:^(id returnValue) {
[XBLoadingView hideHUDViewWithDefault];
if (RESULT(returnValue)) {
NSLog(@"添加购物车成功");
[weakSelf StartAddShoppingCarAnimationWithimage:weakSelf.headerView.goodsImageview.image withStartpoint:[weakSelf.headerView convertPoint:[weakSelf.headerView.goodsImageview center] toView:weakSelf.view.window] withSize:weakSelf.headerView.goodsImageview.frame.size];
CGSize size = weakSelf.headerView.goodsImageview.frame.size;
UIImageView *imageView = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, size.width, size.height)];
imageView.image = weakSelf.headerView.goodsImageview.image;
imageView.center = [weakSelf.headerView convertPoint:[weakSelf.headerView.goodsImageview center] toView:weakSelf.view.window];
[weakSelf.view.window.layer addSublayer:imageView.layer];
[imageView startAnimationWithEndPoint:SHARED_APPDELEGATE.shoppingCarPoint withControlPoint:CGPointMake(200, 200) animateWithDuration:ONE completed:^{
[weakSelf queryShoppingCarNumber];
}];
}else
{
[XBLoadingView showHUDViewWithText:MESSAGE(returnValue)];
......
......@@ -332,7 +332,9 @@
imageView.image = weakCell.productImageView.image;
imageView.center = centerPoint;
[weakSelf.view.window.layer addSublayer:imageView.layer];
[imageView startAnimationWithEndPoint:SHARED_APPDELEGATE.shoppingCarPoint withControlPoint:CGPointMake(200, 200) animateWithDuration:1];
[imageView startAnimationWithEndPoint:SHARED_APPDELEGATE.shoppingCarPoint withControlPoint:CGPointMake(200, 200) animateWithDuration:ONE completed:^{
[weakSelf queryShoppingCarNumber];
}];
}];
}];
return cell;
......@@ -344,11 +346,6 @@
[layerAnimation removeFromSuperlayer];
}
#pragma mark -完成加入购物车动画完成后回调
- (void)animationDidStop:(CAAnimation *)anim finished:(BOOL)flag
{
[self queryShoppingCarNumber];
}
- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section
{
......
......@@ -60,6 +60,7 @@
[self.shopResponseArray removeAllObjects];
[self initializeState];
[self queryShoppingCarNumber];
[self.tableView.mj_header beginRefreshing];
}
#pragma mark -视图即将消失
......
......@@ -14,7 +14,7 @@ PODS:
- AFNetworking/Serialization (3.1.0)
- AFNetworking/UIKit (3.1.0):
- AFNetworking/NSURLSession
- AliyunOSSiOS (2.6.0)
- AliyunOSSiOS (2.6.1)
- Bugly (2.4.8)
- DACircularProgress (2.3.1)
- DZNEmptyDataSet (1.8.1)
......@@ -62,7 +62,7 @@ PODS:
- WYPopoverController (0.3.9)
- WZLBadge (1.2.6)
- YXAlertController (1.0.7)
- YXKit (0.0.3)
- YXKit (0.0.4)
DEPENDENCIES:
- AFNetworking (~> 3.1.0)
......@@ -88,11 +88,11 @@ DEPENDENCIES:
- WYPopoverController (~> 0.3.9)
- WZLBadge (~> 1.2.5)
- YXAlertController (~> 1.0.7)
- YXKit (~> 0.0.3)
- YXKit (~> 0.0.4)
SPEC CHECKSUMS:
AFNetworking: 5e0e199f73d8626b11e79750991f5d173d1f8b67
AliyunOSSiOS: '058b038cc82000dadb8f8e3893a97243124f2898'
AliyunOSSiOS: 8174b695e09b136afe43a6af821c3ca71d423373
Bugly: da3c02408c14838d498429320545a8e439392978
DACircularProgress: 4dd437c0fc3da5161cb289e07ac449493d41db71
DZNEmptyDataSet: 9525833b9e68ac21c30253e1d3d7076cc828eaa7
......@@ -116,8 +116,8 @@ SPEC CHECKSUMS:
WYPopoverController: a9db25ac2841a686acdc0f3a99bdb21545db32f4
WZLBadge: 9ec779dcfd94c825518b395e8315fccaabff1bfa
YXAlertController: 68e27c48976fa9ecc0b82e63166b67863be8b70b
YXKit: 0d804e9731c7943864c6feb3599f53631231b47d
YXKit: ed7714bc185dde43b1a5d1c4f7df760d9b2ec7f7
PODFILE CHECKSUM: 2a3484ae85f198a58d70a25310964bfa6795c10a
PODFILE CHECKSUM: 962a8b96654703335e32ffd05a5bd7c50c577ac2
COCOAPODS: 1.2.1
......@@ -215,6 +215,18 @@ NS_ASSUME_NONNULL_BEGIN
withObjectKey:(NSString *)objectKey
withExpirationInterval:(NSTimeInterval)interval;
/**
对一个Object签名出一个URL,可以把该URL转给第三方实现授权访问。
@bucketName Object所在的Bucket名称
@objectKey Object名称
@interval 签名URL时,可以指定这个URL的有效时长是多久,单位是秒,比如说需要有效时长为1小时的URL,这里传入3600
@parameter 参数
*/
- (OSSTask *)presignConstrainURLWithBucketName:(NSString *)bucketName
withObjectKey:(NSString *)objectKey
withExpirationInterval:(NSTimeInterval)interval
withParameters:(NSDictionary *)parameters;
/**
如果Object的权限是公共读或者公共读写,调用这个接口对该Object签名出一个URL,可以把该URL转给第三方实现授权访问。
@bucketName Object所在的Bucket名称
......@@ -223,6 +235,16 @@ NS_ASSUME_NONNULL_BEGIN
- (OSSTask *)presignPublicURLWithBucketName:(NSString *)bucketName
withObjectKey:(NSString *)objectKey;
/**
如果Object的权限是公共读或者公共读写,调用这个接口对该Object签名出一个URL,可以把该URL转给第三方实现授权访问。
@bucketName Object所在的Bucket名称
@objectKey Object名称
@parameter 参数
*/
- (OSSTask *)presignPublicURLWithBucketName:(NSString *)bucketName
withObjectKey:(NSString *)objectKey
withParameters:(NSDictionary *)parameters;
/**
断点上传接口
这个接口封装了分块上传的若干接口以实现断点上传,但是需要用户自行保存UploadId。
......
......@@ -558,12 +558,28 @@
withObjectKey:(NSString *)objectKey
withExpirationInterval:(NSTimeInterval)interval {
return [self presignConstrainURLWithBucketName:bucketName
withObjectKey:objectKey
withExpirationInterval:interval
withParameters:@{}];
}
- (OSSTask *)presignConstrainURLWithBucketName:(NSString *)bucketName
withObjectKey:(NSString *)objectKey
withExpirationInterval:(NSTimeInterval)interval
withParameters:(NSDictionary *)parameters {
return [[OSSTask taskWithResult:nil] continueWithBlock:^id(OSSTask *task) {
NSString * resource = [NSString stringWithFormat:@"/%@/%@", bucketName, objectKey];
NSString * expires = [@((int64_t)[[NSDate oss_clockSkewFixedDate] timeIntervalSince1970] + interval) stringValue];
NSString * wholeSign = nil;
OSSFederationToken * token = nil;
NSError * error = nil;
NSMutableDictionary * params = [NSMutableDictionary new];
if (parameters) {
[params addEntriesFromDictionary:parameters];
}
if ([self.credentialProvider isKindOfClass:[OSSFederationCredentialProvider class]]) {
token = [(OSSFederationCredentialProvider *)self.credentialProvider getToken:&error];
......@@ -576,10 +592,17 @@
if ([self.credentialProvider isKindOfClass:[OSSFederationCredentialProvider class]]
|| [self.credentialProvider isKindOfClass:[OSSStsTokenCredentialProvider class]]) {
resource = [NSString stringWithFormat:@"%@?security-token=%@", resource, token.tToken];
if (token.tToken) {
[params setObject:token.tToken forKey:@"security-token"];
}
resource = [NSString stringWithFormat:@"%@?%@", resource, [OSSUtil populateSubresourceStringFromParameter:params]];
NSString * string2sign = [NSString stringWithFormat:@"GET\n\n\n%@\n%@", expires, resource];
wholeSign = [OSSUtil sign:string2sign withToken:token];
} else {
NSString * subresource = [OSSUtil populateSubresourceStringFromParameter:params];
if ([subresource length] > 0) {
resource = [NSString stringWithFormat:@"%@?%@", resource, [OSSUtil populateSubresourceStringFromParameter:params]];
}
NSString * string2sign = [NSString stringWithFormat:@"GET\n\n\n%@\n%@", expires, resource];
wholeSign = [self.credentialProvider sign:string2sign error:&error];
if (error) {
......@@ -602,24 +625,29 @@
if ([OSSUtil isOssOriginBucketHost:host]) {
host = [NSString stringWithFormat:@"%@.%@", bucketName, host];
}
NSString * stringURL = [NSString stringWithFormat:@"%@://%@/%@?OSSAccessKeyId=%@&Expires=%@&Signature=%@",
[params setObject:signature forKey:@"Signature"];
[params setObject:accessKey forKey:@"OSSAccessKeyId"];
[params setObject:expires forKey:@"Expires"];
NSString * stringURL = [NSString stringWithFormat:@"%@://%@/%@?%@",
endpointURL.scheme,
host,
[OSSUtil encodeURL:objectKey],
[OSSUtil encodeURL:accessKey],
expires,
[OSSUtil encodeURL:signature]];
if ([self.credentialProvider isKindOfClass:[OSSFederationCredentialProvider class]]
|| [self.credentialProvider isKindOfClass:[OSSStsTokenCredentialProvider class]]) {
stringURL = [NSString stringWithFormat:@"%@&security-token=%@", stringURL, [OSSUtil encodeURL:token.tToken]];
}
[OSSUtil populateQueryStringFromParameter:params]];
return [OSSTask taskWithResult:stringURL];
}];
}
- (OSSTask *)presignPublicURLWithBucketName:(NSString *)bucketName
withObjectKey:(NSString *)objectKey {
withObjectKey:(NSString *)objectKey {
return [self presignPublicURLWithBucketName:bucketName
withObjectKey:objectKey
withParameters:@{}];
}
- (OSSTask *)presignPublicURLWithBucketName:(NSString *)bucketName
withObjectKey:(NSString *)objectKey
withParameters:(NSDictionary *)parameters {
return [[OSSTask taskWithResult:nil] continueWithBlock:^id(OSSTask *task) {
NSURL * endpointURL = [NSURL URLWithString:self.endpoint];
......@@ -627,11 +655,20 @@
if ([OSSUtil isOssOriginBucketHost:host]) {
host = [NSString stringWithFormat:@"%@.%@", bucketName, host];
}
NSString * stringURL = [NSString stringWithFormat:@"%@://%@/%@",
endpointURL.scheme,
host,
[OSSUtil encodeURL:objectKey]];
return [OSSTask taskWithResult:stringURL];
if ([parameters count] > 0) {
NSString * stringURL = [NSString stringWithFormat:@"%@://%@/%@?%@",
endpointURL.scheme,
host,
[OSSUtil encodeURL:objectKey],
[OSSUtil populateQueryStringFromParameter:parameters]];
return [OSSTask taskWithResult:stringURL];
} else {
NSString * stringURL = [NSString stringWithFormat:@"%@://%@/%@",
endpointURL.scheme,
host,
[OSSUtil encodeURL:objectKey]];
return [OSSTask taskWithResult:stringURL];
}
}];
}
......
......@@ -12,7 +12,7 @@
#define OSSDefine_h
#define OSSUAPrefix @"aliyun-sdk-ios"
#define OSSSDKVersion @"2.6.0"
#define OSSSDKVersion @"2.6.1"
#define OSSListBucketResultXMLTOKEN @"ListBucketResult"
#define OSSNameXMLTOKEN @"Name"
......
......@@ -122,12 +122,13 @@ typedef OSSFederationToken * (^OSSGetFederationTokenBlock) ();
/**
用明文AK/SK实现的加签器,建议只在测试模式时使用
*/
@interface OSSPlainTextAKSKPairCredentialProvider : NSObject <OSSCredentialProvider>
@property (nonatomic, strong) NSString * accessKey;
@property (nonatomic, strong) NSString * secretKey;
- (instancetype)initWithPlainTextAccessKey:(NSString *)accessKey
secretKey:(NSString *)secretKey;
secretKey:(NSString *)secretKey __attribute__((deprecated("We recommend the STS authentication mode on mobile")));
@end
/**
......
......@@ -417,6 +417,17 @@
}
[sessionTask resume];
/**
内存泄露点,两个强引用指向 OSSNetworking 这个对象
1.sessionWithConfiguration:delegate:delegateQueue: 这个回调delegate会被强引用
2.当不再需要连接调用Session的时候,调用invalidateAndCancel直接关闭,或者调用finishTasksAndInvalidate等待当前Task结束后关闭。
3.这时Delegate会收到URLSession:didBecomeInvalidWithError:这个事件。
4.Delegate收到这个事件之后会被解引用。
*/
[_dataSession finishTasksAndInvalidate];
[_uploadFileSession finishTasksAndInvalidate];
return task;
}] continueWithBlock:^id(OSSTask *task) {
......
......@@ -28,6 +28,9 @@
+ (NSString *)base64Md5ForData:(NSData *)data;
+ (NSString *)base64Md5ForFilePath:(NSString *)filePath;
+ (NSString *)base64Md5ForFileURL:(NSURL *)fileURL;
+ (NSString *)populateSubresourceStringFromParameter:(NSDictionary *)parameters;
+ (NSString *)populateQueryStringFromParameter:(NSDictionary *)parameters;
+ (BOOL)isSubresource:(NSString *)param;
+ (NSString *)sign:(NSString *)content withToken:(OSSFederationToken *)token;
+ (NSString *)getRelativePath:(NSString *)fullPath;
+ (NSString *)detemineMimeTypeForFilePath:(NSString *)filePath uploadName:(NSString *)uploadName;
......
......@@ -26,7 +26,7 @@ int32_t const CHUNK_SIZE = 8 * 1024;
NSData *clearTextData = [data dataUsingEncoding:NSUTF8StringEncoding];
uint8_t input[20];
CCHmac(kCCHmacAlgSHA1, [secretData bytes], [secretData length], [clearTextData bytes], [clearTextData length], input);
return [self calBase64WithData:input];
}
......@@ -98,9 +98,9 @@ int32_t const CHUNK_SIZE = 8 * 1024;
+ (NSData *)constructHttpBodyForCreateBucketWithLocation:(NSString *)location {
NSString * body = [NSString stringWithFormat:@"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
@"<CreateBucketConfiguration>\n"
@"<LocationConstraint>%@</LocationConstraint>\n"
@"</CreateBucketConfiguration>\n",
@"<CreateBucketConfiguration>\n"
@"<LocationConstraint>%@</LocationConstraint>\n"
@"</CreateBucketConfiguration>\n",
location];
OSSLogVerbose(@"constucted create bucket body:\n%@", body);
return [body dataUsingEncoding:NSUTF8StringEncoding];
......@@ -256,6 +256,57 @@ int32_t const CHUNK_SIZE = 8 * 1024;
return [data base64EncodedStringWithOptions:0];
}
+ (BOOL)isSubresource:(NSString *)param {
/****************************************************************
* define a constant array to contain all specified subresource */
static NSArray * OSSSubResourceARRAY = nil;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
OSSSubResourceARRAY = @[
@"acl", @"uploads", @"location", @"cors", @"logging", @"website", @"referer", @"lifecycle", @"delete", @"append",
@"tagging", @"objectMeta", @"uploadId", @"partNumber", @"security-token", @"position", @"img", @"style",
@"styleName", @"replication", @"replicationProgress", @"replicationLocation", @"cname", @"bucketInfo", @"comp",
@"qos", @"live", @"status", @"vod", @"startTime", @"endTime", @"symlink", @"x-oss-process", @"response-content-type",
@"response-content-language", @"response-expires", @"response-cache-control", @"response-content-disposition", @"response-content-encoding"
];
});
/****************************************************************/
return [OSSSubResourceARRAY containsObject:param];
}
+ (NSString *)populateSubresourceStringFromParameter:(NSDictionary *)parameters {
NSMutableArray * subresource = [NSMutableArray new];
[parameters enumerateKeysAndObjectsUsingBlock:^(id _Nonnull key, id _Nonnull obj, BOOL * _Nonnull stop) {
NSString * keyStr = [key oss_trim];
NSString * valueStr = [obj oss_trim];
if (![OSSUtil isSubresource:keyStr]) {
return;
}
if ([valueStr length] == 0) {
[subresource addObject:keyStr];
} else {
[subresource addObject:[NSString stringWithFormat:@"%@=%@", keyStr, valueStr]];
}
}];
NSArray * sortedSubResource = [subresource sortedArrayUsingSelector:@selector(compare:)]; // 升序
return [sortedSubResource componentsJoinedByString:@"&"];
}
+ (NSString *)populateQueryStringFromParameter:(NSDictionary *)parameters {
NSMutableArray * subresource = [NSMutableArray new];
[parameters enumerateKeysAndObjectsUsingBlock:^(id _Nonnull key, id _Nonnull obj, BOOL * _Nonnull stop) {
NSString * keyStr = [OSSUtil encodeURL:[key oss_trim]];
NSString * valueStr = [OSSUtil encodeURL:[obj oss_trim]];
if ([valueStr length] == 0) {
[subresource addObject:keyStr];
} else {
[subresource addObject:[NSString stringWithFormat:@"%@=%@", keyStr, valueStr]];
}
}];
return [subresource componentsJoinedByString:@"&"];
}
+ (NSString *)sign:(NSString *)content withToken:(OSSFederationToken *)token {
NSString * sign = [OSSUtil calBase64Sha1WithData:content withSecret:token.tSecretKey];
return [NSString stringWithFormat:@"OSS %@:%@", token.tAccessKey, sign];
......@@ -957,7 +1008,7 @@ int32_t const CHUNK_SIZE = 8 * 1024;
@"ice": @"x-conference/x-cooltalk",
@"par ": @"text/plain-bas",
@"yaml": @"text/yaml"
};
};
});
NSString * extention = nil;
......
Copyright (c) 2015 zhouzhuo Aliyun inc.
Copyright (c) 2015 Aliyun inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
......
## 简介
本文档主要介绍OSS iOS SDK的安装和使用。本文档假设您已经开通了阿里云OSS 服务,并创建了Access Key ID 和Access Key Secret。文中的ID 指的是Access Key ID,KEY 指的是Access Key Secret。如果您还没有开通或者还不了解OSS,请登录[OSS产品主页](http://www.aliyun.com/product/oss)获取更多的帮助。
### 环境要求:
- iOS系统版本:iOS 7.0以上
- 必须注册有Aliyun.com用户账户,并开通OSS服务。
-----
## 安装
### 直接引入Framework
需要引入OSS iOS SDK framework。
您可以在MacOS系统中直接使用在本工程生成framwork:
```bash
# clone工程
$ git clone git@github.com:aliyun/aliyun-oss-ios-sdk.git
# 进入目录
$ cd aliyun-oss-ios-sdk
# 执行打包脚本
$ sh ./buildFramework.sh
# 进入打包生成目录,AliyunOSSiOS.framework生成在该目录下
$ cd Products && ls
```
在Xcode中,直接把framework拖入您对应的Target下即可,在弹出框勾选`Copy items if needed`
### Pod依赖
如果工程是通过pod管理依赖,那么在Podfile中加入以下依赖即可,不需要再导入framework:
```
pod 'AliyunOSSiOS', '~> 2.5.4'
```
CocoaPods是一个非常优秀的依赖管理工具,推荐参考官方文档: [CocoaPods安装和使用教程](http://code4app.com/article/cocoapods-install-usage)
直接引入Framework和Pod依赖,两种方式选其一即可。
### 工程中引入头文件
```objc
#import <AliyunOSSiOS/OSSService.h>
```
注意,引入Framework后,需要在工程`Build Settings``Other Linker Flags`中加入`-ObjC`。如果工程此前已经设置过`-force_load`选项,那么,需要加入`-force_load <framework path>/AliyunOSSiOS`
### 兼容IPv6-Only网络
OSS移动端SDK为了解决无线网络下域名解析容易遭到劫持的问题,已经引入了HTTPDNS进行域名解析,直接使用IP请求OSS服务端。在IPv6-Only的网络下,可能会遇到兼容性问题。而APP官方近期发布了关于IPv6-only网络环境兼容的APP审核要求,为此,SDK从`2.5.0`版本开始已经做了兼容性处理。在新版本中,除了`-ObjC`的设置,还需要引入两个系统库:
```
libresolv.tbd
SystemConfiguration.framework
```
### 对于OSSTask的一些说明
所有调用api的操作,都会立即获得一个OSSTask,如:
```
OSSTask * task = [client getObject:get];
```
可以为这个Task设置一个延续(continution),以实现异步回调,如:
```
[task continueWithBlock: ^(OSSTask *task) {
// do something
...
return nil;
}];
```
也可以等待这个Task完成,以实现同步等待,如:
```
[task waitUntilFinished];
...
```
-----
## 快速入门
以下演示了上传、下载文件的基本流程。更多细节用法可以参考本工程的:
test资源:[点击查看](https://github.com/aliyun/AliyunOSSiOS/tree/master/AliyunOSSiOSTests)
或者:
demo示例: [点击查看](https://github.com/alibaba/alicloud-ios-demo)
### STEP-1. 初始化OSSClient
初始化主要完成Endpoint设置、鉴权方式设置、Client参数设置。其中,鉴权方式包含明文设置模式、自签名模式、STS鉴权模式。鉴权细节详见后面链接给出的官网完整文档的`访问控制`章节。
```objc
NSString *endpoint = @"http://oss-cn-hangzhou.aliyuncs.com";
// 明文设置secret的方式建议只在测试时使用,更多鉴权模式参考后面链接给出的官网完整文档的`访问控制`章节
id<OSSCredentialProvider> credential = [[OSSPlainTextAKSKPairCredentialProvider alloc] initWithPlainTextAccessKey:@"<your accesskeyId>"
secretKey:@"<your accessKeySecret>"];
client = [[OSSClient alloc] initWithEndpoint:endpoint credentialProvider:credential];
```
### STEP-2. 上传文件
这里假设您已经在控制台上拥有自己的Bucket。SDK的所有操作,都会返回一个`OSSTask`,您可以为这个task设置一个延续动作,等待其异步完成,也可以通过调用`waitUntilFinished`阻塞等待其完成。
```objc
OSSPutObjectRequest * put = [OSSPutObjectRequest new];
put.bucketName = @"<bucketName>";
put.objectKey = @"<objectKey>";
put.uploadingData = <NSData *>; // 直接上传NSData
put.uploadProgress = ^(int64_t bytesSent, int64_t totalByteSent, int64_t totalBytesExpectedToSend) {
NSLog(@"%lld, %lld, %lld", bytesSent, totalByteSent, totalBytesExpectedToSend);
};
OSSTask * putTask = [client putObject:put];
[putTask continueWithBlock:^id(OSSTask *task) {
if (!task.error) {
NSLog(@"upload object success!");
} else {
NSLog(@"upload object failed, error: %@" , task.error);
}
return nil;
}];
// 可以等待任务完成
// [putTask waitUntilFinished];
```
### STEP-3. 下载指定文件
下载一个指定`object``NSData`:
```objc
OSSGetObjectRequest * request = [OSSGetObjectRequest new];
request.bucketName = @"<bucketName>";
request.objectKey = @"<objectKey>";
request.downloadProgress = ^(int64_t bytesWritten, int64_t totalBytesWritten, int64_t totalBytesExpectedToWrite) {
NSLog(@"%lld, %lld, %lld", bytesWritten, totalBytesWritten, totalBytesExpectedToWrite);
};
OSSTask * getTask = [client getObject:request];
[getTask continueWithBlock:^id(OSSTask *task) {
if (!task.error) {
NSLog(@"download object success!");
OSSGetObjectResult * getResult = task.result;
NSLog(@"download result: %@", getResult.downloadedData);
} else {
NSLog(@"download object failed, error: %@" ,task.error);
}
return nil;
}];
// 如果需要阻塞等待任务完成
// [task waitUntilFinished];
```
-----
## 完整文档
SDK提供进阶的上传、下载功能、断点续传,以及文件管理、Bucket管理等功能。详见官方完整文档:[点击查看](http://help.aliyun.com/document_detail/oss/sdk/ios-sdk/preface.html?spm=5176.product8314910_oss.4.30.tK2G02)
-----
## API文档
[点击查看](http://aliyun.github.io/aliyun-oss-ios-sdk/)
-----
## 联系我们
* 阿里云OSS官方网站:http://oss.aliyun.com
* 阿里云OSS官方论坛:http://bbs.aliyun.com
* 阿里云OSS官方文档中心:http://www.aliyun.com/product/oss#Docs
* 阿里云官方技术支持 登录OSS控制台 https://home.console.aliyun.com -> 点击"工单系统"
-----
## License
Copyright (c) 2015 Aliyun.Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
......@@ -14,7 +14,7 @@ PODS:
- AFNetworking/Serialization (3.1.0)
- AFNetworking/UIKit (3.1.0):
- AFNetworking/NSURLSession
- AliyunOSSiOS (2.6.0)
- AliyunOSSiOS (2.6.1)
- Bugly (2.4.8)
- DACircularProgress (2.3.1)
- DZNEmptyDataSet (1.8.1)
......@@ -62,7 +62,7 @@ PODS:
- WYPopoverController (0.3.9)
- WZLBadge (1.2.6)
- YXAlertController (1.0.7)
- YXKit (0.0.3)
- YXKit (0.0.4)
DEPENDENCIES:
- AFNetworking (~> 3.1.0)
......@@ -88,11 +88,11 @@ DEPENDENCIES:
- WYPopoverController (~> 0.3.9)
- WZLBadge (~> 1.2.5)
- YXAlertController (~> 1.0.7)
- YXKit (~> 0.0.3)
- YXKit (~> 0.0.4)
SPEC CHECKSUMS:
AFNetworking: 5e0e199f73d8626b11e79750991f5d173d1f8b67
AliyunOSSiOS: '058b038cc82000dadb8f8e3893a97243124f2898'
AliyunOSSiOS: 8174b695e09b136afe43a6af821c3ca71d423373
Bugly: da3c02408c14838d498429320545a8e439392978
DACircularProgress: 4dd437c0fc3da5161cb289e07ac449493d41db71
DZNEmptyDataSet: 9525833b9e68ac21c30253e1d3d7076cc828eaa7
......@@ -116,8 +116,8 @@ SPEC CHECKSUMS:
WYPopoverController: a9db25ac2841a686acdc0f3a99bdb21545db32f4
WZLBadge: 9ec779dcfd94c825518b395e8315fccaabff1bfa
YXAlertController: 68e27c48976fa9ecc0b82e63166b67863be8b70b
YXKit: 0d804e9731c7943864c6feb3599f53631231b47d
YXKit: ed7714bc185dde43b1a5d1c4f7df760d9b2ec7f7
PODFILE CHECKSUM: 2a3484ae85f198a58d70a25310964bfa6795c10a
PODFILE CHECKSUM: 962a8b96654703335e32ffd05a5bd7c50c577ac2
COCOAPODS: 1.2.1
......@@ -26,7 +26,7 @@ THE SOFTWARE.
## AliyunOSSiOS
Copyright (c) 2015 zhouzhuo Aliyun inc.
Copyright (c) 2015 Aliyun inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
......
......@@ -43,7 +43,7 @@ THE SOFTWARE.
</dict>
<dict>
<key>FooterText</key>
<string>Copyright (c) 2015 zhouzhuo Aliyun inc.
<string>Copyright (c) 2015 Aliyun inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
......
......@@ -26,7 +26,7 @@ THE SOFTWARE.
## AliyunOSSiOS
Copyright (c) 2015 zhouzhuo Aliyun inc.
Copyright (c) 2015 Aliyun inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
......
......@@ -43,7 +43,7 @@ THE SOFTWARE.
</dict>
<dict>
<key>FooterText</key>
<string>Copyright (c) 2015 zhouzhuo Aliyun inc.
<string>Copyright (c) 2015 Aliyun inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
......
......@@ -26,7 +26,7 @@ THE SOFTWARE.
## AliyunOSSiOS
Copyright (c) 2015 zhouzhuo Aliyun inc.
Copyright (c) 2015 Aliyun inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
......
......@@ -43,7 +43,7 @@ THE SOFTWARE.
</dict>
<dict>
<key>FooterText</key>
<string>Copyright (c) 2015 zhouzhuo Aliyun inc.
<string>Copyright (c) 2015 Aliyun inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
......
......@@ -13,16 +13,11 @@
/**
动画
@param endpoint 结束坐标
@param controlpoint 中间坐标
*/
- (void)startAnimationWithEndPoint:(CGPoint)endpoint withControlPoint:(CGPoint)controlpoint animateWithDuration:(NSTimeInterval)time;
- (void)startAnimationWithEndPoint:(CGPoint)endpoint withControlPoint:(CGPoint)controlpoint animateWithDuration:(NSTimeInterval)time completed:(void(^)())completed;
/**
用于RAC订阅是否调用
@param layerAnimation 动画layer
*/
- (void)removeFromLayer:(CALayer *)layerAnimation;
@end
......@@ -10,15 +10,15 @@
@implementation UIImageView (AnimationView)
/**
动画
@param endpoint 结束坐标
@param controlpoint 中间坐标
*/
- (void)startAnimationWithEndPoint:(CGPoint)endpoint withControlPoint:(CGPoint)controlpoint animateWithDuration:(NSTimeInterval)time;
- (void)startAnimationWithEndPoint:(CGPoint)endpoint withControlPoint:(CGPoint)controlpoint animateWithDuration:(NSTimeInterval)time completed:(void (^)())completed;
{
//终点
CGPoint endPoint = endpoint;
//控点
......@@ -56,6 +56,10 @@
animGroup.delegate = self;
[self.layer addAnimation:animGroup forKey:nil];
[self performSelector:@selector(removeFromLayer:) withObject:self.layer afterDelay:time];
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(time * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
completed();
});
}
#pragma mark -动画完成后移除
......
......@@ -25,7 +25,7 @@ abstract_target 'Lighting_base' do
pod 'iCarousel', '~> 1.8.3'
pod 'UMengAnalytics'
pod 'Bugly', '~> 2.4.7'
pod 'YXKit', '~> 0.0.3'
pod 'YXKit', '~> 0.0.4'
target 'Lighting' do
end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment