Ios-github Dry Sharing (App Guide page is highly integrated-dhguidepagehud-②)

Source: Internet
Author: User
Tags webp

  From the previous blog "The App Guide page of the highly integrated-Dhguidepagehud-①" released for some time, and later in the SDK to add some new content to go in but never had time to share with you, today to share with you, or a line of code to take care of the app guide page, Nonsense not to say directly into the theme!

  If you have not had time to see a blog, please click here to enter: Ios-github dry sharing (App guide page of the highly integrated-dhguidepagehud-①)????;

  (a) The usual first on GitHub connection, save time for everyone (sharing is a virtue, star is a kind of encouragement; PS: Don't forget to take a second to tap the little star in the upper right corner of GitHub? Star, encourage the people who integrate the SDK?? ):

GitHub Address: Https://github.com/dingding3w/DHGuidePageHUD

  (b) This update shows:

              

  (iii) Description of the SDK update:

Since the update time is a bit long, the update of this SDK is updated directly from V1.0.0 to the V2.0.0 version, and this time as long as the updated content is updated by the V1.0.0 version of "Static app boot page" to the V2.0.0 version of the "Static app boot page and dynamic app boot page" two states ( Keep the original function to add new features), and the use of the SDK is not changed, the SDK will automatically identify the developer's incoming images are static pictures or dynamic pictures, convenient for developers to use, speed up the development efficiency, a line of code to take care of the creation of the App guide page, the parameters can be passed:

/* * *  Dhguidepagehud * *  @param frame      Position Size *  @param imagearray boot page picture Array (nsstring) *  @param ishidden   Start to experience whether the button is hidden (YES: Hide-Boot page to complete the automatic access to the app homepage; No: Do not hide-boot page Complete Click the Start Experience button to go to the  App homepage) **/-(Instancetype) Dh_initwithframe: (cgrect) frame Imagenamearray :(nsarray<nsstring *> *) Imagenamearray Buttonishidden: (BOOL) Ishidden;

  (iv) Content of this SDK update:

    (1) On the basis of the original SDK to add "dhgifimageoperation" GIF animated image processing class (this class can handle the local GIF pictures and network GIF pictures, while adding the image data to determine the format of the image, more rigorous judgment):

DHGifImageOperation.h

 /*  * * Gets the picture extension by the first byte of the image data,  Span style= "color: #008000;" >*/ + (NSString *) Dh_contenttypeforimagedata: (NSData *) data;  /*  * * Custom play GIF picture (path) * @param frame position and size * @param gifimagepath gif picture path * * @re Turn GIF Picture object  */-(id ) initWithFrame: (CGRect) frame Gifimagepath: (nsstring * /*   * * Custom play GIF picture (data) (local + network) * * @param frame position and size * @param gifimagedata gif picture Data * * @return GIF image object  */-(id ) initWithFrame: (CGRect) frame gifimagedata: (NSData *) Gifimagedata; 

    Dhgifimageoperation.m

#pragmaMark-Get Picture extension + (NSString *) Dh_contenttypeforimagedata: (NSData *) via the first byte of the image data) data {uint8_t C; [Data getBytes:&c Length:1]; Switch(c) { Case 0xFF:            return @"JPEG";  Case 0x89:            return @"PNG";  Case 0x47:            return @"gif";  Case 0x49:         Case 0x4d:            return @"TIFF";  Case 0x52:            if([Data length] < A) {                returnNil; } nsstring*teststring = [[NSString alloc] Initwithdata:[data subdatawithrange:nsmakerange (0, A)] [encoding:nsasciistringencoding]; if([TestString Hasprefix:@"RIFF"] && [teststring hassuffix:@"WEBP"]) {                return @"WEBP"; }            returnNil; }    returnNil;}#pragmaMark-Custom Play GIF image (Path)-(ID) initWithFrame: (CGRect) frame Gifimagepath: (NSString *) Gifimagepath { self=[Super Initwithframe:frame]; if(self) {gifproperties= [Nsdictionary dictionarywithobject:[nsdictionary dictionarywithobject:[nsnumber numberWithInt:0] Forkey: (NSString *) Kcgimagepropertygifloopcount] Forkey: (NSString *) kcgimagepropertygifdictionary]; GIF=Cgimagesourcecreatewithurl (cfurlref) [Nsurl Fileurlwithpath:gifimagepath], (cfdictionaryref) gifProperties); Count=cgimagesourcegetcount (GIF); Timer= [Nstimer scheduledtimerwithtimeinterval:0.06Target:self selector: @selector (play) Userinfo:nil Repeats:yes];/**< 0.12->0.06*/[Timer fire]; }    returnSelf ;}#pragmaMark-Custom Play GIF image (Data) (local + network)-(ID) initWithFrame: (CGRect) frame gifimagedata: (NSData *) Gifimagedata { self=[Super Initwithframe:frame]; if(self) {gifproperties= [Nsdictionary dictionarywithobject:[nsdictionary dictionarywithobject:[nsnumber numberWithInt:0] Forkey: (NSString *) Kcgimagepropertygifloopcount] Forkey: (NSString *) kcgimagepropertygifdictionary]; GIF=Cgimagesourcecreatewithdata ((cfdataref) Gifimagedata, (cfdictionaryref) gifproperties); Count=cgimagesourcegetcount (GIF); Timer= [Nstimer scheduledtimerwithtimeinterval:0.06Target:self selector: @selector (play) Userinfo:nil Repeats:yes];/**< 0.12->0.06*/[Timer fire]; }    returnSelf ;}

    (2) At the end of the app guide page to jump to the app homepage Remember to remove the current App guide page, to prevent unnecessary trouble (preferably removed??):

-(void) removefromsuperview {    [timer invalidate];     = Nil;    [Super Removefromsuperview];}

  (v) Outside the work also wrote the other two SDK, too late to write a blog to share with you, the GitHub address to share with everyone, if you feel helpful, please take a second time to click on GitHub in the upper right corner of the little star? Star, Thank you~????;

GitHub Address: Https://github.com/dingding3w/DHAlertViewHUD (fast inherit app tip box);

GitHub Address: Https://github.com/dingding3w/DHLaunchPageHUD (one line of Code Integration app launch page, including ads and no ads two styles);

  (vi) The above is my understanding and explanation of the third-party SDK of the Dhguidepagehud App guide page, all the code has been uploaded to the GitHub link (more star Star)??, hope that we complement each other to learn from each other;

Ios-github dry Sharing (App Guide page is highly integrated-dhguidepagehud-②)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.