Created
March 27, 2015 08:10
-
-
Save VincentSit/fd64cd721c0e366b3f04 to your computer and use it in GitHub Desktop.
VSMedia.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// VSMedia.h | |
// rugu | |
// | |
// Created by Vincent Sit on 15/1/11. | |
// Copyright (c) 2015年 Vincent Sit. All rights reserved. | |
// | |
#import "VSBaseModel.h" | |
#import <CoreLocation/CLLocation.h> | |
/// media 类型. | |
typedef NS_ENUM(int16_t, VSMediaType) { | |
/// 图片类型. | |
VSMediaTypeImage, | |
/// 视频类型 | |
VSMediaTypeVideo, | |
/// 位置类型 | |
VSMediaTypeUnknown, | |
}; | |
@class VSPhoto, VSVideo, VSCaption, VSUser; | |
/** | |
* 表示一个用户发布的 ins. | |
*/ | |
@interface VSMedia : VSBaseModel | |
/// 类型 | |
@property (nonatomic) VSMediaType type; | |
/// 纬度 | |
@property (nonatomic) CLLocationDegrees latitude; | |
/// 经度 | |
@property (nonatomic) CLLocationDegrees longitude; | |
/// 标识符 | |
@property (nonatomic, copy) NSString *mediaID; | |
/// 标签 | |
@property (nonatomic, copy) NSSet *tags; | |
/// 标识这个 media 是否是这些 user 的 feed. | |
@property (nonatomic, copy) NSSet *feedUsers; | |
/// 图片 | |
@property (nonatomic, strong) VSPhoto *photo; | |
/// 视频 | |
@property (nonatomic, strong) VSVideo *video; | |
/// 说明 | |
@property (nonatomic, strong) VSCaption *caption; | |
/// 所属用户 | |
@property (nonatomic, strong) VSUser *user; | |
/*以下属性不存储在 Core Data 中*/ | |
@property (nonatomic) CLLocationCoordinate2D coordinate; | |
/** | |
* 获取当前最流行的 media 列表. | |
* | |
* @param completionHandler 请求结果回调, 数组中包含 `VSMedia` 对象. | |
* | |
* @return 当前任务. | |
*/ | |
+ (NSURLSessionDataTask *)loadPopularWithCompletionHandler:(VSArrayBlock)completionHandler; | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment