-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcellView.rtf
More file actions
42 lines (41 loc) · 1.99 KB
/
cellView.rtf
File metadata and controls
42 lines (41 loc) · 1.99 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
{\rtf1\ansi\ansicpg1252\cocoartf1138\cocoasubrtf510
{\fonttbl\f0\fnil\fcharset0 Menlo-Regular;}
{\colortbl;\red255\green255\blue255;\red170\green13\blue145;\red92\green38\blue153;\red46\green13\blue110;
\red0\green116\blue0;\red196\green26\blue22;\red28\green0\blue207;\red63\green110\blue116;\red100\green56\blue32;
}
\margl1440\margr1440\vieww10800\viewh8400\viewkind0
\deftab560
\pard\tx560\pardeftab560\pardirnatural
\f0\fs22 \cf0 \CocoaLigature0 - (\cf2 id\cf0 )initWithFrame:(\cf3 CGRect\cf0 )frame \{\
\cf2 self\cf0 = [\cf2 super\cf0 \cf4 initWithFrame\cf0 :frame];\
\cf2 if\cf0 (\cf2 self\cf0 ) \{\
\cf5 // Initialization code\cf0 \
\cf3 NSArray\cf0 *arrayOfViews = [[\cf3 NSBundle\cf0 \cf4 mainBundle\cf0 ] \cf4 loadNibNamed\cf0 :\cf6 @"PhotoCell"\cf0 \cf4 owner\cf0 :\cf2 self\cf0 \cf4 options\cf0 :\cf2 nil\cf0 ];\
\
\cf2 if\cf0 ([arrayOfViews \cf4 count\cf0 ] < \cf7 1\cf0 ) \{\
\cf2 return\cf0 \cf2 nil\cf0 ;\
\}\
\
\cf2 if\cf0 (![[arrayOfViews \cf4 objectAtIndex\cf0 :\cf7 0\cf0 ] \cf4 isKindOfClass\cf0 :[\cf3 UICollectionViewCell\cf0 \cf4 class\cf0 ]]) \{\
\cf2 return\cf0 \cf2 nil\cf0 ;\
\}\
\
\cf2 self\cf0 = [arrayOfViews \cf4 objectAtIndex\cf0 :\cf7 0\cf0 ];\
\}\
\
\cf2 return\cf0 \cf2 self\cf0 ;\
\}\
\
\
\
-(\cf2 void\cf0 )setImageUrl:(\cf3 NSString\cf0 *)imageUrl\{\
\cf2 if\cf0 (\cf8 _imageUrl\cf0 != imageUrl)\{\
\cf8 _imageUrl\cf0 = imageUrl;\
\}\
\
\cf4 dispatch_async\cf0 (\cf9 dispatch_get_main_queue\cf0 (), ^\{\
[\cf8 _imageView\cf0 \cf4 setImage\cf0 :[\cf3 UIImage\cf0 \cf4 imageWithData\cf0 :[\cf3 NSData\cf0 \cf4 dataWithContentsOfURL\cf0 :[\cf3 NSURL\cf0 \cf4 URLWithString\cf0 :imageUrl]]]];\
\});\
\
\cf4 NSLog\cf0 (\cf6 @"THE HEIGHT IS %f and the WIDTH IS %f"\cf0 , \cf8 _imageView\cf0 .\cf3 image\cf0 .\cf3 size\cf0 .\cf3 height\cf0 , \cf8 _imageView\cf0 .\cf3 image\cf0 .\cf3 size\cf0 .\cf3 width\cf0 );\
\}}