Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 8a52e12

Browse files
孟遥遥孟遥遥
孟遥遥
authored and
孟遥遥
committed
添加选择视频,照片入口
1 parent ec4ba3a commit 8a52e12

File tree

5 files changed

+124
-247
lines changed

5 files changed

+124
-247
lines changed

‎CocoaAsyncSocket_TCP.xcodeproj/project.pbxproj

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
B816A1E01ED040A20024859F /* TZProgressView.m in Sources */ = {isa = PBXBuildFile; fileRef = B816A1D01ED040A20024859F /* TZProgressView.m */; };
2222
B816A1E11ED040A20024859F /* TZVideoPlayerController.m in Sources */ = {isa = PBXBuildFile; fileRef = B816A1D21ED040A20024859F /* TZVideoPlayerController.m */; };
2323
B816A1E21ED040A20024859F /* UIView+Layout.m in Sources */ = {isa = PBXBuildFile; fileRef = B816A1D41ED040A20024859F /* UIView+Layout.m */; };
24+
B816A1E81ED056070024859F /* ChatAlbumModel.m in Sources */ = {isa = PBXBuildFile; fileRef = B816A1E71ED056070024859F /* ChatAlbumModel.m */; };
2425
B85F39BF1EC9C95100B2EA9E /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = B85F39BE1EC9C95100B2EA9E /* main.m */; };
2526
B85F39C81EC9C95100B2EA9E /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = B85F39C61EC9C95100B2EA9E /* Main.storyboard */; };
2627
B85F39CA1EC9C95100B2EA9E /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = B85F39C91EC9C95100B2EA9E /* Assets.xcassets */; };
@@ -131,6 +132,8 @@
131132
B816A1D21ED040A20024859F /* TZVideoPlayerController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TZVideoPlayerController.m; sourceTree = "<group>"; };
132133
B816A1D31ED040A20024859F /* UIView+Layout.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIView+Layout.h"; sourceTree = "<group>"; };
133134
B816A1D41ED040A20024859F /* UIView+Layout.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIView+Layout.m"; sourceTree = "<group>"; };
135+
B816A1E61ED056070024859F /* ChatAlbumModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ChatAlbumModel.h; sourceTree = "<group>"; };
136+
B816A1E71ED056070024859F /* ChatAlbumModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ChatAlbumModel.m; sourceTree = "<group>"; };
134137
B85F39BA1EC9C95100B2EA9E /* CocoaAsyncSocket_TCP.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = CocoaAsyncSocket_TCP.app; sourceTree = BUILT_PRODUCTS_DIR; };
135138
B85F39BE1EC9C95100B2EA9E /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
136139
B85F39C71EC9C95100B2EA9E /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
@@ -638,6 +641,8 @@
638641
children = (
639642
B85F3A8A1EC9C9E400B2EA9E /* ChatModel.h */,
640643
B85F3A8B1EC9C9E400B2EA9E /* ChatModel.m */,
644+
B816A1E61ED056070024859F /* ChatAlbumModel.h */,
645+
B816A1E71ED056070024859F /* ChatAlbumModel.m */,
641646
);
642647
path = ChatModel;
643648
sourceTree = "<group>";
@@ -874,6 +879,7 @@
874879
B85F3A631EC9C9C600B2EA9E /* LastViewController.m in Sources */,
875880
B816A1D71ED040A20024859F /* TZAssetModel.m in Sources */,
876881
B85F3A831EC9C9DE00B2EA9E /* ChatKeyboard.m in Sources */,
882+
B816A1E81ED056070024859F /* ChatAlbumModel.m in Sources */,
877883
B816A1E11ED040A20024859F /* TZVideoPlayerController.m in Sources */,
878884
B85F3A651EC9C9C600B2EA9E /* ThirdViewController.m in Sources */,
879885
B85F3A4C1EC9C9C600B2EA9E /* UIImageView+SDWebImage.m in Sources */,
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
//
2+
// ChatAlbumModel.h
3+
// CocoaAsyncSocket_TCP
4+
//
5+
// Created by 孟遥遥 on 2017年5月20日.
6+
// Copyright © 2017年 mengyao. All rights reserved.
7+
//
8+
9+
#import <Foundation/Foundation.h>
10+
11+
@interface ChatAlbumModel : NSObject
12+
13+
//是否为原图
14+
@property (nonatomic, assign) BOOL isOrignal;
15+
//名字
16+
@property (nonatomic, copy) NSString *name;
17+
//大小
18+
@property (nonatomic, copy) NSString *size;
19+
//图片压缩过的data
20+
@property (nonatomic, strong) NSData *normalData;
21+
//图片无压缩data
22+
@property (nonatomic, strong) NSData *orignalData;
23+
//视频缓存地址
24+
@property (nonatomic, copy) NSString *videoCachePath;
25+
//视频缩略图
26+
@property (nonatomic, strong) UIImage *videoCoverImg;
27+
//视频时长
28+
@property (nonatomic, copy) NSString *videoDuration;
29+
@end
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
//
2+
// ChatAlbumModel.m
3+
// CocoaAsyncSocket_TCP
4+
//
5+
// Created by 孟遥遥 on 2017年5月20日.
6+
// Copyright © 2017年 mengyao. All rights reserved.
7+
//
8+
9+
#import "ChatAlbumModel.h"
10+
11+
@implementation ChatAlbumModel
12+
13+
@end
Lines changed: 10 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,75 +1,37 @@
11
//
22
// UIImage+photoPicker.h
33
// JYHomeCloud
4-
//
5-
// Created by 孟遥 on 16/12/19.
6-
// Copyright © 2016年 JYall Network Technology Co.,Ltd. All rights reserved.
4+
// Created by 孟遥 on 2017年4月14日.
5+
// Copyright © 2017年 mengyao. All rights reserved.
76
//
87

