Basic knowledge of IOS development-fragment 29 and basic knowledge of ios-29
1: Heartbeat effect, and can remove heartbeat
-(Void) initScaleLayer {self. view. backgroundColor = [UIColor blueColor]; UIButton * myTelButtom = [[UIButton alloc] initWithFrame: CGRectMake (60,240, 50, 50)]; UIImage * btnTelImage = [UIImage imageNamed: @ "success"]; [myTelButtom success: btnTelImage forState: UIControlStateNormal]; [myTelButtom success: [UIImage imageNamed: @ "customer_tel_icon"] forState: Success]; [myTelButtom addTarget: self action: @ selector (btnSave :) forControlEvents: UIControlEventTouchUpInside]; [self. view addSubview: myTelButtom]; // set the script CABasicAnimation * scaleAnimation = [CABasicAnimation animationWithKeyPath: @ "transform. scale "]; scaleAnimation. fromValue = [NSNumber numberWithFloat: 1.0]; scaleAnimation. toValue = [NSNumber numberWithFloat: 1.2]; scaleAnimation. autoreverses = YES; scaleAnimation. fillMode = kCAFillModeForwards; scaleAnimation. repeatCount = MAXFLOAT; scaleAnimation. duration = 0.8; // run [myTelButtom. layer addAnimation: scaleAnimation forKey: @ "scaleAnimation"];}-(void) btnSave :( id) sender {UIButton * btn = (UIButton *) sender; [btn. layer removeAnimationForKey: @ "scaleAnimation"];}
2: Enable animation effect implementation
Principle: A static graph is also displayed on the startup page, but an image view is created at startup to animation the image on the startup page as follows:
@ Interface AppDelegate () @ property (strong, nonatomic) UIImageView * niceView; @ end @ implementation AppDelegate @ synthesize niceView;-(BOOL) application :( UIApplication *) application dictionary :( NSDictionary *) launchOptions {self. window. rootViewController = [[ViewController alloc] init]; [self. window makeKeyAndVisible]; // The effect starting from the fade-out of a batch; // you can set an image. niceView = [[UIImageView alloc] initWithFrame: [UIScreen mainScreen]. bounds]; niceView. tag = 11; niceView. image = [UIImage imageNamed: @ "launch4.7.png"]; // Add it to the scenario [self. window addSubview: niceView]; // put it to the top layer; [self. window bringSubviewToFront: niceView]; CABasicAnimation * animation = [CABasicAnimation animationWithKeyPath: @ "transform. scale "]; niceView. layer. anchorPoint = CGPointMake (. 5 ,. 5); animation. fromValue = @ 1.0f; animation. toValue = @ 1.3f; animation. fillMode = kCAFillModeForwards; animation. removedOnCompletion = NO; [animation setAutoreverses: NO]; // animation time animation. duration = 0.9; animation. delegate = self; [niceView. layer addAnimation: animation forKey: @ "scale"]; // end; return YES;}-(void) animationDidStop :( CAAnimation *) anim finished :( BOOL) flag {[niceView removeFromSuperview];}
3: Calculate the label width and determine whether to display the labels with line breaks.
-(Void) creatUI :( NSMutableArray *) tagArr {self. tagArr = [NSMutableArray arrayWithArray: [tagArr mutableCopy]; if (self. is_can_addTag) {// If tags can be added, an additional tag button [self. tagArr addObject: self. addTagStr. length> 0? Self. addTagStr: @ "Add Tag"];} tagView_height = 0; self. backgroundColor = self. tagViewBackgroundColor? Self. tagViewBackgroundColor: [UIColor whiteColor]; previusframe = CGRectZero; [self. tagArr enumerateObjectsUsingBlock: ^ (id value, NSUInteger idx, BOOL * stop) {// Tag title (refer to the dictionary or string) NSMutableString * titleStr = [NSMutableString stringWithString: self. tagStateType = 1? @ "": @ ""]; If ([value isKindOfClass: [NSString class]) {[titleStr appendString: value];} else if ([value isKindOfClass: [NSDictionary class]) {if (! Self. tagArrkey) {// The Value cannot be obtained because the Key NSLog is not passed in (@ "the Value cannot be obtained because the Key is not input"); return;} [titleStr appendString: [value valueForKey: self. tagArrkey];} // create a Label UILabel * tagLabel = [[UILabel alloc] initWithFrame: CGRectZero]; [self creatTagUI: tagLabel]; tagLabel. text = titleStr; tagLabel. tag = KTapLabelTag + idx; // calculate the label size. NSDictionary * attrs =@{ NSFontAttributeName: [UIFont systemFontOfSize: self. tagFont? Self. tagFont: KTagFont]}; CGSize Size_str = [titleStr failed: attrs]; counter + = counter * 2; Size_str.height + = counter * 2; CGRect newRect = CGRectZero; if (previusframe. origin. x + previusframe. size. width + Size_str.width + K_Tag_Right_Margin> JF_Screen_Width) {newRect. origin = CGPointMake (10, previusframe. origin. y + Size_str.height + K_Tag_Bottom_Margin); tagView_height + = Size_str.height + K_Tag_Bottom_Margin;} else {newRect. origin = CGPointMake (previusframe. origin. x + previusframe. size. width + K_Tag_Right_Margin, previusframe. origin. y);} newRect. size = Size_str; [tagLabel setFrame: newRect]; previusframe = tagLabel. frame; // change the widget height if (idx = self. tagArr. count-1) {[self setHight: self andHight: tagView_height + Size_str.height + K_Tag_Bottom_Margin];} [self addSubview: tagLabel]; // added the delete and add functions if (self. is_can_addTag & idx = self. tagArr. count-1) {// Add Status & last --> (you do not need to display the delete image when entering the Add tag page)} else {if (self. tagStateType = 1) {// removed image UIImageView * removeImage = [[UIImageView alloc] initWithFrame: CGRectMake (tagLabel. jf_right-Image_Width * 1.5, tagLabel. jf_top + (tagLabel. jf_height-Image_Height)/2, Image_Width, Image_Height)]; // Delete the image can be replaced with your own image removeImage. image = [UIImage imageNamed: @ "btn_removeTag"]; [self addSubview: removeImage] ;}// click the UIButton * button = [[UIButton alloc] initWithFrame: CGRectMake (tagLabel. frame. origin. x, tagLabel. frame. origin. y, tagLabel. frame. size. width, tagLabel. frame. size. height)]; [button setTag: KButtonTag + idx]; [button addTarget: self action: @ selector (clickTag :) forControlEvents: UIControlEventTouchUpInside]; [self addSubview: button] ;}] ;}
4: added the script KEY operation content for Fabric.
Upload the corresponding DSYM file to the official website;
5: view the detailed address of the dsym error through xcrun atos (Save the current. DSYM file every time you package it, and prepare for later error locating)
Go to the DSYM file,
Use the xcrun atos command
Atos-o YourApp. app. dSYM/Contents/Resources/DWARF/YourApp 0x00062867
Instance:
You can get the error code from umeng or other places, and you can view the error address through the above command;