CELL_PHOTO_IDENTIFIER
# define CELL_PHOTO_IDENTIFIER @"photoLibraryCell"
# define CLOSE_PHOTO_IMAGE @"close"
# define ADD_PHONE_IMAGE @"photo"
- (ALAssetsLibrary *) defaultAssetLibrairy {
static ALAssetsLibrary *assetLibrairy;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
assetLibriry =[[ALAssetsLibrary alloc]init];
});
return (assetLibrary);
}
- (BOOL) shouldAutorotate {
return (false);
}
- (void) postMessage {
RRMessageModel *modelMessage = [[RRMessageModel alloc]init];
modelMessage.text = self.textView.text;
modelMessage.photos = self.selectedPhotos;
if(self.completion != nil) {
self.completion(modelMessage, false);
}
if([self.delegate respondsToSelector:@selector(getMessage:)])
{
[self.delegate getMessage:modelMessage];
}}
- (void) cancelMessage {
if([self.delegate respondsToSelector:@selector(messageCancel)]) {
[self.delegate messageCancel];
}
if(self.completion != nil) {
self.completion(nil, true);
}
}
- (void) textViewDidChange :(UITextView *)textView {
self.numberLine.text = [NSString stringWithFormat:@"%lu", (unsigned long)self.textView.text.length];
}
- (NSInteger) collectionView:(UICollectionView *) {
return (self.photosThumnailLIbray.count);
}
- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView
cellForItemAtIndexPath:(NSIndexPath *)indexPath {
UICollectionViewCellPhoto *cell = [collectionView dequeueReusableCellWithReuseIdentifier:CELL_PHOTO_IDENTIFIER forIndexPath:indexPath];
cell.photo.image = [self.photosThumbnailLibrary objectAtIndex:indexPath.row];
return (cell);
}
- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath {
if(self.numberPhoto != -1 && self.selectedPhotos.count >= self.numberPhoto) {
return;
}
if(self.selectedPhotos.count == 0) {
CGFloat positionY = self.textView.frame.origin.y + self.textView./frame.size.height/2;
CGFloat sizeHeight = self.textView.frame.size.height /2;
[UIView animateWIthDuration:0.5 animations:^{
self.textView.frame = CGRectMake(self.textView.frame.origin.x, self.textView.frame.orin.y, self.textView.frame.size.width,self.textView.frame.size.height/2);
} completion:^(BOOL finished) {
NSRange bottom = NSMakeRange(self.textView.text.length -1 , 1);
[self.textView scrollRangeToVisible:bottom];
}] ;
}
}
CELL_PHOTO_IDENTIFIER的更多相关文章
随机推荐
- 【课程分享】Oracle数据库系统project师
对这个课程有兴趣的朋友能够加我的QQ2059055336和我联系 一.本课程是怎么样的一门课程 1.1.课程的背景 该课程是Oracle数据库系统project师培训课程 Oracle Databas ...
- 提取DLL类库代码
@SET destFolder=.\bin@XCOPY /I /Y %SYSTEMDRIVE%\WINDOWS\assembly\GAC_MSIL\Microsoft.ReportViewer.Pro ...
- linux中echo的用法 分类: 学习笔记 linux ubuntu 2015-07-14 14:27 21人阅读 评论(0) 收藏
1.echo命令我们常用的选项有两个,一个是-n,表示输出之后不换行,另外一个是-e,表示对于转义字符按相应的方式处理,如果不加-e那么对于转义字符会按普通字符处理. 2.echo输出时的转义字符 \ ...
- +load,+initialize原理
+load,+initialize原理 1.load 父类的load方法在子类load方法之前调用,分类的load方法在原来类load方法之后调用,依赖类的load方法会在自己之前调用,总之所有的类的 ...
- openmpi+NFS+NIS搭建分布式计算集群
1. 配置防火墙 正确配置防火墙的过滤规则,否则会造成NFS文件系统的挂载失败,NIS账户认证的失败,mpirun远程任务实例投放的失败.一般情况下,计算集群是在内部局域网中使用,所以可 ...
- php 两个数组是否相同,并且输出全面的数据,相同的加一个字段标示
方法一: $date是数组,数组中有字段id,name; $data1是数组,数组中有字段sort_id,name; 所以要通过$date[$i]['id']==$data1[$j]['sort_id ...
- 实现一个线程安全的Queue队列
使用装饰者模式实现一个线程安全的Queue队列. public class SynchronizedQueue<E> implements Queue<E>, Serializ ...
- 转载:修改xshell中文乱码的问题(管用)
执行echo $LANG命令输出的是当前的编码方式,执行locale命令得到系统中所有可用的编码方式.要让Xshell不显示乱码,则要将编码方式改为UTF-8. 在Xshell中[file]-> ...
- VS2015 Cordova Ionic移动开发(二)
一.创建空白Cordova应用 打开VS,选择[新建项目],选择其它语言JavaScript或者TypeScript,语言的话就按个人喜好,喜欢JS就用JS,喜欢TS就用TS,推荐使用TS书写,代码结 ...
- Oracle 左连接、右连接、全外连接、(+)号作用、inner join(等值连接) (转载)
Oracle 外连接 (1)左外连接 (左边的表不加限制) (2)右外连接(右边的表不加限制) (3)全外连接(左右两表都不加限制) 外连接(Outer Join) oute ...