Tutorial by Examples

In some cases, you might not want to use the default maps, Apple provides. You can add an overlay to your mapView that contains custom tiles for example from OpenStreetMap. Let's assume, self.mapView is your MKMapView that you have already added to your ViewController. At first, your ViewControll...
Routing defines a map between HTTP methods and URIs on one side, and actions on the other. Routes are normally written in the app/Http/routes.php file. In its simplest form, a route is defined by calling the corresponding HTTP method on the Route facade, passing as parameters a string that match...
Named routes are used to generate a URL or redirects to a specific route. The advantage of using a named route is, if we change the URI of a route in future, we wouldn't need to change the URL or redirects pointing to that route if we are using a named route. But if the links were generated using ...
You can use route parameters to get the part of the URI segment. You can define a optional or required route parameter/s while creating a route. Optional parameters have a ? appended at the end of the parameter name. This name is enclosed in a curly braces {} Optional Parameter Route::get('profi...
You can also combine several operators together to create more complex WHERE conditions. The following examples use the Employees table: Id FName LName PhoneNumber ManagerId DepartmentId Salary Hire_date CreatedDate ModifiedDate 1 James Smith 1234567890 NULL ...
// View to hold the CAGradientLayer. let view: UIView = UIView(frame: CGRect(x: 0, y: 0, width: 320, height: 320)) // Initialize gradient layer. let gradientLayer: CAGradientLayer = CAGradientLayer() // Set frame of gradient layer. gradientLayer.frame = view.bounds // Color a...
// View to hold the CAGradientLayer. let view: UIView = UIView(frame: CGRect(x: 0, y: 0, width: 320, height: 320)) // Initialize gradient layer. let gradientLayer: CAGradientLayer = CAGradientLayer() // Set frame of gradient layer. gradientLayer.frame = view.bounds // Color at the top of...
// View to hold the CAGradientLayer. let view: UIView = UIView(frame: CGRect(x: 0, y: 0, width: 320, height: 320)) // Initialize gradient layer. let gradientLayer: CAGradientLayer = CAGradientLayer() // Set frame of gradient layer. gradientLayer.frame = view.bounds // Color at the top of...
The Laravel framework has the following requirements: 5.3 PHP >= 5.6.4 XML PHP Extension PDO PHP Extension OpenSSL PHP Extension Mbstring PHP Extension Tokenizer PHP Extension 5.1 (LTS)5.2 PHP >= 5.5.9 PDO PHP Extension Laravel 5.1 is the first version of Laravel to support ...
ViewData is the mechanism for a controller to provide data to the view it presents, without using a ViewModel. Specifically, ViewData is a dictionary which is available both in MVC action methods and views. You may use ViewData to transfer some data from your action method to the view returned by th...
List<String> data = new ArrayList<>(); data.add("Sydney"); data.add("London"); data.add("New York"); data.add("Amsterdam"); data.add("Mumbai"); data.add("California"); System.out.println(data); List<String> sor...
Initialize the UITapGestureRecognizer with a target, self in this case, and an action which is a method that has a single parameter: a UITapGestureRecognizer. After initialization, add it to the view that it should recognize taps in. Swift override func viewDidLoad() { super.viewDidLoad() ...
There are a number of collection types in Python. While types such as int and str hold a single value, collection types hold multiple values. Lists The list type is probably the most commonly used collection type in Python. Despite its name, a list is more like an array in other languages, mostl...
For instance, a computation involving commands to read and write from the prompt: First we describe the "commands" of our computation as a Functor data type {-# LANGUAGE DeriveFunctor #-} data TeletypeF next = PrintLine String next | ReadLine (String -> next) derivin...
Create an application heroku create your-app-name Deploy to Heroku git push heroku master Open your application in a browser heroku open your-app-name List Heroku commands heroku commands General help heroku help Help for a specific command heroku help <command>
Constructor functions are functions designed to construct a new object. Within a constructor function, the keyword this refers to a newly created object which values can be assigned to. Constructor functions "return" this new object automatically. function Cat(name) { this.name = name;...
Each time you use a selector in jQuery the DOM is searched for elements that match your query. Doing this too often or repeatedly will decrease performance. If you refer to a specific selector more than once you should add it to the cache by assigning it to a variable: var nav = $('#navigation'); ...
Using the apt package manager sudo apt-get update sudo apt-get install nodejs sudo apt-get install npm sudo ln -s /usr/bin/nodejs /usr/bin/node # the node & npm versions in apt are outdated. This is how you can update them: sudo npm install -g npm sudo npm install -g n sudo n stabl...
There are two parts of a class: the interface and the implementation. The interface is the exposed functionality of the class. Its public methods and variables are part of the interface. The implementation is the internal workings of a class. Other classes shouldn't need to know about the implemen...
Encapsulation allows you to make internal changes to a class without affecting any code that calls the class. This reduces coupling, or how much any given class relies on the implementation of another class. For example, let's change the implementation of the Angle class from the previous example: ...

Page 160 of 1336