objective c - what is the meaning of + symbol in iOS file naming? -


this question has answer here:

i have seen examples of ios project, little confused naming rule of file. meaning of + symbol in ios naming rule? in case should use symbol.

enter image description here

and mean put draggle within ().

enter image description here

hopefully can help. thank much.

those categories

see here: https://developer.apple.com/library/ios/documentation/cocoa/conceptual/programmingwithobjectivec/customizingexistingclasses/customizingexistingclasses.html

the "draggable" category of uicollectionview

here's snippent apple:

if need add method existing class, perhaps add functionality make easier in own application, easiest way use category.

the syntax declare category uses @interface keyword, standard objective-c class description, not indicate inheritance subclass. instead, specifies name of category in parentheses, this:

@interface classname (categoryname)    @end 

here's example

#import "uiview+roundify.h"   @implementation uiview (roundify)  -(void)addroundedcorners:(uirectcorner)corners withradii:(cgsize)radii {     calayer *tmasklayer = [self maskforroundedcorners:corners withradii:radii];     [[self layer] setmask:tmasklayer]; }  -(calayer*)maskforroundedcorners:(uirectcorner)corners withradii:(cgsize)radii {     cashapelayer *masklayer = [cashapelayer layer];     masklayer.frame = self.bounds;      uibezierpath *roundedpath = [uibezierpath bezierpathwithroundedrect:                                  masklayer.bounds byroundingcorners:corners cornerradii:radii];     masklayer.fillcolor = [[uicolor whitecolor] cgcolor];     masklayer.backgroundcolor = [[uicolor whitecolor] cgcolor];     masklayer.path = [roundedpath cgpath];      return masklayer; }  @end 

header

@interface uiview (roundify)  -(void)addroundedcorners:(uirectcorner)corners withradii:(cgsize)radii; -(calayer*)maskforroundedcorners:(uirectcorner)corners withradii:(cgsize)radii;  @end 

this means when import file, can call method "addroundcorners" uiview


Comments

Popular posts from this blog

java - UnknownEntityTypeException: Unable to locate persister (Hibernate 5.0) -

python - ValueError: empty vocabulary; perhaps the documents only contain stop words -

ubuntu - collect2: fatal error: ld terminated with signal 9 [Killed] -