Reader small image

You're reading from  Swift 3 New Features

Product typeBook
Published inOct 2016
Reading LevelIntermediate
PublisherPackt
ISBN-139781786469632
Edition1st Edition
Languages
Right arrow
Author (1)
Keith Elliott
Keith Elliott
author image
Keith Elliott

Keith Elliott is a multitalented professional with unique business and technology experience spanning telecommunications, real estate investment banking, and capital markets. His work is driven simply by problems that need solutions, whether the problem is as simple as his wifes request for a custom to-do list or as complex as interest rate derivatives and foreign exchange hedging. He graduated with an MBA from Columbia Business School with an emphasis in entrepreneurship and an undergraduate degree from Georgia Institute of Technology with a bachelor's in computer engineering. Keith's own company, GittieLabs LLC, works with startups to provide technology solutions. His vision is to equip students with the real-life experience necessary to succeed in startup and corporate life. You can find his blog on the GittieLabs LLC website, www.gittie.com. On nights and weekends, Keith can be found spending time with his family, riding motorcycles with his lovely wife, watching football, and rewatching countless hours of WWDC videos.
Read more about Keith Elliott

Right arrow

Mutability and Foundation value types


One of the key concepts of the Swift language is to give developers the ability to control the mutability of their objects. We use let to make a value a constant and var to make the value a variable. However, certain types, when imported from Objective-C, do not provide easy mutability features. Swift 3 aims to change this by adding a new set of Foundation value types to wrap reference types in order to provide mutable options for developers. In fact, this really isn't all that new as Foundation already uses many value types in both Objective-C and Swift. Foundation has existing types such as primitives, Enumerations, Option sets, and C structure types that already were value types in previous versions of Swift and Objective-C.

To make the conversion from reference type to value type possible, Swift uses the copy-on-write technique for new value types whose underlying data contains more than just simple data. With copy-on-write, the value type represents...

lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Swift 3 New Features
Published in: Oct 2016Publisher: PacktISBN-13: 9781786469632

Author (1)

author image
Keith Elliott

Keith Elliott is a multitalented professional with unique business and technology experience spanning telecommunications, real estate investment banking, and capital markets. His work is driven simply by problems that need solutions, whether the problem is as simple as his wifes request for a custom to-do list or as complex as interest rate derivatives and foreign exchange hedging. He graduated with an MBA from Columbia Business School with an emphasis in entrepreneurship and an undergraduate degree from Georgia Institute of Technology with a bachelor's in computer engineering. Keith's own company, GittieLabs LLC, works with startups to provide technology solutions. His vision is to equip students with the real-life experience necessary to succeed in startup and corporate life. You can find his blog on the GittieLabs LLC website, www.gittie.com. On nights and weekends, Keith can be found spending time with his family, riding motorcycles with his lovely wife, watching football, and rewatching countless hours of WWDC videos.
Read more about Keith Elliott