98
#import <UIKit/UIKit.h>
109

11-
@class JYPhotoVideoModel;
10+
@class ChatAlbumModel;
1211

1312
//返回选中的所有图片 , 原图或者压缩图
14-
typedef void(^JYPhotoPickerImagesCallback)(NSArray<JYPhotoVideoModel *> *images);
15-
16-
//返回照片原图的data
17-
typedef void(^JYPhotoPickerDataCallback)(NSArray<JYPhotoVideoModel *> *datas);
13+
typedef void(^photoPickerImagesCallback)(NSArray<ChatAlbumModel *> *images);
1814

1915
//返回视频存储的位置
20-
typedef void(^JYVideoPathCallback)(NSString *filePath,NSString *size);
21-
22-
//立刻返回封面图
23-
typedef void(^JYVideoCoverImageBackRightNow)(UIImage *coverImage,NSString *fileName,long long int duration);
16+
typedef void(^videoPathCallback)(ChatAlbumModel *);
2417

2518

2619
@interface UIImage (photoPicker)
2720

28-
29-
30-
31-
/**
32-
获取选中照片数组模型 ,此方法用于打开相册选择照片 , 是否选择原图 由用户自行决定
33-
34-
@param imagesCallback <#imagesCallback description#>
35-
@param target 控制器
36-
@param count 最大选择张数
37-
@param needShowButton 是否需要展示拍照按钮
38-
*/
39-
+ (void)openPhotoPickerGetImages:(JYPhotoPickerImagesCallback)imagesCallback target:(UIViewController *)target maxCount:(NSInteger)count isNeedShowTakePictureButton:(BOOL)needShowButton rect:(CGRect)rect;
40-
41-
42-
43-
44-
/**
45-
获取原图data , 此方法仅限于上传原图使用 , 如不需要原图 , 则使用上述方法 , 避免获取图片过大
46-
47-
@param photosCallback <#photosCallback description#>
48-
@param target 控制器
49-
@param count 最大选择张数
50-
@param needShowButton 是否需要展示拍照按钮
51-
*/
52-
+ (void)openPhotoPickerGetOrignalData:(JYPhotoPickerDataCallback)photosCallback taget:(UIViewController *)target maxCount:(NSInteger)count isNeedShowTakePictureButton:(BOOL)needShowButton;
53-
54-
55-
5621
/**
57-
IM专用
5822
5923
@param imagesCallback <#photosCallback description#>
60-
@param target <#target description#>
61-
@param count <#count description#>
24+
@param target 打开相册所需
25+
@param count 最大可选数量
6226
*/
63-
+ (void)openPhotoPickerGetImages:(JYPhotoPickerImagesCallback)imagesCallback target:(UIViewController *)target maxCount:(NSInteger)count;
27+
+ (void)openPhotoPickerGetImages:(photoPickerImagesCallback)imagesCallback target:(UIViewController *)target maxCount:(NSInteger)count;
6428

6529
/**
66-
获取选中的视频 , 如实现了 JYVideoCoverImageBackRightNow , 则会立马返回一张该视频的缩略图 如不需要,直接传入nil即可
30+
获取选中的视频
6731
6832
@param videoPathCallback <#videoPathFileNameCallback description#>
69-
@param coverBack <#coverBack description#>
7033
@param target <#target description#>
71-
@param basePath <#basePath description#>
7234
*/
73-
+ (void)openPhotoPickerGetVideo:(JYVideoPathCallback)videoPathCallback coverBackRightNow:(JYVideoCoverImageBackRightNow)coverBacktarget:(UIViewController *)target CacheDirectory:(NSString *)basePath;
35+
+ (void)openPhotoPickerGetVideo:(videoPathCallback)videoPathCallback target:(UIViewController *)target cacheDirectory:(NSString *)basePath;
7436

7537
@end

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /