Friday, 6 June 2014

Progress Update - Keepal, iOS, Android SDK, MBT, Swift, Photography Masterclass

Progress @ Keepal
  • Reviewed iOS - DONE
  • ObjectAid UML Explorer for Eclipse IDE - Testing
    • Class Diagrams
    • Sequence Diagrams

Progress @ Lynda.com

Android SDK Essential Training (with David Gassner) -DONE
  • Android Market Fragmentation Recent Statistics { OS, Screen Size, Pixel Density, Vendors } and Strategies { DP, Multi-Screen Drawable Resources }
    • 9 Patch Resizer Tool 
      • Converts Multiple Images into Multiple Sizes that Map to the Multiple Drawable Folders in the Resources Directory of Package Explorer to enabling Graphics selected by Application Framework correctly for any Device
    • 9 Patch Drawable Graphics { stretch and adapt automatically to different screen densities and sizes }
    • Simple Nine-Patch Generator (Android Asset Studio) { regardless of screen size and pixel density it always positions graphic with correct aspect ratio on screen by handling both borders and multiple versions of pixel densities }
  • Android Development Toolkit (ADT) Plugin
  • Android Debug Bridge (ADB) Platform Tool
    • Debug Perspective Tools
      • LogCat Tool (Custom Messages, Filtering)
        • Tracing State Changes (Lifecycle Debugging where Events triggered by moving between Activities that are associated with a Method)
      • Toast Messages
      • Breakpoints 
      • Watchlists
    • Refactoring with Extract to Constants (CMD+1) 
    • Dalvik Debug Monitor Service (DDMS) Perspective 
      • Screen Captures
      • Heap Memory Usage of Device at Runtime by causing Garbage Collection (GC)
      • Persistent Data Storage 
      • Emulator Control (SMS, Voice)
  • Eclipse Java IDE
  • Manifest File (Activities, Intent Filter, Themes)
    • Custom Themes (using Android SDK)
  • Multiple Activities and Layouts 
    • Types (Linear, Relative, and Containers)
    • Layout Manipulation (Margins, Padding, Gravity, Nesting)
    • Java Views (Visual Widgets)
    • Content Assistant (CTRL+SPACE)
    • Java Classes, Importing (CMD + Click) or Quick Fix (CMD + 1) and XML elements mapping
    • Java Code to display Visual Objects, resize, or reposition in View Layouts at Runtime
    • Creating Binding Multiple Layouts (XML) and Activities (Java Classes)
    • Overriding existing Methods of the Super Class with new Method Stubs
    • Cross-Browser Compatibility including Scale-Independent Pixels, Device-Independent Pixels (DP), and Conversion
    • Resources (String, Image) and Literals
    • Resources Identifiers and the dynamically generated R Class
    • Downcasting to Classes
    • Navigating between Multiple Activities and Layouts
      • Explicit Intents
      • Implicit Intents
    • Event Handler Custom Methods
      • Inline Event Handlers with all Code in Java File (easier for Debugging instead of Splitting code between Event Handlers Declared in XML file and Event Handler Methods in Java File)
      • Options Menu { Refactor Architecture by Replacing Buttons with Items in Options Menu using Switch Statement for Event Handling of each Intent } 
    • System Level Event Handling with Broadcast Receiver
      • Permission Granting
      • Extend Java Class BroadcastReceiver to Phone State Change and subsequent Intent generated by OS to Manage Switch b/w Phone and App
      • Debugging Reference to Extras KVPs (i.e. TelephonyManager) that describe State (i.e. Ringing) and comprise each Instance of Class Bundle
      • Registering Broadcast Receiver Class in Manifest with Intent Filter with Actions for Phone State Changes
      • Testing Virtual Device in Emulator with DDMS Emulator Control (i.e. Ringing) and LogCat
    • Constructors and Arguments (Current Context Activity "This", Class Fields i.e. "DetailedActivity.class") 
    • Action Bar and Options Menu
      • Converting Launcher Button of Action Bar into an Up Button (Strategy Complies with Android Design Guidelines)
      • Displaying Menu Items in Action Bar in Primary and Secondary Activities (Never, Always, IfRoom)
    • Activity Lifecycle and Activity Stack Rules
      • Stages { Created, Started, Resumed, Paused, Stopped, Destroyed }
      • Methods { onCreate(), onStart(), onResume(), onPause(), onStop(), onRestart(), onDestroy() }
      • Tasks containing Activities, which are Grouped into Stacks
      • Second Activity launched to Top Stack pushes Primary Activity to Back Stack
      • Starting and Finishing Activities
      • Transient and Resting States
        • States associated with Events that are associated with Methods containing Code
        • Note: Running App after "Home" button bypasses onCreate method. Running App after "Back" button does not, and removes memory. 
    • Custom Styles defined in single XML file with Attributes to control appearance of Widgets in Activity Layouts for the User Interface (similar to web page CSS) and apply throughout the app
      • Parent Attribute to Inherit Existing Styles (including Android SDK Pre-Defined Styles)
    • Widgets
      • ScrollView in Composite Category
      • ListView 
        • ArrayAdapter Class that grabs the Data to add to List and expects Arguments Context, Resource, and List of Data. Use of Layout for each List Item (from R Class, part of Android SDK, Simple List Item  that Displays a Single String) to pass Resource Argument
        • Customise Appearance of ListView MainActivity by creating a Custom Item Layout, Creating a Custom Adaptor Class (Subclass of ArrayAdapter), and Saving Private References to the Context and List of Data so it Persists for Life of Adapter, and using Layout Inflators to present instance View Objects containing Data (i.e. Image and TextView)
    • Fragments API { Architect Adaptable Multiple Fragment Screen Layouts for flexibility across Multiple Device Screen Sizes }
      • Master/Detail Flow Template with Modifiable Dummy Content for Data-Centric Apps
    • Multi-Activity Data Transfer using Intent Extras (KVPs)
      • Sending and Receiving Data between Secondary and Calling Activities using startActivityForResult method (i.e. Add to Shopping Cart)
  • Auto-Indentation ( CMD + I )
  • Emulation and Testing with Launch Configuration to Run on Multiple Virtual Devices Concurrently (Phones, Tablets)
    • Rotate 90 Degrees ( LEFT CTRL + F12 ) Tests Adaptability to Orientation Changes
    • Prevent Recreation on each Orientation Change
      • Override Auto Recreation on Orientation Configuration Change in Manifest File
      • Override Configuration Changed Class with Event Handler to Add Custom Code on each Configuration Change
      • Debug with Toast Messages 
  • Links
  • Curiosity
    • Advanced Intents - Handling Implicit Intents with Custom Activities registered for Own Standard and Custom Actions

