Posts

Showing posts with the label Refactoring

Ray Wenderlich Course Part 14 (up to lesson 142)

So, continuing! I'm going to try to get through as much of the next three sections as possible. The next bit is about MVC. I know about that already. So here we go! So Brian mentions that we'll code the project in a sub-optimal way, then do it with MVC. I think I know what this will mean - that the code will repeat itself and not the use the 'model' part of it. Model View Controlle r This is a template solution to help you solve problems. I've used with MVC and actually already created a folder for each of these, then got the files that match up to these. It is a paradigm basically. There is communication between these that means you don't have to re-code/repeat yourself. MVC - First Attempt Refactoring - a posh way of saying rewriting/redoing. let row1Text = "Walk the dog"     let row2Text = "Brush my teeth"     let row3Text = "Do some coding"     let row4Text = "Watch GoT"     let row5Text = ...

Build A Simple iPhone App - Part 3

Continuing with the course! So I've got the basic layout features pretty much sorted, complex as they are. It looks like for the next part that I'll create an array and link this to the code. Then this will bring up different facts from the array. It will be good to put this into practice. The more practice, the more it will make sense. That's the idea at least! Creating a Data Collection Collections - data types that allow you to create and manage groups of information. An array works best here - we do not need dictionaries! I know the difference between these from before. @IBAction func showFact() {                  let facts = [ "Michael Schumacher has won the most F1 races and championships" , "Game of Thrones started in 2011" , "Hugh Grant starred in About a Boy" ]                  funFactLabel . text = facts[ 1 ]               ...