UIView manipulation         and  layout debugging
Guillaume CerquantDéveloppeur indépendant
[…       locationManager:locationManager     didUpdateToLocation:@”Toulouse”            fromLocation:@”Paris”];
[…     stringByReplacingOccurrencesOfString:          @"            "     withString:          @"            "];
Hey, UIView, t’es comment ?  Hey, subview de UIView, t’es comment ?    Hey, subview de subview de UIView, t’es comment ?  ...
CG   RectNS
Frame   Bounds
{ 0; 1; -1; n }
CGRectMake(blah, blah,           blah, blah);
CGGeometry.h/* Points. */struct CGPoint {   CGFloat x;   CGFloat y;};typedef struct CGPoint CGPoint;/* Sizes. */struct CGS...
(CGRect){x, y,         width, height}
(CGRect){0.0f, 0.0f,         navigationBarFrame.size}
#defineCGRectMakeAtOriginZero(rect, ...)  ((CGRect) {0.0f, 0.0f, (rect).size})
CGRect CGRectInset (   CGRect rect,   CGFloat dx,   CGFloat dy);
NSStringFromCGRect(CGRect)
[self.view addSubview:   aViewController.view];[self addChildViewController:      aViewController];
- (CGRect)convertRect:(CGRect)rect             fromView:(UIView *)view- (CGRect)convertRect:(CGRect)rect               toV...
self.view.transform =CGAffineTransformMakeScaleProportional(                   self.view.frame,                   2.0f);  ...
[[UIApplication sharedApplication]                 beginIgnoringInteractionEvents];    [UIView animateWithDuration:0.4    ...
center
setWantsLayer:YES
alpha = 0.0f     vshidden = YES
https://github.com/domesticcatsoftware/DCIntrospect
NSLogger• fpillet/NSLogger · GitHub
UIView+Alignmenthttps://github.com/dingbat/uiview-alignmentFrame Helperhttps://github.com/cameronboehmer/uiview-frame-help...
https://github.com/glock45/iOS-Hierarchy-Viewer
Wanted: Designer Web Dev Marketing Rockstar
guillaume@macmation.com     @gcerquant
CocoaHeads Toulouse - Guillaume Cerquant - UIView
CocoaHeads Toulouse - Guillaume Cerquant - UIView
CocoaHeads Toulouse - Guillaume Cerquant - UIView
CocoaHeads Toulouse - Guillaume Cerquant - UIView
CocoaHeads Toulouse - Guillaume Cerquant - UIView
CocoaHeads Toulouse - Guillaume Cerquant - UIView
CocoaHeads Toulouse - Guillaume Cerquant - UIView
CocoaHeads Toulouse - Guillaume Cerquant - UIView
CocoaHeads Toulouse - Guillaume Cerquant - UIView
Upcoming SlideShare
Loading in...5
×

CocoaHeads Toulouse - Guillaume Cerquant - UIView

1,221

Published on

Présentation de Guillaume Cerquant (MacMation) lors de la session du 13 septembre 2012 de CocoaHeads Toulouse

Published in: Technology, Travel
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
1,221
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
0
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • Plan\nDebug d’une hierarchie de view\nManipulation de CGRect\nWarning\nOutils\n
  • TemplatesCollectionViewController.m\n
  • \n
  • \n
  • Activate breakpoint\n po [self.view recursiveDescription]\n\npo [[UIWindow keyWindow] recursiveDescription]\n
  • SHOW LAYOUT\nThen, la même at Runtime, avec border (in DocumentTemplateCollectionViewCell.m)\nthen SupportViewController.m\n
  • SLOW ANIMATION\n\nOn device (discard animation)\nApple apps\n
  • \n
  • \n
  • \n
  • \n
  • In 64-bit, or when you compile with NS_BUILD_32_LIKE_64, NSRect is defined as CGRect, so you don't even need to jump through the pointer hoop\n
  • \n
  • \n
  • \n
  • \n
  • \n
  • Mise en garde hiérarchie de view\n
  • Bon en math (TI-89)\nExample d’usage UIWindow\n
  • \n
  • \n
  • Animation (no frame resizing)\nKVO\n
  • NSView only\nUIView all layer backed\n
  • \n
  • \n
  • \n
  • coordinates : c\ntoggle view outlines : o\nopaque view : O\np rint\na ccesibilty\nv recursive\nmove left / right\nresize\n- + pour alpha\nd isplay\nl ayout\nr eload data\n\nflash on draw rect\n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • Transcript of "CocoaHeads Toulouse - Guillaume Cerquant - UIView"

    1. 1. UIView manipulation and layout debugging
    2. 2. Guillaume CerquantDéveloppeur indépendant
    3. 3. [… locationManager:locationManager didUpdateToLocation:@”Toulouse” fromLocation:@”Paris”];
    4. 4. [… stringByReplacingOccurrencesOfString: @" " withString: @" "];
    5. 5. Hey, UIView, t’es comment ? Hey, subview de UIView, t’es comment ? Hey, subview de subview de UIView, t’es comment ? Hey, subview de subview de subview de UIView, t’escomment ? Hey, subview de subview de subview de subview deUIView, t’es comment ? Hey, subview de subview de subview de subviewde subview de UIView, t’es comment ? Hey, subview de subview de subview de subviewde subview de subview de UIView, t’es comment ?Technical Note TN2239http://developer.apple.com/library/ios/#technotes/tn2239/_index.html
    6. 6. CG RectNS
    7. 7. Frame Bounds
    8. 8. { 0; 1; -1; n }
    9. 9. CGRectMake(blah, blah, blah, blah);
    10. 10. CGGeometry.h/* Points. */struct CGPoint { CGFloat x; CGFloat y;};typedef struct CGPoint CGPoint;/* Sizes. */struct CGSize { CGFloat width; CGFloat height;};typedef struct CGSize CGSize;/* Rectangles. */struct CGRect { CGPoint origin; CGSize size;};typedef struct CGRect CGRect;
    11. 11. (CGRect){x, y, width, height}
    12. 12. (CGRect){0.0f, 0.0f, navigationBarFrame.size}
    13. 13. #defineCGRectMakeAtOriginZero(rect, ...) ((CGRect) {0.0f, 0.0f, (rect).size})
    14. 14. CGRect CGRectInset ( CGRect rect, CGFloat dx, CGFloat dy);
    15. 15. NSStringFromCGRect(CGRect)
    16. 16. [self.view addSubview: aViewController.view];[self addChildViewController: aViewController];
    17. 17. - (CGRect)convertRect:(CGRect)rect fromView:(UIView *)view- (CGRect)convertRect:(CGRect)rect toView:(UIView *)view- (CGPoint)convertPoint:(CGPoint)point fromView:(UIView *)view CGRect rect = [view convertRect:view.bounds toView:self];
    18. 18. self.view.transform =CGAffineTransformMakeScaleProportional( self.view.frame, 2.0f); self.view.transform = CGAffineTransformIdentity;
    19. 19. [[UIApplication sharedApplication] beginIgnoringInteractionEvents]; [UIView animateWithDuration:0.4 animations:^{ webViewScreenshotImageView.transform =CGAffineTransformMakeScale(0.7, 0.7); } completion:^(BOOL finished) { [[UIApplication sharedApplication] endIgnoringInteractionEvents]; [self.navigationController popViewControllerAnimated:YES]; }];
    20. 20. center
    21. 21. setWantsLayer:YES
    22. 22. alpha = 0.0f vshidden = YES
    23. 23. https://github.com/domesticcatsoftware/DCIntrospect
    24. 24. NSLogger• fpillet/NSLogger · GitHub
    25. 25. UIView+Alignmenthttps://github.com/dingbat/uiview-alignmentFrame Helperhttps://github.com/cameronboehmer/uiview-frame-helpersFrame Utilitieshttp://www.codercowboy.com/code-frameutils-objective-c-frame-utilities/
    26. 26. https://github.com/glock45/iOS-Hierarchy-Viewer
    27. 27. Wanted: Designer Web Dev Marketing Rockstar
    28. 28. guillaume@macmation.com @gcerquant

    ×