Squeek School #3
Upcoming SlideShare
Loading in...5
×
 

Squeek School #3

on

  • 2,828 views

 

Statistics

Views

Total Views
2,828
Views on SlideShare
1,456
Embed Views
1,372

Actions

Likes
1
Downloads
23
Comments
0

2 Embeds 1,372

http://school.squeek.ru 1357
http://iamdev.mobi 15

Accessibility

Categories

Upload Details

Uploaded via as Apple Keynote

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n

Squeek School #3 Squeek School #3 Presentation Transcript

  • squeek schoolРазработка приложений для iOS
  • team@squeek.ru
  • MVC?
  • MVC Parts of a Screenful Model View ControllerFriday, January 22, 2010 12
  • MVCParts adress book в of a Screenful Model View ControllerFriday, January 22, 2010 11
  • view• прямоугольная часть экрана• показывает и принимает события• view существуют в иерархии: один superview, много subview• все view показаны в window• UIWindow - одно на всё приложение
  • иерархия viewЛибо в IB, либо программно: • [superView addSubview:view]; • [subView removeFromSuperview];Управление иерархией:- (void)insertSubview:(UIView *)view atIndex:(int)index;- (void)insertSubview:(UIView *)view belowSubview:(UIView *)view;- (void)insertSubview:(UIView *)view aboveSubview:(UIView *)view;- (void)exchangeSubviewAtIndex:(int)index withSubviewAtIndex:(int)otherIndex;
  • viewSuperView производит retainКонтроль показа view theView.hidden = YES;
  • структуры для view• CGPoint точка в пространстве { x , y }• CGSize размеры { width , height }• CGRect точка и размеры { origin , size }
  • Rects, Points and Sizes CGRect (0, 0) x 54 origin CGPoint x 80 80 size y 54 y 144 CGSize width 144 72 height 72Tuesday, January 19, 2010 11
  • View-related Structureработа со структурами Creation Function Example CGPoint point = CGPointMake (100.0, 200.0); CGPointMake (x, y) point.x = 300.0; point.y = 30.0; CGSize size = CGSizeMake (42.0, 11.0); CGSizeMake (width, height) size.width = 100.0; size.height = 72.0; CGRect rect = CGRectMake (100.0, 200.0, CGRectMake (x, y, 42.0, 11.0); width, height) rect.origin.x = 0.0; rect.size.width = 50.0; синтаксис!Tuesday, January 19, 2010 (), нет * 12 наследство от С
  • ordinate Systemleft cornerwnwards система координат 0,!0 +x +y
  • view frame boundsкоординатная система локальная superview координатная система используется при используется при использовании view реализации view
  • создаём viewCGRect frame = CGRectMake(20, 45, 140, 21);UILabel *label = [[UILabel alloc] initWithFrame:frame];[window addSubview:label];[label setText:@”Привет всем!”];[label release];
  • дополнительные бонусыUIColorUIColor *redColor = [UIColor redColor];[myLabel setTextColor:redColor];UIFontUIFont *font = [UIFont systemFontOfSize:14.0];[myLabel setFont:font];
  • UIImage и UIImageView Создание UIImage: из ресурсов: +[UIImage imageNamed:(NSString *)name] с диска -[UIImage initWithContentsOfFile:(NSString *)path] из памяти в виде данных -[UIImage initWithData:(NSData *)data]UIImage *myImage = [UIImage imageNamed:@’‘oleg.jpg’’];CGRect frame = CGRectMake(20, 45, 140, 21);UIImageView *myImageView = [[UIImageView alloc] initWithFrame:frame];myImageView.image = myImage;[self.view addSubview:myImageView];[myImageView release];
  • пример UIImage
  • простая анимация-(IBAction)changeValue { [UIView beginAnimations:@"advancedAnimations" context:nil]; [UIView setAnimationDuration:0.5]; int value = slider.value; [label setText:[NSString stringWithFormat:@"%d",value]]; CGRect fr = label.frame; fr.origin.y += 40; label.frame = fr; [UIView commitAnimations];}
  • пример анимации
  • дизайн приложений в Two Flavors of Mail iPhone
  • сравни Organizing Content Organizing ContentFriday, January 22, 2010 Friday, January 22, 2010 6
  • дизайн Organizing Content• фокус на • Focus on yo информацию • One thing a • Screenfuls o пользователя• один функционал единовременно• правило большого пальца Friday, January 22, 2010