IOS development often used in the knowledge points summary

1 cocopods with the introduction of the third party library, #import, when the header file does not indicate the problem?

IOS development often used in the knowledge points summary
step diagram.Png

2 how to set the PCH file path?

IOS development often used in the knowledge points summary
modify PCH file path.Png

3.UIView ALPA, hidden, opaque difference?

  • ALPA, range 0 to 1, indicating that from fully transparent to completely opaque, default is 1. When ALPA is set to 0: 1 from the current UIView response were removed in the chain, and the responder chain in the next 2 will become the first response to the current UIVIew and subView will be hidden, and no matter how the alpha value was subView
  • Hidden, the value of YES or NO, indicating whether to hide, the default value is NO. When set to YES the 1 current UIVIew and subView will be hidden, and no matter how the hidden value was 2 subView, the current UIView will remove from the response in the chain, and the responder chain in the next will be the first responders
  • Opaque, the property for the BOOL value, the default value of UIView is YES, but UIButton subclasses default value is NO. Opaque said that the current UIView is not transparent, this is actually more difficult to understand some, he decided that the GPU is to use the layer color formula to synthesize the true color value.
    if opaque is set to NO, then the Alpha should be less than 1, as shown below
IOS development often used in the knowledge points summary
opaque set to NO.png

The opaque property is equivalent to a performance tuning switch, which, if set to YES, draws the entire view as an opaque, optimized operation and improves performance when rendering the attempt. So in general the opaque property is set to YES.

4 how to convert a string to a timestamp?

#pragma mark - string timestamp - (NSTimeInterval) setDateString: (NSString * dateString) {NSDateFormatter * formatter = [[NSDateFormatter alloc]init]; [formatter setDateFormat:@ "YYYY-MM-dd-HH:mm"]; NSDate * date = [[NSDate = alloc]init]; date [formatter dateFromString:dateString]; NSTimeInterval timeInterval = [date timeIntervalSince1970]; return timeInterval;}

5 how to convert a timestamp to a string?

#pragma mark - timestamp string - (NSString *) setTimeInterval: (NSString * timeInterval) {NSDateFormatter * formatter = [[NSDateFormatter alloc]init]; [formatter setDateFormat:@ "yyyy-MM-dd"]; NSDate * newDate = [NSDate dateWithTimeIntervalSince1970:[timeInterval integerValue]]; NSString * newDateString = [formatter stringFromDate:newDate]; return newDateString;}

6 how to use custom fonts?

Sometimes the system font style cannot meet the requirements, so we have to use custom font styles

  • The TTF format of the custom font file to join the project
IOS development often used in the knowledge points summary
TTF file into the project.Png
  • In the info.plist add: Fonts provided application, fill in the font file name suffix. Figure:
    IOS development often used in the knowledge points summary
    add font file name.Png
  • Print all font styles
IOS development often used in the knowledge points summary
print font style.Png
  • Use the add font styles – (UILabel *) englishLab {if (! _englishLab) {_englishLab alloc]init] = [[UILabel; _englishLab.frame = CGRectMake (20, 290, 300, 20); _englishLab.text = @ “we add custom font styles; _englishLab.textAlignment = NSTextAlignmentCenter; _englishLab.font = [UIFont fontWithName:@ PMingLiU size:23]; _englishLab.textColor = [UIColor redColor] return _englishLab;};} effect diagram as follows:
IOS development often used in the knowledge points summary
renderings.Png

7 problems encountered in recording

IOS development often used in the knowledge points summary
screen snapshot 2017-03-31 am 10.18.13.png

The reason for the emergence of the
problem: because it really tests the recording function on the simulator, it needs to be plugged in to test! There’s no problem with the headset.