Finish Git, GitHub, More iPhone Controls




CS175

Chris Pollett

Sep 22, 2014

Outline

Introduction

Making patches

Git Tags

Quiz

Which of the following is true?

  1. To associate a Layout with an Android Activity we might call the method setContentView in our Activity's onCreate method.
  2. The public final class R has to be written by hand by the coder of an Android application.
  3. Git revision numbers start at the number 1 and increment by 1 with each commit.

Issue Tracking

GitHub

Getting started with GitHub

GitHub Work Flows

GitHub Work Details -- Getting a copy

  • In details what happening, is clicking fork gives you a copy in your user account space of that repository. For example, the original repository might have been:
    https://github.com/ORIGINAL_USERNAME/PROJECT.git
    your fork wil be
    https://github.com/YOUR_USERNAME/PROJECT.git
  • To get a copy on your laptop of your fork, you just clone that address:
    git clone https://github.com/YOUR_USERNAME/PROJECT.git
    
  • To make sure you can stay in sync with the original repository we need to add an upstream source for our close:
    git remote add upstream https://github.com/ORIGINAL_USERNAME/PROJECT.git
    
  • GitHub Work Details -- Working locally, Synchronization, Pull Requests

    Back to Phone Programming!

    Active, Static, and Passive Controls

    An Image View and Text Field Example

    What it should look like

    An example of a iPhone UI with an image and two textfields

    This actually looks ugly, because we have our storyboard set up with the width and height both set to Any.

    If we want our storyboard more like a older iPhone we can adjust these kind of values to compact and play with Layout.

    Text Input Traits

    Interface Code for Getting Keyboard To Go Away

    //
    //  ViewController.h
    //  KeyboardTest
    //
    //  Created by Chris Pollett on 9/22/14.
    //  Copyright (c) 2014 Chris Pollett. All rights reserved.
    //
    
    #import <UIKit/UIKit.h>
    
    @interface ViewController : UIViewController
    
    @property (weak, nonatomic) IBOutlet UITextField *nameField;
    @property (weak, nonatomic) IBOutlet UITextField *numberField;
    
    @end
    

    Modified Controller Code for Getting Keyboard To Go Away

    //
    //  ViewController.m
    //  KeyboardTest
    //
    //  Created by Chris Pollett on 9/22/14.
    //  Copyright (c) 2014 Chris Pollett. All rights reserved.
    //
    
    #import "ViewController.h"
    
    @interface ViewController ()
    
    @end
    
    @implementation ViewController
    
    
    -(IBAction)textFieldDoneEditing:(id)sender
    {
        [sender resignFirstResponder];
    }
    
    - (void)viewDidLoad {
        [super viewDidLoad];
        // Do any additional setup after loading the view, typically from a nib.
    }
    
    - (void)didReceiveMemoryWarning {
        [super didReceiveMemoryWarning];
        // Dispose of any resources that can be recreated.
    }
    
    @end
    

    Click Background To Close Keyboard