surui

sdk init

Showing 75 changed files with 844 additions and 16 deletions
1 Pod::Spec.new do |s| 1 Pod::Spec.new do |s|
2 s.name = "HHDoctorSDK" 2 s.name = "HHDoctorSDK"
3 - s.version = "1.1.2" 3 + s.version = "1.1.3"
4 s.summary = "和缓视频医生SDK(融云)" 4 s.summary = "和缓视频医生SDK(融云)"
5 5
6 s.description = <<-DESC 6 s.description = <<-DESC
  1 +//
  2 +// DACircularProgressView.h
  3 +// DACircularProgress
  4 +//
  5 +// Created by Daniel Amitay on 2/6/12.
  6 +// Copyright (c) 2012 Daniel Amitay. All rights reserved.
  7 +//
  8 +
  9 +#import <UIKit/UIKit.h>
  10 +
  11 +@interface DACircularProgressView : UIView
  12 +
  13 +@property(nonatomic, strong) UIColor *trackTintColor UI_APPEARANCE_SELECTOR;
  14 +@property(nonatomic, strong) UIColor *progressTintColor UI_APPEARANCE_SELECTOR;
  15 +@property(nonatomic, strong) UIColor *innerTintColor UI_APPEARANCE_SELECTOR;
  16 +@property(nonatomic) NSInteger roundedCorners UI_APPEARANCE_SELECTOR; // Can not use BOOL with UI_APPEARANCE_SELECTOR :-(
  17 +@property(nonatomic) CGFloat thicknessRatio UI_APPEARANCE_SELECTOR;
  18 +@property(nonatomic) NSInteger clockwiseProgress UI_APPEARANCE_SELECTOR; // Can not use BOOL with UI_APPEARANCE_SELECTOR :-(
  19 +@property(nonatomic) CGFloat progress;
  20 +
  21 +@property(nonatomic) CGFloat indeterminateDuration UI_APPEARANCE_SELECTOR;
  22 +@property(nonatomic) NSInteger indeterminate UI_APPEARANCE_SELECTOR; // Can not use BOOL with UI_APPEARANCE_SELECTOR :-(
  23 +
  24 +- (void)setProgress:(CGFloat)progress animated:(BOOL)animated;
  25 +- (void)setProgress:(CGFloat)progress animated:(BOOL)animated initialDelay:(CFTimeInterval)initialDelay;
  26 +- (void)setProgress:(CGFloat)progress animated:(BOOL)animated initialDelay:(CFTimeInterval)initialDelay withDuration:(CFTimeInterval)duration;
  27 +
  28 +@end
  1 +//
  2 +// DALabeledCircularProgressView.h
  3 +// DACircularProgressExample
  4 +//
  5 +// Created by Josh Sklar on 4/8/14.
  6 +// Copyright (c) 2014 Shout Messenger. All rights reserved.
  7 +//
  8 +
  9 +#import "DACircularProgressView.h"
  10 +
  11 +/**
  12 + @class DALabeledCircularProgressView
  13 +
  14 + @brief Subclass of DACircularProgressView that adds a UILabel.
  15 + */
  16 +@interface DALabeledCircularProgressView : DACircularProgressView
  17 +
  18 +/**
  19 + UILabel placed right on the DACircularProgressView.
  20 + */
  21 +@property (strong, nonatomic) UILabel *progressLabel;
  22 +
  23 +@end
@@ -165,9 +165,10 @@ typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); @@ -165,9 +165,10 @@ typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4)));
165 #if __has_feature(modules) 165 #if __has_feature(modules)
166 @import Foundation; 166 @import Foundation;
167 @import CoreLocation; 167 @import CoreLocation;
168 -@import ObjectiveC;  
169 @import UIKit; 168 @import UIKit;
170 @import CoreGraphics; 169 @import CoreGraphics;
  170 +@import QuartzCore;
  171 +@import ObjectiveC;
