Around the days of Swift 2 (over 10 years ago), I started working on a textbook teaching programming using Swift. As Swift 3 and 4 came along, I had the privilege of going back and rewriting the book as the language changed so much the old text was unusable. I sat the project aside for the day when Swift would stabilize enough so that I didn't have to redo everything when a new release appeared.
Swift 6.0 came along, and I had thought that day arrived; so I began work on the project again. Sadly, a few changes I discovered in Swift force me to go through the entire book again. Nevertheless, it has reached a point where I can put out a beta release of the book.
An Introduction to Programming Using Swift is 2,600+ pages long (PDF format). This includes 25 chapters plus 12 appendices. The beta 0.5.1 release includes proof-read versions of chapters 1-17 with the remaining chapters still in rough draft form. I'm putting this out in beta form to get feedback (particularly on the first 17 chapters, which cover the majority of the language that newcomers to Swift will want to learn).
The full scoop on the book can be found here:
https://introtoswift.randallhyde.com
You can get the beta version here:
gum road
The book is available in three formats:
PDF,
EPUB3 (Apple Books)
AZW3 (Kindle Paperwhite)
I have tried to format the output so that it is (mostly) readable on a Paperwhite, but PDF is the best format and EPUB3 is decent (AZW3 is least desirable, as the Kindle doesn't do a good job rendering EPUB).
FYI, here's the short version of the TOC (full TOC is available at introtoswift....):
An Introduction to Programming Using Swift
Brief Table of Contents
0 Preface to the Beta Edition............................................................ lx
I Introduction...................................................................................... 1
1 An Introduction to Programming Using Swift............................ 13
2 An Introduction to Computing..................................................... 63
3 An Introduction to Software Engineering................................. 103
4 Basic Data Types and Statements in Swift............................... 165
5 Decisions..................................................................................... 247
6 Repetition and Loops.................................................................. 335
7 Program Units: Functions and Closures.................................. 389
8 Top-Down Design........................................................................ 513
9 Error Handling............................................................................. 545
10 Sequences, Collections, and Ranges...................................... 579
11 Arrays......................................................................................... 611
12 Sets and Dictionaries................................................................ 687
13 Characters, Character Sets, and Strings................................ 733
14 Enumerations............................................................................ 815
15 Tuples and Structures.............................................................. 903
16 Classes....................................................................................... 991
17 Protocols, Extensions, and Generics.................................... 1157
18 Object-Oriented Programming.............................................. 1317
19 Design Patterns....................................................................... 1391
20 Protocol-Oriented Programming........................................... 1619
21 File I/O...................................................................................... 1683
22 Modular Programming in Swift.............................................. 1753
23 Dates, Times, and Measurements.......................................... 1803
24 Regular Expressions............................................................... 1865
25 Where to go From Here........................................................... 1953
A Glossary.................................................................................... 1967
B Installing Swift on Your System.............................................. 1977
C Answers to the Exercises........................................................ 1985
D Designs...................................................................................... 2015
E Standard Library Mathematical Functions............................. 2157
F Sequence and Collection Methods.......................................... 2163
G Array Reference........................................................................ 2213
H The CPU’s Hardware Stack...................................................... 2261
I Set Reference............................................................................. 2271
J Dictionary Reference................................................................ 2305
K String and CharacterSet Reference........................................ 2335
L Standard Library Protocols (Reference)................................. 2487
M The String Pattern Matching Library...................................... 2505
Index........................................................................................... 2553
I'll leave the beta version open (along with updates, as things improve) until the first edition release of the book. So participating in the beta is a good way to get this book cheap ($5).
Feedback is welcome at https://randallhyde.com/Forum/index.php (please check the registration sub-forum before trying to sign up).
Thanks for your kind consideration.
P.S. Someday, when I can navigate through the problems I'm having, I'll get the EPUB3 version up on Apple Books, too.