Another presentation, another topic. This time the topics were roles in a app development company, and I picked the CEO. Easy I thought at first, but I soon realised that I was wrong. We are all CEOs of our own lives - Jero (class mate) The responsibilities for a CEO of an app company varies a lot depending on the size of the company. From being the Chief Everything Officer in a small company to focusing more on investor relationships, branding, vision etc.
Check out my presentation on Prezi - http://prezi.com/mu6ekogomlvu/?utm_campaign=share&utm_medium=copy
0 Comments
In addition to coding homework we also have presentations we have to prepare to hold in front of class. This is to give us presentation training and to educate us a bit more on different topics. This week I had about GPUs.
Check out the presentation here on Prezi - http://prezi.com/kwimqp2zjvbp/?utm_campaign=share&utm_medium=copy Week 2 of the iOS Bootcamp has moved on to iOS programming. In the first week we learned the basics of Swift, and this week we have gotten to use that in practise. We have moved on to the iOS Programming book from The Big Nerd Ranch (https://www.bignerdranch.com/we-write/ios-programming/) and we finally get to write code that will show up on our iPhones. The solution is in the code - Jero (class mate) We have been making lists, deleting and editing entries in lists and displaying maps and web sites. The challenges at the end of each chapter can be quite challenging (hence the word), but everyone gets to the end eventually, which is great to see.
We are working towards a 2 week project where we know we will at least make use of tables, maps and the camera. If you are reading this then you are probably among one of the many who have gotten at least one or two grey hairs from trying to understand Closures in Swift, myself included. So here goes, lets try to make Closures understandable. One thing to remember before we start: every function is a closure. But not every closure is a function. I´ll get back to this a bit later. func printNestedFunction(param1: String, param2: String) -> String { There are three type of closures; First you have Global functions – they have a function name and cannot capture any values. An example of a global function is like this: func printGlobalFunction() { print(“Hello from the other side”) } printGlobalFunction() Here the func denotes that is it a function. The printHello is the function name. There are no parameters passed into the function, hence the empty ( ). There are no return parameters and the function body is everything that is between the curly brackets { }. Second, there are Nested functions – they have a function name and can capture values from their enclosing functions. Nested function have function inside the bodies of other functions. func printNestedFunction(param1: String, param2: String) -> String { return "I must have \(param1) a \(param2) times” } printNestedFunction(“called”, "1000") The parameters within the brackets , param1: String and param2: Int, are passed into the function to be used. The return type is denoted by the -> sign, and our return type is this time a String. One thing that is special with nested functions and closured is that they can return a function as a type. That would look something like this: func myNestedFunction() -> (String, String) -> () { func apologyToYou(apology: String, forWhat: String ) { print(“To tell you I´m \(param1), for \(param2)”) } return apologyToYou } let apology = myNestedFunction() apology(“sorry”, forWhat: “everything that I´ve done”) Closure expressions – they don’t have a name and can capture values from their context. This is a way of writing function-like expressions without a full declaration and name. Simply put, its a way to write very short and concise pieces of code. The closures are wrapped in a pair of curly brackets { }, and that is the reason I mentioned earlier that all functions are closures, but not all closures are functions. If you look at the functions above, these also have function bodies within a pair of curly brackets. So technically all of them are closures. But the difference is that with closure expressions is that closure expression is a very simplified and short code. Here is how the syntax is set up for closure expressions: { (parameters) -> return type in statements } An example would be like this: var neverHome = { () -> String in return “But when I call you never seem to be home" } Here the () -> String defines the function type followed by a in keyword that defines the body of the closure. It is also possible to further shorten these expressions, called shorthand syntax, and there are some higher-order functions that are very useful, such as map(), filter() and sort(), but that will be for another time. But I will give you an example of how much you can shorten a code expression by using shorthand, just as a teaser: From: [1, 2, 3].map( { (i: Int) ->Int in return i * 2 } ) To: [1, 2, 3].map { $0 * 2 } This is a very short, but hopefully easy explanation about Closures in Swift. There are a ton of website that I would recommend you to read in order to get a better grip on Closures. I will list a few below:
http://airspeedvelocity.net/2014/06/11/a-basic-tutorial-on-functions-and-closures-in-swift/ https://www.weheartswift.com/closures/ http://code.tutsplus.com/tutorials/swift-from-scratch-closures--cms-23138 Week 1 of the iOS Bootcamp is over and I am even more excited than day 1. I was a bit anxious about how much I would like the programming. I really liked it in University, but its been probably 8 years ago since I wrote any code. So it feels really good that I feel the same urge and determination now to find that one mistake I have made before the program can run properly. My inner geek is coming out of hibernation!
The first week has been spent going through The Big Nerd Ranch book for Swift Programming, reading and during the examples there. Its a really good book if you ever want to start to learn yourself. I'll put a link to their website here: https://www.bignerdranch.com/we-write/swift-programming/ The class and the teachers have proven to be very nice as well. And time flies when you are writing code! If it goes this quickly all the time then the 12 weeks will be over in no time. Its a new year and its full of new opportunities for everyone. My recent challenge is the iOS BootCamp at The App Academy here in Amsterdam. 12 weeks of learning iOS and Swift development. Its hopefully the start of a new career and a new life. I am quite excited to start. I will try to update this blog as much as possible to keep you in the loop about how it is.
Some thoughts on the first day is of course necessary. We are a group of 7 people, each with very different backgrounds. Marketing, journalism, translator and more. It seems like a good and diverse group and it will be interesting to see how each will do with the challenges ahead. I am one of the few with some previous experience with programming. The days are from 9 till 6, with homework in the evening and weekends. They don't call it a bootcamp for nothing! But then that is also why we pay for this right? The teachers and helpers also seems very good, so I am really looking forward to the next coming 12 weeks. Let's start! |
Archives
April 2016
Categories
All
|