171 @import Photos; 172 @import Photos;
172 #endif 173 #endif
173 174
@@ -194,14 +195,200 @@ typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); @@ -194,14 +195,200 @@ typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4)));
194 195
195 196
196 197
  198 +@class UIImage;
  199 +@class NSCoder;
  200 +@class UITouch;
  201 +@class UIEvent;
  202 +
  203 +/// A simple rating view that can set whole, half or floating point ratings.
  204 +SWIFT_CLASS("_TtC11HHDoctorSDK15FloatRatingView")
  205 +@interface FloatRatingView : UIView
  206 +/// Sets the empty image (e.g. a star outline)
  207 +@property (nonatomic, strong) UIImage * _Nullable emptyImage;
  208 +/// Sets the full image that is overlayed on top of the empty image.
  209 +/// Should be same size and shape as the empty image.
  210 +@property (nonatomic, strong) UIImage * _Nullable fullImage;
  211 +/// Minimum rating.
  212 +@property (nonatomic) NSInteger minRating;
  213 +/// Max rating value.
  214 +@property (nonatomic) NSInteger maxRating;
  215 +/// Minimum image size.
  216 +@property (nonatomic) CGSize minImageSize;
  217 +/// Set the current rating.
  218 +@property (nonatomic) float rating;
  219 +/// Sets whether or not the rating view can be changed by panning.
  220 +@property (nonatomic) BOOL editable;
  221 +/// Ratings change by 0.5. Takes priority over floatRatings property.
  222 +@property (nonatomic) BOOL halfRatings;
  223 +/// Ratings change by floating point values.
  224 +@property (nonatomic) BOOL floatRatings;
  225 +- (nonnull instancetype)initWithFrame:(CGRect)frame OBJC_DESIGNATED_INITIALIZER;
  226 +- (nullable instancetype)initWithCoder:(NSCoder * _Nonnull)aDecoder OBJC_DESIGNATED_INITIALIZER;
  227 +- (void)layoutSubviews;
  228 +- (void)touchesBegan:(NSSet<UITouch *> * _Nonnull)touches withEvent:(UIEvent * _Nullable)event;
  229 +- (void)touchesMoved:(NSSet<UITouch *> * _Nonnull)touches withEvent:(UIEvent * _Nullable)event;
  230 +- (void)touchesEnded:(NSSet<UITouch *> * _Nonnull)touches withEvent:(UIEvent * _Nullable)event;
  231 +@end
  232 +
  233 +
  234 +SWIFT_PROTOCOL("_TtP11HHDoctorSDK23FloatRatingViewDelegate_")
  235 +@protocol FloatRatingViewDelegate
  236 +/// Returns the rating value when touch events end
  237 +- (void)floatRatingView:(FloatRatingView * _Nonnull)ratingView didUpdate:(float)rating;
  238 +@optional
  239 +/// Returns the rating value as the user pans
  240 +- (void)floatRatingView:(FloatRatingView * _Nonnull)ratingView isUpdating:(float)rating;
  241 +@end
  242 +
  243 +/// 呼叫类型
  244 +/// <ul>
  245 +/// <li>
  246 +/// child: 儿童
  247 +/// </li>
  248 +/// <li>
  249 +/// adult: 成人
  250 +/// </li>
  251 +/// </ul>
  252 +typedef SWIFT_ENUM(NSInteger, HHCallType) {
  253 + HHCallTypeChild = 600000,
  254 + HHCallTypeAdult = 600002,
  255 +};
  256 +
  257 +
  258 +SWIFT_CLASS("_TtC11HHDoctorSDK14HHEveluateView")
  259 +@interface HHEveluateView : UIView
  260 +- (void)awakeFromNib;
  261 +- (nonnull instancetype)initWithFrame:(CGRect)frame OBJC_DESIGNATED_INITIALIZER;
  262 +- (nullable instancetype)initWithCoder:(NSCoder * _Nonnull)aDecoder OBJC_DESIGNATED_INITIALIZER;
  263 +@end
  264 +
  265 +@class CAAnimation;
  266 +
  267 +@interface HHEveluateView (SWIFT_EXTENSION(HHDoctorSDK)) <CAAnimationDelegate>
  268 +- (void)animationDidStop:(CAAnimation * _Nonnull)anim finished:(BOOL)flag;
  269 +@end
  270 +
  271 +
  272 +@interface HHEveluateView (SWIFT_EXTENSION(HHDoctorSDK)) <FloatRatingViewDelegate>
  273 +- (void)floatRatingView:(FloatRatingView * _Nonnull)ratingView didUpdate:(float)rating;
  274 +@end
  275 +
  276 +
  277 +
  278 +
  279 +
  280 +/// 接通前的呼叫状态
  281 +/// <ul>
  282 +/// <li>
  283 +/// onStart: 呼叫开始
  284 +/// </li>
  285 +/// <li>
  286 +/// waitingDoctor: 等待空闲的医生
  287 +/// </li>
  288 +/// <li>
  289 +/// callFreeDoctor: 有医生空闲,开始呼叫
  290 +/// </li>
  291 +/// <li>
  292 +/// callConnect: 建立呼叫
  293 +/// </li>
  294 +/// <li>
  295 +/// didRing: 医生响铃,等待接受
  296 +/// </li>
  297 +/// </ul>
  298 +typedef SWIFT_ENUM(NSInteger, HHMCallingState) {
  299 + HHMCallingStateOnStart = 0,
  300 + HHMCallingStateWaitingDoctor = 1,
  301 + HHMCallingStateCallFreeDoctor = 2,
  302 + HHMCallingStateCallConnect = 3,
  303 + HHMCallingStateDidRing = 4,
  304 +};
  305 +
  306 +typedef SWIFT_ENUM(NSInteger, HHMLoginCode) {
  307 + HHMLoginCodeOK = 0,
  308 + HHMLoginCodeNetError = -1,
  309 +};
  310 +
  311 +@class HHSDKOptions;
  312 +@protocol HHMVideoDelegate;
197 313
198 SWIFT_CLASS("_TtC11HHDoctorSDK6HHMSDK") 314 SWIFT_CLASS("_TtC11HHDoctorSDK6HHMSDK")
199 @interface HHMSDK : NSObject 315 @interface HHMSDK : NSObject
  316 +SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, strong, getter=default) HHMSDK * _Nonnull default_;)
  317 ++ (HHMSDK * _Nonnull)default SWIFT_WARN_UNUSED_RESULT;
  318 +/// 初始化 SDK
  319 +/// \param option 可选的 SDK 配置
  320 +///
  321 +- (void)startWithOption:(HHSDKOptions * _Nullable)option;
  322 +/// 登录账号
  323 +/// \param uuid 用户的 唯一标志符
  324 +///
  325 +/// \param completion 完成回调
  326 +///
  327 +- (void)loginWithUuid:(NSInteger)uuid completion:(void (^ _Nonnull)(NSError * _Nullable))completion;
  328 +/// 自动登录(如果已经保存了用户帐号和令牌,建议使用这个登录方式)
  329 +/// \param uuid 自动登录参数
  330 +///
  331 +- (void)autoLoginWithUuid:(NSInteger)uuid;
  332 +/// 登出
  333 +- (void)logout;
  334 +/// 主叫发起通话
  335 +/// \param type 呼叫类型
  336 +///
  337 +- (void)startCall:(enum HHCallType)type;
  338 +/// 更新APNS Token
  339 +/// \param token APNS Token
  340 +///
  341 +- (void)updateAPNSWithToken:(NSData * _Nonnull)token;
  342 +/// 获取当前 SDK 版本号
  343 +@property (nonatomic, readonly, copy) NSString * _Nonnull SDKVersion;
  344 +/// 是否登录成功
  345 +@property (nonatomic, readonly) BOOL isLogined;
  346 +/// 添加视频监听
  347 +/// \param delegate 代理
  348 +///
  349 +- (void)addWithDelegate:(id <HHMVideoDelegate> _Nonnull)delegate;
  350 +- (void)removeWithDelegate:(id <HHMVideoDelegate> _Nonnull)delegate;
