Tag: functions

Understand and Use Closures in Swift

Have you ever seen some factory method in UIKit and see this strange parameter called completion or completionHandler? Usually you put nil there and leave it alone. These strange things like (Double,Double) -> Bool things are closures. Closures are functions you use as types,…

Kinderswift 8: Making Your Own Functions

Transcript In our last lesson we learned about functions. Swift, and most modern programming languages are nothing more than writing groups of your own functions. In this lesson, we will write our own functions. In our last lesson you may remember this function Which…

KinderSwift 7: Introduction to Functions

This session we will learn about functions by making colors with UIColor. Transcript Welcome to lesson 7 of KinderSwift. In our last lesson we used this to convert a Int into a Double and this to convert a Double into a Int. Both of…

From Apple to Raspberry Pi: Importing Classes and Disturbing Attributes.

I didn’t do as much As I thought I would today, as I was installing tightvnc on the Raspberry Pi. I then tried out acessing my RasPi on my Mac, Pc, and even my iPad mini. I wasn’t nuts enough t try it on…

from Apple to Raspberry Pi: Making Classes in Python

Objective-C and Python are similar when it comes to defining new classes, but be careful with their differences. In Objective-C we would define a class with two files: a header and an implementation file. In the header we would declare properties like this And…

From Apple to Raspberry Pi: Transitioning into Functions.

When I started Making App Pie, one of my big frustrations was wrapping my head around defining methods. I was used to C++ and Java functions. Objective-C and its Smalltalk roots just threw me. Now going into Python is difficult too — but for…