More
See all Show me
A screencast tutorial to help beginner iPhone programmers get started. This tutorial shows how to draw "Hello World!" text on the screen.

25 Likes

  • Anthony Frizalone 2 years ago
    Here is the source code. Also, don't forget, you can download the video yourself with the link on the bottom right under "Downloads." The video there will be as clear as you need it.

    -----------------------------------------------------

    import "MyView.h"

    #define TEXT_LABEL_FONT_SIZE 30.0
    #define TEXT_FIELD_HEIGHT_MULTIPLIER 2.0

    @implementation MyView

    - (id)initWithFrame:(CGRect)aRect
    {
    [super initWithFrame:aRect];
    self.backgroundColor = [UIColor whiteColor];

    CGRect contentFrame = self.frame;
    CGFloat leftMargin = 90.0;
    CGFloat textFieldWidth = contentFrame.size.width * 0.72;
    CGFloat textFieldOriginX = (contentFrame.size.width - textFieldWidth) / 2.0;

    CGRect labelFrame = CGRectMake(textFieldOriginX, leftMargin, textFieldWidth, TEXT_LABEL_FONT_SIZE * TEXT_FIELD_HEIGHT_MULTIPLIER);
    UILabel *someText = [[UILabel alloc] initWithFrame:labelFrame];
    someText.text = @"Hello World!";
    someText.font = [UIFont systemFontOfSize:TEXT_LABEL_FONT_SIZE];
    someText.textColor = [UIColor redColor];
    someText.textAlignment = UITextAlignmentCenter;

    [self addSubview:someText];
    [someText release];

    return self;
    }
  •  
  • Mark Hernandez 2 years ago
    Good job Anthony! We've featured your videos in the beginners section at iPhoneDevForums.com. I learned a lot! MarkyMark
  •  
  • arthur mcarthy 1 year ago
    Great tutorial Anthony.. i was wondering what version of xcode are you using? when I create a new project it doesn´t create the MyView files and a bunch of code is missing in the other files (Hello_World_TestAppDelegate.h & Hello_World_TestAppDelegate.m) i typed in the code and worked... thanks again. cheers
  •  
  • Beefy Dog 1 year ago
    No intelli-Sense? Ouch!
    It's 100x easier/faster to develop C apps on Microsoft platforms using Visual Studio for sure.
    Don't get me wrong - the video is good, but in Visual Studio a C++ hello world app takes about 1 minute to have up an running. OS-X is nice, but, development seems painfully slow.
  •  
  • Amod Sinha 1 year ago
    Hi Anthony,

    Nice to see your tutorial.
    I was looking for some nice tutorial since long. I am new to this platform. I am on windows. Can you suggest me what all I need to start iPhone programming. I am good in C/C++. Also which MAC system will be good to purchase.

    Even in case I would like to start Web Application for iPhone, is there anything special that we need to do?
  •  
This conversation is missing your voice. Take five seconds to join Vimeo or log in.

Advertisement

2 Related collections

Statistics

  •  
    plays
    likes
    comments
  • Total
    plays 16.1K
    likes 26
    comments 12
  • Nov 12th
    plays 3
    likes 0
    comments 0
  • Nov 11th
    plays 18
    likes 0
    comments 0
  • Nov 10th
    plays 13
    likes 0
    comments 0
  • Nov 9th
    plays 12
    likes 0
    comments 0
  • Nov 8th
    plays 9
    likes 0
    comments 0
  • Nov 7th
    plays 15
    likes 0
    comments 0
  • Nov 6th
    plays 15
    likes 0
    comments 0
  • Nov 5th
    plays 10
    likes 0
    comments 0
Previous Week

Downloads

Please join Vimeo or log in to download the original file. It only takes a few seconds.