My Account Log in

1 option

Head First Swift.

O'Reilly Online Learning: Academic/Public Library Edition Available online

View online
Format:
Book
Author/Creator:
Buttfield-Addison, Paris.
Contributor:
Manning, Jon.
Language:
English
Subjects (All):
Swift (Computer program language).
Programming languages (Electronic computers).
Physical Description:
1 online resource (439 pages)
Edition:
1st edition.
Place of Publication:
Sebastopol : O'Reilly Media, Incorporated, 2021.
Summary:
Head First Swift Swift is a programming language you can rely on. A language you can present to the family. Safe, reliable, speedy, friendly, easy to talk to, it's the language of choice for Apple's platforms-iOS, macOS, watchOS, and tvOS. But open source Swift also runs on Linux as well as the server, and it's gaining ground in scientific computing and web apps. Swift for Windows is even in the works. You can build everything from mobile apps to games, web apps, frameworks, and beyond. So jump in and get started! What's so special about this book? If you've read a Head First book, you know what to expect-a visually rich format designed for the way your brain works. If you haven't, you're in for a treat. With this book, you'll learn Swift through a multisensory experience that engages your mind rather than a text-heavy approach that puts you to sleep.
Contents:
Cover
Head First Swift
Copyright
Authors of Head First Swift
Table of contents
How to use this book
Who is this book for?
We know what you're thinking
We know what your brain is thinking
Metacognition: thinking about thinking
Here's what WE did
Here's what YOU can do to bend your brain into submission
Read me
The technical review team
Acknowledgments
1. Introducing swift
Swift is a language for everything
The swift evolution of Swift
Swift into the future
How you're going to write Swift
The path you'll be taking
Getting Playgrounds
Creating a Playground
Using a Playground to code Swift
Basic building blocks
A Swift example
Congrats on your first steps with Swift!
2. Swift by name
Building from the blocks
Basic operators
Operating swiftly with mathematics
Expressing yourself
Names and types: peas in a pod
Not all data is numbers
Stringing things along with types
String interpolation
3. Collecting and controlling
Sorting pizzas
Swift collection types
Collecting values in an array
How big is that array, exactly? Is it empty?
Collecting values in a set
Collecting values in a dictionary
Tuples
Everyone needs a good alias
Control flow statements
if statements
switch statements
Building a switch statement
Range operators
More complex switch statements
Getting repetitive with loops
Building a for loop
Building a while loop
Building a repeat-while loop
Solving the pizza-sorting problem
Phew, that's a lot of Swift!
4. Functions and enums
Functions in Swift let you reuse code
Built-in functions
What can we learn from built-in functions?
Improving the situation with a function
Writing the body of the function
Using functions
Functions deal in values.
Many happy returns (from your functions)
A variable number of parameters
What can you pass to a function?
Every function has a type
Function types as parameter types
Multiple return types
Functions don't have to stand alone
Switching with enums
5. Closures
Meet the humble closure
Closures are better with parameters
Boiling it all down to something useful
Reducing with closures
Capturing values from the enclosing scope
Escaping closures: the contrived example
Autoclosures provide flexibility
Shorthand argument names
6. Structures, properties, and methods
Let's make a pizza, in all its glory...
The initializer behaves just like a function
Static properties make structures more flexible
Methods inside structures
Changing properties using methods
Computed properties
Getters and setters for computed properties
Implementing a setter
Swift Strings are actually structs
The case for lazy properties
Using lazy properties
7. Classes, actors, and inheritance
A struct by any other name (that name: a class)
Inheritance and classes
Overriding methods
Final classes
Automatic reference counting
Mutability
8. Protocols and extensions
The Robot Factory
Protocol inheritance
Mutating methods
Protocol types and collections
Computed properties in extensions
Extending a protocol
Useful protocols and you
Conforming to Swift's protocols
9. Optionals, unwrapping, generics, and more
Dealing with something that's missing
Why you might need an optional
Optionals and handling missing data
Unwrapping optionals
Unwrapping optionals with guard
Force unwrapping
Generics
A queue with generics
Here's our new Queue type
10. Getting started with SwiftUI
What's a UI framework, anyway?
Your first SwiftUI UI.
UI building blocks
Making a list, checking it…quite a few times, to get it perfect
User interfaces with state
Buttons are for pressing
Let's see how far you've come
Create a new SwiftUI Xcode project, for iOS
Your Xcode will look something like this
Create a new type to store a todo item in
Make sure each todo item can be uniquely identified
Create a user interface for the app
Implement a way to save the list of todos
So, that's a UI framework?
11. Putting swiftUI into practice
What fancy things can be done with a UI framework?
The Executive Timer UI and features
Creating the basic elements of the app
Pieces of the UI
Setting up the UI of the Executive Timer
Coding the pieces of the UI
Combining the three elements
The finishing touches
Tabbed views for a clean UI
Build a TabView containing your views
Creating a new tabbed ContentView
Creating the tabs and the TabView
Running your new tabbed Executive Timer
12. Apps, web, and beyond
A journey must end...
A recipe for a welcome screen
Step by step assembly of the welcome screen
Share the state
It's time for our old friend...
Building an app with multiple views that share state
Building a two-view score tracker
The ObservableObject
The first view
The second view
The first view, again
A fancy AsyncImage
Meet Vapor, the Swift web framework
Sending data over the web with Vapor
Index.
Notes:
Description based on publisher supplied metadata and other sources.
ISBN:
9781491923207
1491923202
9781491923214
1491923210
9781491923184
1491923180
OCLC:
1290021561
Publisher Number:
9781491923184

The Penn Libraries is committed to describing library materials using current, accurate, and responsible language. If you discover outdated or inaccurate language, please fill out this feedback form to report it and suggest alternative language.

My Account

Shelf Request an item Bookmarks Fines and fees Settings

Guides

Using the Library Catalog Using Articles+ Library Account