200 - (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER; 351 - (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
201 @end 352 @end
202 353
203 354
204 355
  356 +enum PermissionType : NSInteger;
  357 +
  358 +/// 视频管理器代理
  359 +SWIFT_PROTOCOL("_TtP11HHDoctorSDK16HHMVideoDelegate_")
  360 +@protocol HHMVideoDelegate <NSObject>
  361 +/// 主动视频时的呼叫状态变化
  362 +/// \param state 当前呼叫状态
  363 +///
  364 +- (void)callStateChange:(enum HHMCallingState)state;
  365 +/// 通话已接通
  366 +- (void)callDidEstablish;
  367 +/// 呼叫失败
  368 +/// \param error 错误信息
  369 +///
  370 +- (void)onFailWithError:(NSError * _Nonnull)error;
  371 +- (void)onCancel;
  372 +/// 通话已结束 (接通之后才有结束)
  373 +- (void)callDidFinish;
  374 +/// 转呼医生
  375 +- (void)onExtensionDoctor;
  376 +/// 接收到呼叫(被呼叫方)
  377 +/// \param callID 呼叫的 id
  378 +///
  379 +/// \param from 呼叫人 id
  380 +///
  381 +- (void)onReceive:(NSString * _Nonnull)callID from:(NSString * _Nonnull)from;
  382 +/// 收到视频呼入时的操作(被呼叫方)
  383 +/// \param accept 接受或者拒接
  384 +///
  385 +- (void)onResponse:(BOOL)accept;
  386 +/// 缺少必要权限
  387 +/// \param type 缺少的权限类型
  388 +///
  389 +- (void)onLeakPermission:(enum PermissionType)type;
  390 +@end
  391 +
205 392
206 SWIFT_CLASS("_TtC11HHDoctorSDK23HHMediaStatusCheckUtils") 393 SWIFT_CLASS("_TtC11HHDoctorSDK23HHMediaStatusCheckUtils")
207 @interface HHMediaStatusCheckUtils : NSObject 394 @interface HHMediaStatusCheckUtils : NSObject
@@ -215,7 +402,6 @@ SWIFT_CLASS("_TtC11HHDoctorSDK13HHNetObserver") @@ -215,7 +402,6 @@ SWIFT_CLASS("_TtC11HHDoctorSDK13HHNetObserver")
215 + (nonnull instancetype)new SWIFT_DEPRECATED_MSG("-init is unavailable"); 402 + (nonnull instancetype)new SWIFT_DEPRECATED_MSG("-init is unavailable");
216 @end 403 @end
217 404
218 -@class NSCoder;  
219 @class UIWindow; 405 @class UIWindow;
220 @class UICollectionView; 406 @class UICollectionView;
221 @class UICollectionViewCell; 407 @class UICollectionViewCell;
@@ -271,6 +457,22 @@ SWIFT_CLASS("_TtC11HHDoctorSDK23HHPhotoPickerController") @@ -271,6 +457,22 @@ SWIFT_CLASS("_TtC11HHDoctorSDK23HHPhotoPickerController")
271 /// 全局配置 457 /// 全局配置
272 SWIFT_CLASS("_TtC11HHDoctorSDK12HHSDKOptions") 458 SWIFT_CLASS("_TtC11HHDoctorSDK12HHSDKOptions")
273 @interface HHSDKOptions : NSObject 459 @interface HHSDKOptions : NSObject
  460 +/// hud 自动显示的时间
  461 +@property (nonatomic) NSTimeInterval hudDisTime;
  462 +/// 调试模式(打印日志)
  463 +@property (nonatomic) BOOL isDebug;
  464 +/// 是否开启测试服
  465 +@property (nonatomic) BOOL isDevelopment;
  466 +@property (nonatomic, copy) NSString * _Nonnull productId;
  467 +/// 推送证书名
  468 +@property (nonatomic, copy) NSString * _Nullable cerName;
  469 +/// 呼叫进入是否需要等待(呼入present 控制器前处理其他逻辑,3秒后自动失效)
  470 +@property (nonatomic) BOOL shouldWaingCall;
  471 +/// 是否开启美颜
  472 +@property (nonatomic) BOOL allowBeauty;
  473 +/// 允许视频完成后评价
  474 +@property (nonatomic) BOOL allowEvaluate;
  475 +- (nonnull instancetype)initWithProductId:(NSString * _Nonnull)productId isDebug:(BOOL)isDebug isDevelop:(BOOL)isDevelop OBJC_DESIGNATED_INITIALIZER;
274 - (nonnull instancetype)init SWIFT_UNAVAILABLE; 476 - (nonnull instancetype)init SWIFT_UNAVAILABLE;
275 + (nonnull instancetype)new SWIFT_DEPRECATED_MSG("-init is unavailable"); 477 + (nonnull instancetype)new SWIFT_DEPRECATED_MSG("-init is unavailable");
276 @end 478 @end
@@ -287,6 +489,16 @@ SWIFT_CLASS("_TtC11HHDoctorSDK12HHSDKOptions") @@ -287,6 +489,16 @@ SWIFT_CLASS("_TtC11HHDoctorSDK12HHSDKOptions")
287 489
288 490
289 491
  492 +typedef SWIFT_ENUM(NSInteger, PermissionType) {
  493 + PermissionTypeLocationAlways = 0,
  494 + PermissionTypeLocationWhenInUse = 1,
  495 + PermissionTypeMicrophone = 2,
  496 + PermissionTypeCamera = 3,
  497 + PermissionTypePhotos = 4,
  498 +};
  499 +
  500 +
  501 +
290 502
291 503
292 504
@@ -329,6 +541,8 @@ SWIFT_CLASS("_TtC11HHDoctorSDK12HHSDKOptions") @@ -329,6 +541,8 @@ SWIFT_CLASS("_TtC11HHDoctorSDK12HHSDKOptions")
329 541
330 542
331 543
  544 +
  545 +
332 #if __has_attribute(external_source_symbol) 546 #if __has_attribute(external_source_symbol)
333 # pragma clang attribute pop 547 # pragma clang attribute pop
334 #endif 548 #endif
@@ -46,18 +46,16 @@ @@ -46,18 +46,16 @@
46 #import "ijksdl_ios.h" 46 #import "ijksdl_ios.h"
47 #import "ijksdl_vout_overlay_videotoolbox.h" 47 #import "ijksdl_vout_overlay_videotoolbox.h"
48 #import "NTESGLView.h" 48 #import "NTESGLView.h"
49 -#import "CGGeometry+RSKImageCropper.h"  
50 -#import "RSKImageCropper.h"  
51 -#import "RSKImageCropViewController+Protected.h"  
52 -#import "RSKImageCropViewController.h"  
53 -#import "RSKImageScrollView.h"  
54 -#import "RSKTouchView.h"  
55 -#import "UIApplication+RSKImageCropper.h"  
56 -#import "UIImage+RSKImageCropper.h"  
57 -#import "HHCameraImageModel.h"  
58 -#import "PhotoPicker.h"  
59 -#import "HHCameraUtil.h"  
60 -#import "HHPHAssetManager.h" 49 +#import "DACircularProgressView.h"
  50 +#import "DALabeledCircularProgressView.h"
  51 +#import "IDMCaptionView.h"
  52 +#import "IDMPBConstants.h"
  53 +#import "IDMPhoto.h"
  54 +#import "IDMPhotoBrowser.h"
  55 +#import "IDMPhotoProtocol.h"
  56 +#import "IDMTapDetectingImageView.h"
  57 +#import "IDMTapDetectingView.h"
  58 +#import "IDMZoomingScrollView.h"
61 #import "HHAnimatedImageRep.h" 59 #import "HHAnimatedImageRep.h"
62 #import "HHImageCache.h" 60 #import "HHImageCache.h"
63 #import "HHImageCacheConfig.h" 61 #import "HHImageCacheConfig.h"
@@ -84,6 +82,18 @@ @@ -84,6 +82,18 @@
84 #import "UIImageView+hhWebCache.h" 82 #import "UIImageView+hhWebCache.h"
85 #import "UIView+hhWebCache.h" 83 #import "UIView+hhWebCache.h"
86 #import "UIView+hhWebCacheOperation.h" 84 #import "UIView+hhWebCacheOperation.h"
  85 +#import "CGGeometry+RSKImageCropper.h"
  86 +#import "RSKImageCropper.h"
  87 +#import "RSKImageCropViewController+Protected.h"
  88 +#import "RSKImageCropViewController.h"
  89 +#import "RSKImageScrollView.h"
  90 +#import "RSKTouchView.h"
  91 +#import "UIApplication+RSKImageCropper.h"
  92 +#import "UIImage+RSKImageCropper.h"
  93 +#import "HHCameraImageModel.h"
  94 +#import "PhotoPicker.h"
  95 +#import "HHCameraUtil.h"
  96 +#import "HHPHAssetManager.h"
87 97
88 FOUNDATION_EXPORT double HHDoctorSDKVersionNumber; 98 FOUNDATION_EXPORT double HHDoctorSDKVersionNumber;
89 FOUNDATION_EXPORT const unsigned char HHDoctorSDKVersionString[]; 99 FOUNDATION_EXPORT const unsigned char HHDoctorSDKVersionString[];
  1 +//
  2 +// IDMCaptionView.h
  3 +// IDMPhotoBrowser
  4 +//
  5 +// Created by Michael Waterfall on 30/12/2011.
  6 +// Copyright (c) 2011 __MyCompanyName__. All rights reserved.
  7 +//
  8 +
  9 +#import <UIKit/UIKit.h>
  10 +#import "IDMPhotoProtocol.h"
  11 +
  12 +@interface IDMCaptionView : UIView
  13 +
  14 +@property (nonatomic, strong) UILabel *label;
  15 +@property (nonatomic, strong, readonly) id<IDMPhoto> photo;
  16 +
  17 +// Init
  18 +- (id)initWithPhoto:(id<IDMPhoto>)photo;
  19 +
  20 +// To create your own custom caption view, subclass this view
  21 +// and override the following two methods (as well as any other
  22 +// UIView methods that you see fit):
  23 +
  24 +// Override -setupCaption so setup your subviews and customise the appearance
  25 +// of your custom caption
  26 +// You can access the photo's data by accessing the _photo ivar
  27 +// If you need more data per photo then simply subclass IDMPhoto and return your
  28 +// subclass to the photo browsers -photoBrowser:photoAtIndex: delegate method
  29 +- (void)setupCaption;
  30 +
  31 +// Override -sizeThatFits: and return a CGSize specifying the height of your
  32 +// custom caption view. With width property is ignored and the caption is displayed
  33 +// the full width of the screen
  34 +- (CGSize)sizeThatFits:(CGSize)size;
  35 +
  36 +@end
  1 +//
  2 +// IDMPhotoBrowserConstants.h
  3 +// PhotoBrowserDemo
  4 +//
  5 +// Created by Eduardo Callado on 10/7/13.
  6 +//
  7 +//
  8 +
  9 +#define PADDING 10
  10 +#define PAGE_INDEX_TAG_OFFSET 1000
  11 +#define PAGE_INDEX(page) ([(page) tag] - PAGE_INDEX_TAG_OFFSET)
  12 +
  13 +// Debug Logging
  14 +#if 0 // Set to 1 to enable debug logging
  15 + #define IDMLog(x, ...) NSLog(x, ## __VA_ARGS__);
  16 +#else
  17 + #define IDMLog(x, ...)
  18 +#endif
  19 +
  20 +//
  21 +// System Versioning Preprocessor Macros
  22 +//
  23 +
  24 +//#define SYSTEM_VERSION_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedSame)
  25 +//#define SYSTEM_VERSION_GREATER_THAN(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedDescending)
  26 +//#define SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedAscending)
  27 +//#define SYSTEM_VERSION_LESS_THAN(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedAscending)
  28 +//#define SYSTEM_VERSION_LESS_THAN_OR_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedDescending)
  1 +//
  2 +// IDMPhoto.h
  3 +// IDMPhotoBrowser
  4 +//
  5 +// Created by Michael Waterfall on 17/10/2010.
  6 +// Copyright 2010 d3i. All rights reserved.
  7 +//
  8 +
  9 +#import <Foundation/Foundation.h>
  10 +#import "IDMPhotoProtocol.h"
  11 +#import "HHWebImageManager.h"
  12 +//#import <SDWebImage/SDWebImageManager.h>
  13 +
  14 +// This class models a photo/image and it's caption
  15 +// If you want to handle photos, caching, decompression
  16 +// yourself then you can simply ensure your custom data model
  17 +// conforms to IDMPhotoProtocol
  18 +@interface IDMPhoto : NSObject <IDMPhoto>
  19 +
  20 +// Progress download block, used to update the circularView
  21 +typedef void (^IDMProgressUpdateBlock)(CGFloat progress);
  22 +
  23 +// Properties
  24 +@property (nonatomic, strong) NSString *caption;
  25 +@property (nonatomic, strong) NSURL *photoURL;
  26 +@property (nonatomic, strong) IDMProgressUpdateBlock progressUpdateBlock;
  27 +@property (nonatomic, strong) UIImage *placeholderImage;
  28 +
  29 +// Class
  30 ++ (IDMPhoto *)photoWithImage:(UIImage *)image;
  31 ++ (IDMPhoto *)photoWithFilePath:(NSString *)path;
  32 ++ (IDMPhoto *)photoWithURL:(NSURL *)url;
  33 +
  34 ++ (NSArray *)photosWithImages:(NSArray *)imagesArray;
  35 ++ (NSArray *)photosWithFilePaths:(NSArray *)pathsArray;
  36 ++ (NSArray *)photosWithURLs:(NSArray *)urlsArray;
  37 +
  38 +// Init
  39 +- (id)initWithImage:(UIImage *)image;
  40 +- (id)initWithFilePath:(NSString *)path;
  41 +- (id)initWithURL:(NSURL *)url;
  42 +
  43 +@end
  44 +
  1 +//
  2 +// IDMPhotoBrowser.h
  3 +// IDMPhotoBrowser
  4 +//
  5 +// Created by Michael Waterfall on 14/10/2010.
  6 +// Copyright 2010 d3i. All rights reserved.
  7 +//
  8 +
  9 +#import <UIKit/UIKit.h>
  10 +#import <MessageUI/MessageUI.h>
  11 +
  12 +#import "IDMPhoto.h"
  13 +#import "IDMPhotoProtocol.h"
  14 +#import "IDMCaptionView.h"
  15 +#import "IDMTapDetectingImageView.h"
  16 +
  17 +// Delgate
  18 +@class IDMPhotoBrowser;
  19 +@protocol IDMPhotoBrowserDelegate <NSObject>
  20 +@optional
  21 +- (void)willAppearPhotoBrowser:(IDMPhotoBrowser *)photoBrowser;
  22 +- (void)willDisappearPhotoBrowser:(IDMPhotoBrowser *)photoBrowser;
  23 +- (void)photoBrowser:(IDMPhotoBrowser *)photoBrowser didShowPhotoAtIndex:(NSUInteger)index;
  24 +- (void)photoBrowser:(IDMPhotoBrowser *)photoBrowser didDismissAtPageIndex:(NSUInteger)index;
  25 +- (void)photoBrowser:(IDMPhotoBrowser *)photoBrowser willDismissAtPageIndex:(NSUInteger)index;
  26 +- (void)photoBrowser:(IDMPhotoBrowser *)photoBrowser didDismissActionSheetWithButtonIndex:(NSUInteger)buttonIndex photoIndex:(NSUInteger)photoIndex;
  27 +- (IDMCaptionView *)photoBrowser:(IDMPhotoBrowser *)photoBrowser captionViewForPhotoAtIndex:(NSUInteger)index;
  28 +- (void)photoBrowser:(IDMPhotoBrowser *)photoBrowser imageFailed:(NSUInteger)index imageView:(IDMTapDetectingImageView *)imageView;
  29 +@end
  30 +
  31 +// IDMPhotoBrowser
  32 +@interface IDMPhotoBrowser : UIViewController <UIScrollViewDelegate, UIActionSheetDelegate>
  33 +
  34 +// Properties
  35 +@property (nonatomic, strong) id <IDMPhotoBrowserDelegate> delegate;
  36 +
  37 +// Toolbar customization
  38 +@property (nonatomic) BOOL displayToolbar;
  39 +@property (nonatomic) BOOL displayCounterLabel;
  40 +@property (nonatomic) BOOL displayArrowButton;
  41 +@property (nonatomic) BOOL displayActionButton;
  42 +@property (nonatomic, strong) NSArray *actionButtonTitles;
  43 +@property (nonatomic, weak) UIImage *leftArrowImage, *leftArrowSelectedImage;
  44 +@property (nonatomic, weak) UIImage *rightArrowImage, *rightArrowSelectedImage;
  45 +@property (nonatomic, weak) UIImage *actionButtonImage, *actionButtonSelectedImage;
  46 +
  47 +// View customization
  48 +@property (nonatomic) BOOL displayDoneButton;
  49 +@property (nonatomic) BOOL useWhiteBackgroundColor;
  50 +@property (nonatomic, weak) UIImage *doneButtonImage;
  51 +@property (nonatomic, weak) UIColor *trackTintColor, *progressTintColor;
  52 +@property (nonatomic, assign) CGFloat doneButtonRightInset, doneButtonTopInset;
  53 +@property (nonatomic, assign) CGSize doneButtonSize;
  54 +
  55 +@property (nonatomic, weak) UIImage *scaleImage;
  56 +
  57 +@property (nonatomic) BOOL arrowButtonsChangePhotosAnimated;
  58 +
  59 +@property (nonatomic) BOOL forceHideStatusBar;
  60 +@property (nonatomic) BOOL usePopAnimation;
  61 +@property (nonatomic) BOOL disableVerticalSwipe;
  62 +
  63 +@property (nonatomic) BOOL dismissOnTouch;
  64 +
  65 +// Default value: true
  66 +// Set to false to tell the photo viewer not to hide the interface when scrolling
  67 +@property (nonatomic) BOOL autoHideInterface;
  68 +
  69 +// Defines zooming of the background (default 1.0)
  70 +@property (nonatomic) float backgroundScaleFactor;
  71 +
  72 +// Animation time (default .28)
  73 +@property (nonatomic) float animationDuration;
  74 +
  75 +// Init
  76 +- (id)initWithPhotos:(NSArray *)photosArray;
  77 +
  78 +// Init (animated from view)
  79 +- (id)initWithPhotos:(NSArray *)photosArray animatedFromView:(UIView*)view;
  80 +
  81 +// Init with NSURL objects
  82 +- (id)initWithPhotoURLs:(NSArray *)photoURLsArray;
  83 +
  84 +// Init with NSURL objects (animated from view)
  85 +- (id)initWithPhotoURLs:(NSArray *)photoURLsArray animatedFromView:(UIView*)view;
  86 +
  87 +// Reloads the photo browser and refetches data
  88 +- (void)reloadData;
  89 +
  90 +// Set page that photo browser starts on
  91 +- (void)setInitialPageIndex:(NSUInteger)index;
  92 +
  93 +// Get IDMPhoto at index
  94 +- (id<IDMPhoto>)photoAtIndex:(NSUInteger)index;
  95 +
  96 +@end
  1 +//
  2 +// IDMPhotoProtocol.h
  3 +// IDMPhotoBrowser
  4 +//
  5 +// Created by Michael Waterfall on 02/01/2012.
  6 +// Copyright (c) 2012 __MyCompanyName__. All rights reserved.
  7 +//
  8 +
  9 +#import <UIKit/UIKit.h>
  10 +#import <Foundation/Foundation.h>
  11 +#import "IDMPBConstants.h"
  12 +
  13 +// Name of notification used when a photo has completed loading process
  14 +// Used to notify browser display the image
  15 +#define IDMPhoto_LOADING_DID_END_NOTIFICATION @"IDMPhoto_LOADING_DID_END_NOTIFICATION"
  16 +
  17 +// If you wish to use your own data models for photo then they must conform
  18 +// to this protocol. See instructions for details on each method.
  19 +// Otherwise you can use the IDMPhoto object or subclass it yourself to
  20 +// store more information per photo.
  21 +//
  22 +// You can see the IDMPhoto class for an example implementation of this protocol
  23 +//
  24 +@protocol IDMPhoto <NSObject>
  25 +
  26 +@required
  27 +
  28 +// Return underlying UIImage to be displayed
  29 +// Return nil if the image is not immediately available (loaded into memory, preferably
  30 +// already decompressed) and needs to be loaded from a source (cache, file, web, etc)
  31 +// IMPORTANT: You should *NOT* use this method to initiate
  32 +// fetching of images from any external of source. That should be handled
  33 +// in -loadUnderlyingImageAndNotify: which may be called by the photo browser if this
  34 +// methods returns nil.
  35 +- (UIImage *)underlyingImage;
  36 +
  37 +// Called when the browser has determined the underlying images is not
  38 +// already loaded into memory but needs it.
  39 +// You must load the image asyncronously (and decompress it for better performance).
  40 +// See IDMPhoto object for an example implementation.
  41 +// When the underlying UIImage is loaded (or failed to load) you should post the following
  42 +// notification:
  43 +//
  44 +// [[NSNotificationCenter defaultCenter] postNotificationName:IDMPhoto_LOADING_DID_END_NOTIFICATION
  45 +// object:self];
  46 +//
  47 +- (void)loadUnderlyingImageAndNotify;
  48 +
  49 +// This is called when the photo browser has determined the photo data
  50 +// is no longer needed or there are low memory conditions
  51 +// You should release any underlying (possibly large and decompressed) image data
  52 +// as long as the image can be re-loaded (from cache, file, or URL)
  53 +- (void)unloadUnderlyingImage;
  54 +
  55 +@optional
  56 +
  57 +// Return a caption string to be displayed over the image
  58 +// Return nil to display no caption
  59 +- (NSString *)caption;
  60 +
  61 +// Return placeholder UIImage to be displayed while loading underlyingImage
  62 +// Return nil if there is no placeholder
  63 +- (UIImage *)placeholderImage;
  64 +
  65 +@end
  1 +//
  2 +// IDMTapDetectingImageView.h
  3 +// IDMPhotoBrowser
  4 +//
  5 +// Created by Michael Waterfall on 04/11/2009.
  6 +// Copyright 2009 d3i. All rights reserved.
  7 +//
  8 +
  9 +#import <UIKit/UIKit.h>
  10 +#import <Foundation/Foundation.h>
  11 +
  12 +@protocol IDMTapDetectingImageViewDelegate;
  13 +
  14 +@interface IDMTapDetectingImageView : UIImageView {
  15 + id <IDMTapDetectingImageViewDelegate> __weak tapDelegate;
  16 +}
  17 +@property (nonatomic, weak) id <IDMTapDetectingImageViewDelegate> tapDelegate;
  18 +- (void)handleSingleTap:(UITouch *)touch;
  19 +- (void)handleDoubleTap:(UITouch *)touch;
  20 +- (void)handleTripleTap:(UITouch *)touch;
  21 +@end
  22 +
  23 +@protocol IDMTapDetectingImageViewDelegate <NSObject>
  24 +@optional
  25 +- (void)imageView:(UIImageView *)imageView singleTapDetected:(UITouch *)touch;
  26 +- (void)imageView:(UIImageView *)imageView doubleTapDetected:(UITouch *)touch;
  27 +- (void)imageView:(UIImageView *)imageView tripleTapDetected:(UITouch *)touch;
  28 +@end
  1 +//
  2 +// IDMTapDetectingView.h
  3 +// IDMPhotoBrowser
  4 +//
  5 +// Created by Michael Waterfall on 04/11/2009.
  6 +// Copyright 2009 d3i. All rights reserved.
  7 +//
  8 +
  9 +#import <UIKit/UIKit.h>
  10 +#import <Foundation/Foundation.h>
  11 +
  12 +@protocol IDMTapDetectingViewDelegate;
  13 +
  14 +@interface IDMTapDetectingView : UIView {
  15 + id <IDMTapDetectingViewDelegate> __weak tapDelegate;
  16 +}
  17 +@property (nonatomic, weak) id <IDMTapDetectingViewDelegate> tapDelegate;
  18 +- (void)handleSingleTap:(UITouch *)touch;
  19 +- (void)handleDoubleTap:(UITouch *)touch;
  20 +- (void)handleTripleTap:(UITouch *)touch;
  21 +@end
  22 +
  23 +@protocol IDMTapDetectingViewDelegate <NSObject>
  24 +@optional
  25 +- (void)view:(UIView *)view singleTapDetected:(UITouch *)touch;
  26 +- (void)view:(UIView *)view doubleTapDetected:(UITouch *)touch;
  27 +- (void)view:(UIView *)view tripleTapDetected:(UITouch *)touch;
  28 +@end
  1 +//
  2 +// IDMZoomingScrollView.h
  3 +// IDMPhotoBrowser
  4 +//
  5 +// Created by Michael Waterfall on 14/10/2010.
  6 +// Copyright 2010 d3i. All rights reserved.
  7 +//
  8 +
  9 +#import <Foundation/Foundation.h>
  10 +#import "IDMPhotoProtocol.h"
  11 +#import "IDMTapDetectingImageView.h"
  12 +#import "IDMTapDetectingView.h"
  13 +
  14 +#import "DACircularProgressView.h"
  15 +
  16 +@class IDMPhotoBrowser, IDMPhoto, IDMCaptionView;
  17 +
  18 +@interface IDMZoomingScrollView : UIScrollView <UIScrollViewDelegate, IDMTapDetectingImageViewDelegate, IDMTapDetectingViewDelegate> {
  19 +
  20 + IDMPhotoBrowser *__weak _photoBrowser;
  21 + id<IDMPhoto> _photo;
  22 +
  23 + // This view references the related caption view for simplified handling in photo browser
  24 + IDMCaptionView *_captionView;
  25 +
  26 + IDMTapDetectingView *_tapView; // for background taps
  27 +
  28 + DACircularProgressView *_progressView;
  29 +}
  30 +
  31 +@property (nonatomic, strong) IDMTapDetectingImageView *photoImageView;
  32 +@property (nonatomic, strong) IDMCaptionView *captionView;
  33 +@property (nonatomic, strong) id<IDMPhoto> photo;
  34 +@property (nonatomic) CGFloat maximumDoubleTapZoomScale;
  35 +
  36 +- (id)initWithPhotoBrowser:(IDMPhotoBrowser *)browser;
  37 +- (void)displayImage;
  38 +- (void)displayImageFailure;
  39 +- (void)setProgress:(CGFloat)progress forPhoto:(IDMPhoto*)photo;
  40 +- (void)setMaxMinZoomScalesForCurrentBounds;
  41 +- (void)prepareForReuse;
  42 +
  43 +@end
@@ -14,4 +14,10 @@ @@ -14,4 +14,10 @@
14 width:(NSUInteger)width 14 width:(NSUInteger)width
15 height:(NSUInteger)height; 15 height:(NSUInteger)height;
16 16
  17 +- (void)clearData;
  18 +
  19 +- (void)addBlack:(CGRect)rect;
  20 +
  21 +- (void)clearBack;
  22 +
17 @end 23 @end
  1 +/* No comment provided by engineer. */
  2 +"Cancel" = "Abbrechen";
  3 +
  4 +/* Informing the user an item has finished copying */
  5 +"Copied" = "Kopiert";
  6 +
  7 +/* No comment provided by engineer. */
  8 +"Copy" = "Kopieren";
  9 +
  10 +/* Displayed with ellipsis as 'Copying...' when an item is in the process of being copied */
  11 +"Copying" = "Kopiere";
  12 +
  13 +/* No comment provided by engineer. */
  14 +"Dismiss" = "Schließen";
  15 +
  16 +/* No comment provided by engineer. */
  17 +"Done" = "Fertig";
  18 +
  19 +/* No comment provided by engineer. */
  20 +"Email" = "Email";
  21 +
  22 +/* No comment provided by engineer. */
  23 +"Email failed to send. Please try again." = "Senden fehlgeschlagen. Bitte erneut versuchen.";
  24 +
  25 +/* Informing the user a process has failed */
  26 +"Failed" = "Fehlgeschlagen";
  27 +
  28 +/* Used in the context: 'Showing 1 of 3 items' */
  29 +"of" = "von";
  30 +
  31 +/* No comment provided by engineer. */
  32 +"Photo" = "Foto";
  33 +
  34 +/* Displayed with ellipsis as 'Preparing...' when an item is in the process of being prepared */
  35 +"Preparing" = "Vorbereiten";
  36 +
  37 +/* No comment provided by engineer. */
  38 +"Save" = "Sichern";
  39 +
  40 +/* Informing the user an item has been saved */
  41 +"Saved" = "Gesichert";
  42 +
  43 +/* Displayed with ellipsis as 'Saving...' when an item is in the process of being saved */
  44 +"Saving" = "Sichere";
  45 +
1 B/* No comment provided by engineer. */ 1 B/* No comment provided by engineer. */
1 B/* No comment provided by engineer. */ 1 B/* No comment provided by engineer. */
1 B/* No comment provided by engineer. */ 1 B/* No comment provided by engineer. */
  1 +/* No comment provided by engineer. */
  2 +"Cancel" = "キャンセル";
  3 +
  4 +/* Informing the user an item has finished copying */
  5 +"Copied" = "コピーされました";
  6 +
  7 +/* No comment provided by engineer. */
  8 +"Copy" = "コピー";
  9 +
  10 +/* Displayed with ellipsis as 'Copying...' when an item is in the process of being copied */
  11 +"Copying" = "コピー中";
  12 +
  13 +/* No comment provided by engineer. */
  14 +"Dismiss" = "閉じる";
  15 +
  16 +/* No comment provided by engineer. */
  17 +"Done" = "完了";
  18 +
  19 +/* No comment provided by engineer. */
  20 +"Email" = "メール";
  21 +
  22 +/* No comment provided by engineer. */
  23 +"Email failed to send. Please try again." = "メールの送信に失敗しました。もう一度送信してください。";
  24 +
  25 +/* Informing the user a process has failed */
  26 +"Failed" = "失敗しました";
  27 +
  28 +/* Used in the context: 'Showing 1 of 3 items' */
  29 +"of" = "/";
  30 +
  31 +/* No comment provided by engineer. */
  32 +"Photo" = "写真";
  33 +
  34 +/* Displayed with ellipsis as 'Preparing...' when an item is in the process of being prepared */
  35 +"Preparing" = "読み込み中";
  36 +
  37 +/* No comment provided by engineer. */
  38 +"Save" = "保存";
  39 +
  40 +/* Informing the user an item has been saved */
  41 +"Saved" = "保存されました";
  42 +
  43 +/* Displayed with ellipsis as 'Saving...' when an item is in the process of being saved */
  44 +"Saving" = "保存中";
  45 +
  1 +/* No comment provided by engineer. */
  2 +"Cancel" = "Annuleer";
  3 +
  4 +/* Informing the user an item has finished copying */
  5 +"Copied" = "Gekopieerd";
  6 +
  7 +/* No comment provided by engineer. */
  8 +"Copy" = "Kopieer";
  9 +
  10 +/* Displayed with ellipsis as 'Copying...' when an item is in the process of being copied */
  11 +"Copying" = "Kopieer";
  12 +
  13 +/* No comment provided by engineer. */
  14 +"Dismiss" = "Annuleer";
  15 +
  16 +/* No comment provided by engineer. */
  17 +"Done" = "Klaar";
  18 +
  19 +/* No comment provided by engineer. */
  20 +"Email" = "E-mail";
  21 +
  22 +/* No comment provided by engineer. */
  23 +"Email failed to send. Please try again." = "Het versturen van de e-mail is mislukt. Probeer opnieuw.";
  24 +
  25 +/* Informing the user a process has failed */
  26 +"Failed" = "Mislukt";
  27 +
  28 +/* Used in the context: 'Showing 1 of 3 items' */
  29 +"of" = "of";
  30 +
  31 +/* No comment provided by engineer. */
  32 +"Photo" = "Foto";
  33 +
  34 +/* Displayed with ellipsis as 'Preparing...' when an item is in the process of being prepared */
  35 +"Preparing" = "Voorbereiden";
  36 +
  37 +/* No comment provided by engineer. */
  38 +"Save" = "Opslaan";
  39 +
  40 +/* Informing the user an item has been saved */
  41 +"Saved" = "Opgeslagen";
  42 +
  43 +/* Displayed with ellipsis as 'Saving...' when an item is in the process of being saved */
  44 +"Saving" = "Opslaan";
  1 +/* No comment provided by engineer. */
  2 +"Cancel" = "Cancelar";
  3 +
  4 +/* Informing the user an item has finished copying */
  5 +"Copied" = "Copiado";
  6 +
  7 +/* No comment provided by engineer. */
  8 +"Copy" = "Copiar";
  9 +
  10 +/* Displayed with ellipsis as 'Copying...' when an item is in the process of being copied */
  11 +"Copying" = "Copiando";
  12 +
  13 +/* No comment provided by engineer. */
  14 +"Dismiss" = "Fechar";
  15 +
  16 +/* No comment provided by engineer. */
  17 +"Done" = "Fechar";
  18 +
  19 +/* No comment provided by engineer. */
  20 +"Email" = "Email";
  21 +
  22 +/* No comment provided by engineer. */
  23 +"Email failed to send. Please try again." = "Email falhou ao enviar. Por favor, tente novamente.";
  24 +
  25 +/* Informing the user a process has failed */
  26 +"Failed" = "Falhou";
  27 +
  28 +/* Used in the context: 'Showing 1 of 3 items' */
  29 +"of" = "de";
  30 +
  31 +/* No comment provided by engineer. */
  32 +"Photo" = "Foto";
  33 +
  34 +/* Displayed with ellipsis as 'Preparing...' when an item is in the process of being prepared */
  35 +"Preparing" = "Preparando";
  36 +
  37 +/* No comment provided by engineer. */
  38 +"Save" = "Salvar";
  39 +
  40 +/* Informing the user an item has been saved */
  41 +"Saved" = "Salvada";
  42 +
  43 +/* Displayed with ellipsis as 'Saving...' when an item is in the process of being saved */
  44 +"Saving" = "Salvando";
  45 +
1 B/* No comment provided by engineer. */ 1 B/* No comment provided by engineer. */
1 B/* No comment provided by engineer. */ 1 B/* No comment provided by engineer. */
@@ -3,5 +3,5 @@ git commit -m "sdk init" @@ -3,5 +3,5 @@ git commit -m "sdk init"
3 git pull 3 git pull
4 git push 4 git push
5 5
6 -git tag -m "tag" 1.1.2 6 +git tag -m "tag" 1.1.3
7 git push --tag 7 git push --tag