Pop last item from array


I have an Array and want to pop (delete and return) its last element.


// Initialize the Array
var a = [1,2,3]

// Remove last item
let lastItem = a.removeLast()


Heard the news?

The Swift Cookbook for Swift 3 is at last here! For iBooks, Kindle and Paperback.
Hurry up - and Check it out! ;-)