Progress @ Teamtreehouse.com
  • Diary App with Core Data- DONE

Progress @ Harvard Business Publishing 
  • Management Communication: Presenting - DONE


  • Final Presentation (Peer Reviewed Oral Presentation) - DONE
    • Presentation Draft - DONE
    • Peer Review - DONE
    • Final Submission -  DONE

Events
  • BOOKED Olympus Photography Masterclasses with Vogue Australia, Vogue Living, GQ Australia, and Olympus Photography Specialists (Portraiture, Fashion, Still-Life) - Sat 7 June 2014

Curiosity

Friday, 23 May 2014

iOS Unit Testing

Challenges
  • Error 'Parse/Parse.h' file not found (Unit Testing in iOS)
    • Background: I added the following Unit Testing lines of code in appropriate sections of my RibbitTests.m file in Xcode 5 to import the view controller header file that I wanted to test.
#import "ImageViewController.h"
@property (nonatomic) ImageViewController *imageViewController;
#pragma mark - App Test Cases
- (void) testImageViewController{   XCTAssertNotNil(self.imageViewController, @"imageViewController model was not nil");}
    • Problem: Received error message 'Parse/Parse.h' file not found 
    • Solution: 
      • Deleted Parse.framework in Xcode 5 (use Apple Finder to check that there is no Parse.framework folder still in your project directory) 
      • Re-downloaded the Parse.com iOS SDK
      • Dragged the downloaded Parse.framework folder into the Frameworks directory within Xcode 5, and ensure that you tick the following boxes (noting that the initial error message you received may have been caused because when you initially installed Parse.com's SDK, you may not have also added a tick next to RibbitTests)
      • Dragged the downloaded Parse.framework folder into the Frameworks directory within Xcode 5, and ensure that you tick the following boxes (noting that the initial error message you received may have been caused because when you initially installed Parse.com's SDK, you may not have also added a tick next to RibbitTests)
Activities @ TeamTreeHouse - 

Unit Testing for iOS (using Xcode 5 IDE) with Amit Bijlani

DONE (using Ribbit iPhone App)
  • Unit Testing { 
    • Runtime errors (insufficient type testing)
    • Logic errors (insufficient scenarios)
    • Regressions (team scenario bugs)
    • XCTest.framework { write tests that a subclasses of XCTestCase }
    • XCT Assertion types
    • Running Unit Tests
      • CMD + U { Product > Tests }
      • Re-Testing { Product > Perform Action > Test Again }
      • Method Testing { Press 'Play' Button in gutter to the left of the method }
    • Navigating Unit Tests
      • Test Navigator (in the Project Navigator)
        • Running Specific Tests { Press 'Play' Button shown on right of: }
          • Test Suite
          • Test Cases
          • Test Methods
    • Creating Tests { Press + Button in bottom left corner of Test Navigator }
      • Test Classes
      • Test Targets
    • Matching Test Case Methods with corresponding Code Methods { Assistant Editor > Click Breadcrumb Navigation bar (at top right), then scroll down and Click either:
      • Test Classes
      • Test Callers { identifies other methods that call the method, including Unit Testing methods }
    • Continuous Integration 
    • Shortcuts 
      • CMD + U  { Runs Unit Test }
      • CMD + Click { Press this combination when hovering a method to toggle between the methods location in the header and implementation files } 

Monday, 12 May 2014

Post WDI - iOS Dev App (User Accounts, BaaS, Mobile Design, Parse.com Framework API, Asynchronous, Helper Methods, Git Ignore, RubyMotion)

Challenges
  • Debugged extensively trying to solve why checkmarks were appearing on currently selected cells in the table view only after clicking another different cell in the table view 
    • Solution: Incorrect method chosen when creating instance method with autocomplete, should have used didSelectRowAtIndexPath (NOT 
      didDeselectRowAtIndexPath)
Activities @ TeamTreeHouse - 

iOS Development (using Xcode 5 IDE) with Ben Jakuben

DONE Ribbit iPhone App
  • Xcode 5 Tabs for Open Files { Xcode5  > Preferences > Navigation > Double Click > Use Separate Tab }
  • View Controller Lifecycle 
    • Start App (First Time)
      1. view not exist
      2. call viewDidLoad (only called if no view controller exists in memory)
      3. call viewWillAppear 
      4. call viewDidAppear
      5. view controller appears on screen in ready state (user can view and interact)
    • Navigating Away from current ViewController
      1. call viewWillDisappear
      2. call viewDidDisappear
      3. view controller remains in memory for future use as long as memory avail
    • Start App (After First Time)
      1. skips viewDidLoad (as it already exists)
      2. call viewWillAppear
      3. call viewDidAppear
    • Typical Usage
      • viewDidLoad { use for code that only needs to run once when view first loaded (i.e. creating, loading data, config display) }
      • viewWillAppear { use to display something every time view controller displays on screen (i.e. refresh data, animation) }
  • Stack (of View Controllers) (Nav Controller maintains VC's pushed onto or pulled off the array stack above Root VC)
    • pushViewController
    • popViewController
  • Import Types (used in Header file)
    • " "   means search current project for header file
    • < >  means search certain present system paths (i.e. frameworks)
  • UITabBarController (switches between different tab areas of app) & UITabBarItem
    • selectedIndex property
    • setSelectedIndex
    • badgeValue property
  • UIAlertView { [alertView show] }
  • UITableViewCellAccessoryCheckmark (or None)
    • accessoryType 
    • Prevent Scrolling Cell Reuse { explicitly set each cell only when user corresponding to current table view row is in an array to prevent reuse of cells and incorrectly mirrored checkmarks being displayed }
  • UIImagePickerController (capturing photos and videos with either Default (presented modally) or Customer implementation type )
    • Protocols { Custom View Controller created in conformance with UIImagePickerController delegate, which in turn conforms to UINavigationController delegate protocol, so when user cancels or captures images or video the system notifies the cameras delegate of the users choice }
    • presentViewController used to display the the camera view modally
    • imagePickerControllerDidCancel { delegate method of UIImagePickerController where Custom Class that we've named 'CameraViewController' is the delegate }
    • didFinishPickingMediaWithInfo { stores image info in NSDictionary with a key }
    • UIImagePickerControllerMediaType { key method constant passed in and used to retrieve different media types stored as constants as part of Mobile Core Services Framework }
      • #import <MobileCoreServices/UTCoreTypes.h> (constant values of media types obtained)
      • kUTTypeImage { image media type from Core Foundation (CF) that needs to be converted to Next Step (NS) String counterpart type of data structure using Cast (NSString *). use @properties to store images retrieved for use throughout view controller and to set it to be stored in NSDictionary key }
    • UIImagePickerControllerMediaURL { key path method constant passed in and used to retrieve local iOS internal path as a string and stored in @property defined in header (videos not stored in NSDictionary like images are) }
    • Simulator Testing with Photo Album (the iPhone camera is not available unless testing using the device so to test within the simulator using the photo album instead perform the following actions in Xcode Simulator)
      • Hardware > Home, Open Safari in Simulator, Drag a photo to Safari browser, Click the 'Share' button, Click 'Save to Camera Roll'
    • Help Menu Keywords { camera programming topics for iOS }
  • Video Player 
    • Options on iPhone
      • Default Video Player (MPMoviePlayerController)
      • Embedded Video Player
    • #import <MediaPlayer/MediaPlayer.h>
    • Media Player Framework (MediaPlayer.framework)
      • Project > Build Phases > Link Binary Libraries
  • NSTimer 
    • scheduleTimerWithTimeInterval
  • Testing 
    • respondsToSelector (check if method exists before calling it in code block)
  • Modal Control Dfn { UI of VC requiring user input before proceed with app }
    • Modal View Controller { layer over current VC, child of current VC (i.e. UIAlertView) } 
  • NavigationController (NavC) (help navigate different sections of app screen flow)
    • Set NavC for the TableVC and TabBarC { pairs NavCs with TabBarController and used to control the Manual Segues with VC, Click VC, Menu > Embed In > Navigation Controller  }
      • popToRootViewControllerAnimated
      • Remove Default Back Button Setup by NavC { self.navigationItem.hidesBackButton = YES; }
      • Remove Tab Bar  { Add method to prepareForSegue setHideBottomBarWhenPushed before VC pushed onto the stack of the workflow 
  • Segue (With)
    • VC onto NavC { CTRL+click, Drag to ViewController(VC), select Action Segue }
    • Button to VC { CTRL+click button, Drag to VC, select Action Segue }
  • Segue (Without)
    • VC onto TableVC { access VC without Segue attached to Action, CTRL+click 'yellow icon' below VC, Drag to VC, select Manual Segue }
  • Segue (Identifier)
    • Click Segue between VC, Add "Identifier" to pass Data between VCs
    • Create method to perform segue to second view controller { -(void)___ { [self perfomSegueWithIdentifier:@"<insert identifier>" sender:self]; }
  • Linking the Prototype Cell of VC in Storyboard with Class Method (Attributes Inspector > Identifier > "Cell", to match CellIdentifier in code) 
  • @property Storage { Data Source 'Weak' for Text Fields on Sign Up and Sign In forms as dependent on life of View Controller itself }
  • IBOutlet { used for Text Fields for user input, dragged to @interface using Assistant Editor View }
  • IBAction { used for Button to submit, dragged to @interface }
  • Refactoring Code { Select code for refactoring (encapsulating into separate method to comply with DRY principle) into a new Helper method and then go to Edit > Refactor > Extract > <enter name for method> 
  • Stub { i.e. - (void)___ { } }
  • API  { Application Programming Interface to interact with sub systems and third party systems i.e. UIKit and Foundation frameworks }
  • Black Box { System designed with Interfaces (i.e. sets of methods and properties defined in publicly viewable header file) clearly defined between components }
  • Web Interface { between Front-End Black Box and Back-End (i.e. Parse.com Back-end-as-a-Service (BaaS) dynamically creates what is needed in Back-End) }
  • Parse.com Framework SDK Setup { extra Frameworks required as Dependencies by Parse Framework installed per Parse.com instructions via Project > Target (Ribbit) > Build Phases (tab) > Click “Link Binary with Libraries” }
  • Parse.com API Calls { iOS Guide, iOS API } 
    • objectWithClassName (PFObject) (creates Parse.com database table object) saveInBackground (save data to Parse.com back-end)
    • signUpInBackgroundWithBlock (PFUser) (asynchronous multi threaded approach using Block construct set up as callback mechanism with Parse.com response, receipt and processing in block with success and error handling)
    • currentUser (PFUser) (returned value is automatically Cached on device and user session logged in)
    • logOut (PFUser)
    • loginHandler block (PFUser)
    • loginWithUsernameInBackground (PFUser)
    • findObjectsInBackgroundWithBlock (PFQuery) (block that returns array of PFObjects)
    • relationForKey (PFRelation)
    • saveInBackgroundWithBlock 
    • reloadData (method to refresh the Table View data)
    • addObject
    • saveInBackground
  • Parse.com Classes { 
    • PFObject (iOS Guide > Users)
    • PFUser
    • PFRelation  (ensures Parse.com not dealing with too much Data at once. Relations are stored in Parse.com Table Object under column (property of Class) with designated Key. PFRelation has a PFQuery property to use to retrieve data linked by relation)
    • PFQuery (retrieving and viewing data 
    • PFFile (uploading files and associate them with a message PFObject that will be )
  • Uploading Files to Parse.com
    • PFFile to upload file itself
    • PFObject uploaded separately as message Object (created dynamically at Parse.com) associated with PFFile
      • Message Object 
        • Message Contents
        • Sender
        • Recipient
      • Schemaless means not req'd to specify keys existing on each PFObject, just set KV pair and back-end stores them
    • Chaining Asynchronous Calls { upload file itself and then other details if initial asynchronous call succeeded improves UX by not delaying user }
  • Deleting Files on Parse.com
    • Options
      • RESTful API's 
      • Clean Up Files (Dashboard > Settings > Clean Up Files) { deletes all files that we have uploaded that are no longer referenced by any other objects in back-end }
  • Asynchronous Indeterminant Nature (amount of Time) of calls as data not always returned in order expected. Multiple Callback Blocks must be managed. Avoid where possible by implementing DRY principle and sharing data between methods of VC's with prepareForSegue method
  • Block { ^ (<parameters defined inside parenthesise>) { curly braces with code } }
  • Helper Methods (i.e. looping mechanism to check for friends against current user)
    • Alternative is Hash or Cache for efficiency with high volume of users 
  • Shortcuts 
    • Hidden Files (show hidden files with CMD + Shift + . }
    • Indentation CMD + ]  or CMD + [
  • Git Ignore { store API keys in .plist file using this guide https://teamtreehouse.com/forum/hiding-api-credentials-in-github-for-xcode-5-projects }
  • Mobile Design

Events:
  • ATTENDED SydInMotion - Ruby & iOS development (awesome! early stage community)
    • @fluffyjack (inspiring presentation, RubyInMotion time after exams finish mid June '14)

Curiosity:

Purchases:
  • RubyMotion a personal leap of faith inspired by SydInMotion! Now I just need to buy some coding friends...

Links:

Sunday, 11 May 2014

Google Cloud Print Review

Google Cloud Print Review

  • Benefit: Wirelessly print to an existing non-wireless home printer. 
  • Setup: Install Google Chrome. Add the printer using Google Cloud Print (Beta) https://www.google.com/cloudprint/. Click the printer and Share access to it with other people who have a Gmail account. Select Google Cloud Print as the destination printer to Print (instead of a Local Printer) to from any device. Use Google Drive for added flexibility.

Wednesday, 7 May 2014

Post WDI - iOS Dev App (Web View, Custom Classes, Date Formatting, Dynamic Binding, Super, Self, Segue, View Controller Stack)


Activities @ TeamTreeHouse - 

iOS Development (using Xcode 5 IDE) with Amit Bijlani (Cont'd)

DONE Building API Reader (Table View) iPhone App
  • @synthesise { replace setter and getter methods in .m file associated with @property instance variables in .h file }
  • @interface declaration { NSString *title; } (optional in latest Xcode!)
  • Scoping instance variables { only visible in Class declared within unless use getters and setters }
  • Setter method (in .h) { - (void) setTitle:(NSString *)title; }
  • Getter method (in .h) { - (NSString *) title; }
  • Setter method implementation (in .m, returns instance so use *) { - (void) setTitle:(NSString *)_title { title = _title; }
  • Getter method implementation (in .m) { - (NSString *) title { return title; } }
  • Primitive Type (i.e. int) declaration { @property (nonatomic) int views  } (not require 'strong'/'weak', etc)
  • Legibility Alternative for Primitive Type (Boolean) { 
.m@property (nonatomic) BOOL unread;
// alternative@property (nonatomic, getter = isUnread) BOOL unread; 

ViewControllerif (blogPost.isUnread) {   NSLog(@"%@", @"hi");}
  • Custom Class instance variable setter access approaches {
    • Dot Notation { NSString *string = blogPost.title; }
    • Convenience Constructor { NSString *string = [blogPost title]; } 
    • Set Method { [blogPost setTitle:@"my title"]; }
  • Self 
    • directly accesses Setter and Getters of the instance variable in @interface
    • allows multiple instance vars to refer to a particular instance of a Class
    • where Class has Parent Class like NSObject, the instance of a Class ('self') needs to refer to the Parent from which it inherits properties and methods (using 'super')
  • Super { refers to Parent Class within implementation }
    • i.e. self = [super init]; // self refers to particular instance of the Class. calls Super/Parent Class to use its methods (i.e. init, dealloc, etc) to initialise instance of Custom Class
  • Customer Class { benefits in that code is more maintainable than with say NSDictionary for data }
  • Dedicated Initializers { responsible to initialize new instances of Class with data, ensures that when a Custom Class is initialized, it must have a title for example }
    • init (NSString, etc)
    • initWithObjects (NSArray, NSDictionary)
    • i.e. - (id) initWithTitle:(NSString *)someTitle;
  • Convenience Constructors { Class methods (i.e. + sign in Help) that performs Alloc and Init in one step and returns an instance }
    • alloc init
    • arrayWithObjects
    • i.e. + (id) blogPostWithTitle:(NSString *)someTitle;  // 'someTitle' passed as argument with this Class method (uses + sign)
  • id { general purpose data type that follows Dynamic Binding Design Pattern where Class of an Instance is not specified immediately (i.e. only definition created in Controller, but it is Bound at Runtime when run app which causes the Object to become a specific type like NSString). it can create instance of any Class and not always know return type. not required to use asterix * (i.e. id *myObject) to indicate instance when specifying 'id', as this is already implied }
  • Dynamic Binding { see above }
  • Display Images from JSON URL { NSURL (i.e. URLWithString) downloaded as UIData (i.e. dataWithContentsOfURL) object (binary), parsed to convert to UIImage object (i.e. imageWithData), and set to the UIImageView (i.e. imageView) }
  • Debugging Malformed and Erroneous Data { i.e. JSON with empty fields ( if ( [blogPost.thumbnail isKindOfClass:[NSString class]] ) { // only display if not NSNull ) }
  • Concatenating Data { [NSString stringWithFormat:@"%@ %@", blogPost.author, blogPost.date]; }
  • Custom Date Styles with NSDateFormatterStyle {
NSDATE *today = [[NSDate alloc] init]; // or use convenience constructor [NSDate date]

NSLog@“%@“, today); // prints today’s date
// NSDate Object stores in ‘seconds’ from Jan 1 2001 until today (represented internally). where 60 sec/min, 60 min/hour, 24 hr/day
NSTimeInterval secondsPerDay = 60 * 60 * 24; // typedef double used with the Date object
NSDate *tomorrow = [NSDate dateWithTimeIntervalSinceNow:secondsPerDay]; // add time to now NSDate *yesterday = [NSDate dateWithTimeIntervalSinceNow:-secondsPerDay]; // minus seconds per day
// create instance of NSDateFormatter NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; [dateFormatter setDateFormat:@“EE MMM, dd”];(see Help Menu "Date Formatting Guide > Date Formatters > Fixed Formats (depends on iOS version)http://www.unicode.org/reports/tr35/tr35-31/tr35-dates.html#Date_Format_Patterns

// pass date object *today through date formatter and output a string NSString *todayString = [dateFormatter stringFromDate:today];
  • URL open in Default Browser
NSURL *url = [NSURL URLWithString:@"http://www.lukeschoen.com"]; UIApplication *application = [UIApplication sharedApplication]; // retrieves shared instance of singleton application object UIApplicationMain (see Support Files > main.m)[application openURL:url]; // call UIApplicationMain's method 'openURL'
  • Navigation Controller { manages presentation of hierarchy of data in app. manages multiple View Controllers and navigation between them. Navigation Controller has following elements:
      • Nav Bar (back button, title)
      • View (custom content)
      • Toobar (optional)
    • View Hierarchy
      • Stack of View Controllers { LIFO (Last In First Out) }
        • viewControllers (NSArray)
      • rootViewController
    • Stack Manipulation
      • Push (View Controller) on Stack (point to same View Controller unless there is a Modal View Controller)
        • Properties set
          • topViewController
          • visibleViewController (points to last one pushed onto the Stack)
  • Link ViewControllers in Storyboard { click Cell, press CTRL and Drag, select say 'push' (push View Controller on the Stack by creating a Segue aka Scene between the View Controllers) }
  • Link & Intercept Segue Event with Code { click Segue (connection between View Controllers), Attributes Inspector > Storyboard Segue > Identifier > "___" (i.e. showBlogPost) }
.h
@property (strong, nonatomic) IBOutlet UIWebView *detailView;@property (strong, nonatomic) NSURL *blogPostURL;
.m (of Master View Controller)

// check 'identifier' given to the segue in the storyboard.    // prepareForSegue is part of UIViewController- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {   NSLog(@"%@",segue.identifier);
// use BlogPost Custom Class (on event where segue for DetailView is fired). DetailViewController (segue object) has @properties 'detailView' and 'blogPostURL' defined if ([[segue identifier] isEqualToString:@"showBlogPost"]) {  // access blogpost object from blogposts array that was selected from Table View       NSIndexPath *indexPath = [self.tableView indexPathForSelectedRow];   BlogPost *blogPost = [self.blogPosts objectAtIndex:indexPath.row]; [segue.destinationViewController setBlogPostURL:blogPost.url];

.m (of Detail/Web View Controller)
- (void)viewDidLoad {    [super viewDidLoad];// below refers to @property blogPostURL that was set in Master View Controller to prepare segue and show URL details associated with list itemNSURLRequest *urlRequest = [NSURLRequest requestWithURL:self.blogPostURL]; 
  • WebView { subclass of UIView, uses WebKit rendering engine to display webpages }
  • UIWebView { control dragged to Storyboard and instantiated in code to load webpage by clicking the UIWebView in Assistant Editor, pressing CTRL and dragging the UIWebView from Storyboard to section of code in @interface }
  • Embed WebView and Display Common DetailView (in viewDidLoad method)
NSURL *url = [NSURL URLWithString:@"http://www.lukeschoen.com"]; // create instance of url request    NSURLRequest *urlRequest = [NSURLRequest requestWithURL:url]; [self.detailView loadRequest:urlRequest]; // load default webpage using @property detailView

Links:

Purchases: