SUCCEED

   

iphone 2015
Shodor > SUCCEED > Workshops > Archive > iphone 2015

The students began the workshop by opening up their calculator application from yesterday. They added more buttons to their calculator, such as more operations and digits, to create additional functionality. Building off of a student’s question, Phil discussed the different types of displays, from 3.5 inch iPhone displays to 4 inch iPhone displays, and their effects on the design of the app. When making an app for a different sized iPhone or iPad, app developers must change their designs to adapt to the change in screen size. Phil also reviewed how to link the buttons on the calculator to the functions in the code, by using IBAction and using the display function in the viewController section of the code. Then, Phil went on to explain the different events on iPhone buttons, such as Touch Up Inside, which will call a function when the button is released. After adding the rest of the digits to their calculator, Amalan took over, and proceeded to teach the class about operators. First Amalan reviewed how to declare numerical variables, using the int keyword. The class began to edit a slider application, which will grab two values from sliders and store them as variables, and then add them together and output a sum to the application. The students were then given time to explore their new application, experimenting with different operators, such as addition, subtraction, multiplication, and division. The next topic of instruction were the different data types in Objective C. In their calculator and slider applications, the students only had used the integer data type in their programs. Amalan then taught them about booleans (true and false) and the ==/!= operators to check equality/inequality in Objective C. Amalan proceeded to teach the workshops about comparison operators, such as >, <, >=, and <=. The modulus operator was also taught, as it will be used in the next program they students will construct. The last few operators that were discussed were the boolean operators of and (&&), not (!), and or (||). Phil proceeded to teach if/else statements to the class in order to build their next program. The next program will return the correct ordinal number (33rd) for an input cardinal number (33). This program utilizes conditional statements and the modulus operator. Phil concluded the day be letting the students try and figure out the code for this program.