I. Reasons of writing
Never thought to write something, today I met a matter let me decide to make a record every time. Because I can easily complete the pod spec configuration, but today in doing it still forget to encounter a lot of pits. Pod Spec Configuration The pits encountered are not written here, but will be written a little later, but not too much content. One is to facilitate others, the second is to facilitate themselves.
The first time to post, write the wrong place, please the Great God pointed out. I must make good efforts to revise and learn from everyone, but still do not like a used jet. Just like everyone said the classic ' Close your mouth show me your code ', English is not good if wrong, we forgive.
Because I am the courage to write, is to want to promote, not to listen to everyone blindly spray, but not to tell me how to improve this is to let people crash.
Demo, first on the GitHub address, afraid to the back to forget. If you can please give star me, thank you.
Second, the xljnewfeture realization principle
The function Analysis of the Guide page, the other is a ScrollView plus a Pagecontrol finally add a button, button click event is required to the first page of the app program. There are many ways to do this, and this article simply introduces Collview to implement this function.
I realized the idea is this, the first design is to write a class to inherit from Uicollectionview, and then write a Uicollectionviewcell class to implement the specific layout. But after writing in the Appdelegate set Self.windown.rootViewController when always crash off, later found the reason to forget. please know the friend informed that I am good to update up, grateful. Now using directly inherit from Uiviewcontroller, put a uicollectionview on Uiviewcontroller, and then by Uicollectionviewlayout layout, Then customize a Uicollectionviewcell, and finally the button problem.
Xljnewfeature new Features
★ "IOS App new Features" ★
Support Pod Import
Pod ' xljnewfeature ', ' ~> 1.0.0 '
If you find that the pod search xljnewfeature is not the latest version, you need to perform a CD convert file path command back to desktop in the terminal and then perform the pod Setup command to update the local spec cache (which may take a few minutes) and then search again.
Interface code:
/**
* Initialization
* @param array passed in
* @param the width and height of the buttonsize button
* @param the text displayed by the Buttontitle button
* Picture of @param imageName button
* @param the color of titlecolor button text
* @param the ratio of y of the Startheight button
* @param controller button click on the Jump interface
* @return
*/
-(Instancetype) Initwithnsarray: (Nsmutablearray *) array withbuttonsize: (cgsize) buttonsize Withbuttontitle: ( NSString *) Buttontitle withbuttonimage: (NSString *) imageName Withbuttontitlecolor: (Uicolor *) Titlecolor Withbuttonheight: (cgfloat) startheight Withviewcontroller: (Uiviewcontroller *) controller;
Import "XLJNewFetureController.h" in Appdelegate
-(BOOL) Application: (UIApplication *) application didfinishlaunchingwithoptions: (Nsdictionary *) launchOptions {
Self.window = [[UIWindow alloc] Initwithframe:[uiscreen mainscreen].bounds];
Viewcontroller *HOMEVC = [[Viewcontroller alloc] init];
Xljnewfeturecontroller *NEWVC = [[Xljnewfeturecontroller alloc] InitWithNSArray:self.mArray withbuttonsize: Cgsizemake (withbuttontitle:@) "Open Travel" withbuttonimage:@ "FUNCTIONGUIDEBT1" Withbuttontitlecolor:[uicolor Orangecolor] withbuttonheight:0.87 WITHVIEWCONTROLLER:HOMEVC];
Self.window.rootViewController = NEWVC;
[Self.window makekeyandvisible];
return YES;
}
Which determines whether the current picture is the last page, is judged by Indexpath.row and self.marray.cout-1. Because it is the last page, the button's hidden = NO, otherwise it is yes.
-(void) Setcurrentpageindex: (Nsinteger) currentpage Lastpageindex: (Nsinteger) LastIndex
{
if (currentpage = = LastIndex) {
Self.startButton.hidden = NO;
}else{
Self.contentview AddSubview:self.startButton];
[Self.startButton.hidden = YES;
}
}
Ps:
1. If you have some suggestions can email:[email protected], thank you for your concern, is my greatest power, please star a bit oh.
2. Original works, reproduced please indicate the source.
Guide page
IOS App boot page feature implementation