Learning Swift 1st Edition Wagner download
Learning Swift 1st Edition Wagner download
https://ebookname.com/product/learning-swift-1st-edition-wagner/
https://ebookname.com/product/friedelind-wagner-richard-wagner-s-
rebellious-granddaughter-1st-edition-eva-rieger/
https://ebookname.com/product/correspondence-of-wagner-and-liszt-
volume-2-1st-edition-richard-wagner/
https://ebookname.com/product/swift-s-irish-writings-selected-
prose-and-poetry-1st-ed-edition-jonathan-swift/
https://ebookname.com/product/this-must-be-love-first-edition-
sutherland/
Model Predictive Control of Wind Energy Conversion
Systems 1st Edition Venkata Yaramasu
https://ebookname.com/product/model-predictive-control-of-wind-
energy-conversion-systems-1st-edition-venkata-yaramasu/
https://ebookname.com/product/r-in-a-nutshell-1st-edition-joseph-
adler/
https://ebookname.com/product/transitions-of-lithuanian-
postmodernism-lithuanian-literature-in-the-post-soviet-
period-1st-edition-mindaugas-kvietkauskas/
https://ebookname.com/product/bread-making-improving-quality-1st-
edition-stanley-p-cauvain/
https://ebookname.com/product/european-union-constitutionalism-
in-crisis-1st-edition-nicole-scicluna/
The Valuation of Financial Companies Tools and
Techniques to Measure the Value of Banks Insurance
Companies and Other Financial Institutions 1st Edition
Mario Massari
https://ebookname.com/product/the-valuation-of-financial-
companies-tools-and-techniques-to-measure-the-value-of-banks-
insurance-companies-and-other-financial-institutions-1st-edition-
mario-massari/
Learning Swift
Table of Contents
Learning Swift
Credits
About the Author
About the Reviewer
www.PacktPub.com
Support files, eBooks, discount offers, and more
Why subscribe?
Free access for Packt account holders
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Downloading the example code
Errata
Piracy
Questions
1. Introducing Swift
Defining our goals for this book
Setting up the development environment
Running our first Swift code
Understanding playgrounds
Learning with this book
Summary
2. Building Blocks – Variables, Collections, and Flow Control
Core Swift types
Constants and variables
Containers
Tuples
Arrays
Dictionaries
Swift's type system
Printing on the console
Control flow
Conditionals
Switches
Loops
Functions
Basic functions
Parameterized functions
Functions that return values
Functions with default arguments
Bringing it all together
Summary
3. One Piece at a Time – Types, Scopes, and Projects
Structs
Types versus instances
Properties
Member and static methods
Computed properties
Reacting to property changes
Subscripts
Custom initialization
Classes
Inheriting from another class
Initialization
Overriding initializers
Required initializers
Designated and convenience initializers
Overriding methods and computed properties
Methods
Computed properties
Casting
Upcasting
Downcasting
Enumerations
Basic declaration
Testing enumeration values
Raw values
Associated values
Methods and properties
Projects
Setting up a command-line Xcode project
Creating and using an external file
Interfacing with code from other files
File organization and navigation
Extensions
Scope
How is scope defined
Nested types
Access control
Summary
4. To Be or Not to Be – Optionals
Introducing optionals
Unwrapping an optional
Optional binding
Forced unwrapping
Nil coalescing
Optional chaining
Implicitly unwrapped optionals
Debugging optionals
The underlying implementation
Summary
5. A Modern Paradigm – Closures and Functional Programming
Functional programming philosophy
State and side effects
Declarative versus imperative code
Closures
Closures as variables
Closures as parameters
Syntactic sugar
Building blocks of functional programming in Swift
The filter function
The reduce function
The map function
The sorted function
How these affect the state and nature of code
Lazy evaluation
Curried functions
Summary
6. Make Swift Work for You – Protocols and Generics
Protocols
Defining a protocol
Implementing a protocol
Using type aliases
Defining a generic
The generic function
The generic type
Type constraints
Protocol constraints
Where clauses for protocols
Where clauses for equality
Extending the existing generics
Enhancing arrays
Enhancing dictionaries
Putting protocols and generics to use
Generators
Sequences
Product of Fibonacci numbers under 50
Summary
7. Everything is Connected – Memory Management
How data is stored in a computer
Filesystem
Memory
Value types versus reference types
Determining a value or reference type
Behavior on assignment
Behavior on input
Capturing behavior of closure
Automatic reference counting
Object relationships
Strong relationships
Weak relationships
Unowned relationships
Strong reference cycles
Strong reference cycles between objects
Spotting
Fixing the cycles
With closures
Spotting
Fixing
Lost objects
Between objects
With closures
Summary
8. Writing Code the Swift Way – Design Patterns and Techniques
What is a design pattern?
Behavioral patterns
The iterator pattern
The observer pattern
The callback property
The notification center
Structural patterns
The composite pattern
Hierarchies
An alternative to subclassing
The delegate pattern
Model-View-Controller
Creational patterns
A singleton/shared instance
The abstract factory pattern
Using associated values effectively
Replacing class hierarchies
Concisely representing a state
Extending system types to reduce code
Lazy properties
Avoiding unnecessary memory usage
Avoiding unnecessary processing
Localizing logic to the concerned property
Summary
9. Harnessing the Past – Understanding and Translating Objective-C
Swift's relationship with Objective-C
The history of Objective-C
Constants and variables
Value types
Reference types
Containers
Arrays
Dictionaries
Control flow
Conditionals
Switches
Loops
Functions
Types
Structures
Enumerations
Classes
The basic class
Initializers
Properties
Methods
Inheritance
Categories
Protocols
Blocks
Projects
Header files
An implementation file
Organization
Calling Objective-C code from Swift
A bridging header
Using functions
Using types
Containers
Reference type translation
Summary
10. A Whole New World – Developing an App
Conceptualizing the app
Features
The interface
Data
Setting up the app project
Configuring the user interface
Running the app
Allowing picture taking
Temporarily saving a photo
Populating our photo grid
Refactoring to respect Model-View-Controller
Permanently saving a photo
Summary
11. What's Next? Resources, Advice, and Next Steps
Apple's documentation
Forums and blogs
Blog posts
Forums
Prominent figures
Podcasts
Summary
Index
Learning Swift
Learning Swift
Copyright © 2015 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval
system, or transmitted in any form or by any means, without the prior written permission
of the publisher, except in the case of brief quotations embedded in critical articles or
reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the
information presented. However, the information contained in this book is sold without
warranty, either express or implied. Neither the author, nor Packt Publishing, and its
dealers and distributors will be held liable for any damages caused or alleged to be
caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the
companies and products mentioned in this book by the appropriate use of capitals.
However, Packt Publishing cannot guarantee the accuracy of this information.
Livery Place
35 Livery Street
ISBN 978-1-78439-250-5
www.packtpub.com
Credits
Author
Andrew J Wagner
Reviewers
Giordano Scalzo
Cory Bohon
Commissioning Editor
Sarah Crofton
Acquisition Editors
Vivek Anantharaman
Richard Brookes-Bland
Kirti Patil
Technical Editor
Mrunmayee Patil
Copy Editors
Pranjali Chury
Neha Vyas
Project Coordinator
Nidhi Joshi
Proofreader
Safis Editing
Indexer
Mariammal Chettiyar
Graphics
Disha Haria
Production Coordinator
Nilesh R. Mohite
Cover Work
Nilesh R. Mohite
About the Author
Andrew J Wagner is an independent software developer who concentrates on iOS
development and backend web services and has a degree in computer engineering from
Rensselaer Polytechnic Institute, New York. He has also been developing his own iOS
apps through his company, Learn Brigade LLC, since 2008 and has experience working
with and for large-scale companies and small-scale companies. He is passionate about
using computers as a creative outlet and writing software that is beautiful in
implementation, functionality, and experience.
About the Reviewer
Giordano Scalzo has been a developer since the days of the ZX Spectrum.
He worked with C++, Java, .NET, Ruby, Python, and a ton of other languages he has
forgotten the names of. After years of backend development and a hiatus from the
technical side when he worked as a project manager, he is currently a freelancer in
London where, through his company, Effective Code Ltd, he delivers code for iOS
aiming at quality and reliability.
In his spare time, when he is not crafting retro game clones for iOS, he writes his
thoughts on his blog at http://giordanoscalzo.com.
I'd like to thank my better half, Valentina, who lovingly supports me in everything I do—
without you, none of this would have been possible.
I would also like to thank my children, Mattia and Luca, who are my future and have
given me lots of smiles and hugs when I needed them.
www.PacktPub.com
Support files, eBooks, discount offers,
and more
For support files and downloads related to your book, please visit www.PacktPub.com.
Did you know that Packt offers eBook versions of every book published, with PDF and
ePub files available? You can upgrade to the eBook version at www.PacktPub.com and
as a print book customer, you are entitled to a discount on the eBook copy. Get in touch
with us at <[email protected]> for more details.
At www.PacktPub.com, you can also read a collection of free technical articles, sign up
for a range of free newsletters and receive exclusive discounts and offers on Packt
books and eBooks.
https://www2.packtpub.com/books/subscription/packtlib
Do you need instant solutions to your IT questions? PacktLib is Packt's online digital
book library. Here, you can search, access, and read Packt's entire library of books.
Why subscribe?
Fully searchable across every book published by Packt
Copy and paste, print, and bookmark content
On demand and accessible via a web browser
Free access for Packt account holders
If you have an account with Packt at www.PacktPub.com, you can use this to access
PacktLib today and view 9 entirely free books. Simply use your login credentials for
immediate access.
Preface
This book will help you get started with Swift in no time. It will help you to understand
the nuances of iOS programming not only from a conceptual point of view, but also from
an implementation perspective. This book is an invaluable resource if you are looking
forward to a dive deep into the world of iOS application programming.
What this book covers
Chapter 1, Introducing Swift, takes you through the process of installing Swift and
running your first Swift program to expose its power right away.
Chapter 3, One Piece at a Time – Types, Scopes, and Projects, introduces the tools
necessary to more closely model the real world with code. It will teach you to define
your own custom types using structures, classes, and enumerations. It also explores the
concept of scope and access control.
Chapter 6, Make Swift Work for You – Protocols and Generics, describes what generic
protocols are and how they can provide power and safety at the same time.
Chapter 8, Writing Code the Swift Way – Design Patterns and Techniques, introduces
you to the art of programming by taking you through a number of specific design patterns
that help reduce the complexity of code.
Chapter 11, What's Next? Resources, Advice, and Next Steps, discusses how to move
forward to become the best app developer you possibly can. It will also provide you
with a list of resources you can use to continue your Swift and app development
learning process.
What you need for this book
The only thing that you need for this book is Xcode 6.3.
Who this book is for
If you are looking to build iOS or OS X apps using the most modern technology, this
book is ideal for you. Learning Swift will place you in a small developer community
that will explode in demand as the development of apps for Apple's platforms
transitions to it. You will find this book especially useful if you are new to
programming or if you are yet to develop an app for iOS or OS X.
Conventions
In this book, you will find a number of text styles that distinguish between different
kinds of information. Here are some examples of these styles and an explanation of their
meaning.
Code words in text, database table names, folder names, filenames, file extensions,
pathnames, dummy URLs, user input, and Twitter handles are shown as follows: "It
stores the text "Something Else" into a new variable called str."
New terms and important words are shown in bold. Words that you see on the screen,
for example, in menus or dialog boxes, appear in the text like this: "To view the
console, you can go to View | Assistant Editor | Assistant Editor."
Note
Warnings or important notes appear in a box like this.
Tip
Tips and tricks appear like this.
Another Random Document on
Scribd Without Any Related Topics
CONFERENCE,
MARCUS AURELIUS.
CONFERENCE AT THE ROYAL INSTITUTION.
MARCUS AURELIUS.
Ladies and Gentlemen,—I have accepted with great pleasure the
invitation to address you in this illustrious institution devoted to the
noblest researches of science and of true philosophy. I have
dreamed since my childhood of this island, where I have so many
friends, and which I visit so tardily.
I am a Briton of France. In our old books, England is always called
the Island of the Saints; and, in truth, all our saints of Armorican
Brittany, those saints of doubtful orthodoxy, who, if they were again
alive, would be more in harmony with us than with the Jesuits, came
from the Island of Britain. I have seen in their chapel the trough of
stone in which they crossed the sea. Of all races, the Britain race is
that which has ever taken religion the most seriously. Even when the
progress of reflection has shown us that some articles among the
catalogues of things which we have always regarded as fixed should
be modified, we never break away from the symbol under which we
have from the first approved the ideal.
For our faith is not contained in obscure metaphysical propositions: it
is in the affirmations of the heart. I have therefore chosen for my
discourse to you, not one of those subtleties which divide, but one of
those themes, dear to the soul, which bring nearer, and reconcile. I
shall speak to you of that book resplendent with the divine spirit,
that manual of submissive life which the most godly of men has left
us,—the Cæsar, Marcus Aurelius Antonine. It is the glory of
sovereigns that the most irreproachable model of virtue may be
found in their ranks, and that the most beautiful lessons of patience
and of self-control may come from a condition which one naturally
believes to be subject to all the seductions of pleasure and of vanity.
I.
The inheritance of wisdom with a throne is always rare: I find in
history but two striking examples of it,—in India, the succession of
the three Mongol emperors, Bâber, Hoomâyoon, and Akbar; at
Rome, at the head of the greatest empire that ever existed, the two
admirable reigns of Antonine the Pious and Marcus Aurelius. Of the
last two, I consider Antonine the greatest. His goodness did not lead
him into faults: he was not tormented with that internal trouble
which disturbed without ceasing the heart of his adopted son. This
strange malady, this restless study of himself, this demon of
scrupulousness, this fever of perfection, are signs of a less strong
and distinguished nature. As the finest thoughts are those which are
not written, Antonine had in this respect also a superiority over
Marcus Aurelius. But let us add that we should be ignorant of
Antonine, if Marcus Aurelius had not transmitted to us that exquisite
portrait of his adopted father, in which he seems to have applied
himself, through humility, to painting the picture of a better man
than himself.
It is he who has sketched in the first book of his "Thoughts,"—that
admirable background where the noble and pure forms of his father,
mother, grandfather, and tutors, move in a celestial light. Thanks to
Marcus Aurelius, we are able to understand how these old Roman
families, who had seen the reign of the wicked emperors, still
retained honesty, dignity, justice, the civil, and, if I may dare to say
it, the republican spirit. They lived there in admiration of Cato, of
Brutus, of Thrasea, and of the great stoics whose souls had never
bowed under tyranny. The reign of Domitian was abhorred by them.
The sages who had endured it without submission were honored as
heroes. The accession of the Antonines was only the coming to
power of the society of sages, of whose just anger Tacitus has
informed us,—a society of wise men formed by the league of all
those who had revolted against the despotism of the first Cæsars.
The salutary principle of adoption made the imperial court of the
second century a true cradle of virtue. The noble and learned Nerva,
in establishing this principle, assured the happiness of the human
race during almost a hundred years, and gave to the world the best
century of progress of which any knowledge has been preserved.
The sovereignty thus possessed in common by a group of choice
men who delegated it or shared it, according to the needs of the
moment, lost a part of that attraction which renders it so dangerous.
Men came to the throne without seeking it, but also without the
right of birth, or in any sense the divine right: men came there
understanding themselves, experienced, having been long prepared.
The empire was a civil burden which each accepted in his turn,
without dreaming of hastening the hour. Marcus Aurelius was made
emperor so young, that the idea of ruling had scarcely occurred to
him, and had not for a moment exercised its charm upon his mind.
At eight years, when he was already præsul of the Salian priests,
Hadrian remarked this sad child, and loved him for his good-nature,
his docility, and his incapability of falsehood. At eighteen years the
empire was assured to him. He awaited it patiently for twenty-two
years. The evening when Antonine, feeling himself about to die,
after having given to the tribune the watchword, Æquanimitas,
commanded the golden statue of Fortune, which was always in the
apartment of the emperor, to be borne into that of his adopted son,
he experienced neither surprise nor joy.
He had long been sated with all joys, without having tasted them:
he had seen the absolute vanity of them by the profoundness of his
philosophy.
The great inconvenience of practical life, and that which renders it
insupportable to a superior man, is, that, if one carries into it the
principles of the ideal, talents become defects; so that very often the
accomplished man is less successful in it than one who is fitted by
egotism or ordinary routine. Three or four times the virtue of Marcus
Aurelius came near being his ruin. The first fault into which it led
him was that of sharing the empire with Lucius Verus, to whom he
was under no obligation. Verus was a frivolous and worthless man.
Prodigies of goodness and delicacy were necessary in order to
prevent his committing disastrous follies. The wise emperor, earnest
and industrious, took with him in his lectica (sedan) the senseless
colleague whom he had given himself. He persisted in treating him
seriously: he never once revolted against this sorry companionship.
Like all well-bred men, Marcus Aurelius discommoded himself
continually: his manners came from a general habit of firmness and
dignity. Souls of this kind, either from respect for human nature, or
in order not to wound others, resign themselves to the appearance
of seeing no evil. Their life is a perpetual dissimulation.
According to some, he even deceived himself, since, in his intimate
intercourse with the gods, on the borders of the Granicus, speaking
of his unworthy wife, he thanked them for having given him a wife
"so amiable, so affectionate, so pure." I have shown elsewhere that
the patience, or, if one chooses, the weakness, on this point, of
Marcus Aurelius, has been somewhat exaggerated. Faustina had
faults: the greatest one was that she disliked the friends of her
husband; and, as these friends wrote history, she has paid the
penalty before posterity. But a discriminating critic has no trouble in
showing the exaggerations of the legend. Every thing indicates that
Faustina at first found happiness and love in that villa at Lorium, or
in that beautiful retreat at Lanuvium upon the highest points of the
Alban mount, which Marcus Aurelius described to his tutor Fronto as
an abode full of the purest joys. Then she became weary of too
much wisdom. Let us tell all: the beautiful sentences of Marcus
Aurelius, his austere virtue, his perpetual melancholy, might have
become tiresome to a young and capricious woman possessed of an
ardent temperament and marvellous beauty. He understood it,
suffered it, and spoke not. Faustina remained always his "very good
and very faithful wife." No one succeeded, even after her death, in
persuading him to give up this pious lie. In a bas-relief which is still
seen in the Museum of the Capitol at Rome, while Faustina is borne
to heaven by a messenger of the gods, the excellent emperor
regards her with a look full of love. It seems that at last he had
deceived himself, and forgotten all. But through what a struggle he
must have passed in order to do this! During long years, a sickness
at heart slowly consumed him. The desperate effort which was the
essence of his philosophy, this frenzy of renunciation, carried
sometimes even to sophism, concealed an immense wound at the
bottom. How necessary it must have been to bid adieu to happiness
in order to reach such an excess! No one will ever understand all
that this poor wounded heart suffered, the bitterness which that pale
face concealed, always calm, always smiling. It is true that the
farewell to happiness is the beginning of wisdom and the surest
means of finding peace. There is nothing so sweet as the return of
joy which follows the renunciation of joy; nothing so keen, so
profound, so charming, as the enchantment of the disenchanted.
Some historians, more or less imbued with that policy which believes
itself to be superior, because it is not suspected of any philosophy,
have naturally sought to prove that so accomplished a man was a
bad administrator and a mediocre sovereign. It appears, in fact, that
Marcus Aurelius sinned more than once by too much lenity. But
never was there a reign more fruitful in reforms and progress. The
public charity founded by Nerva and Trajan was admirably developed
by him. New schools were established for poor children; the
superintendents of provisions became functionaries of the first rank,
and were chosen with extreme care; while the wants of poor young
girls were cared for by the Institute of Jeunes Faustiniennes. The
principle that the state has duties in some degree paternal towards
its members (a principle which should be remembered with
gratitude, even when it has been dispensed with),—this principle, I
say, was proclaimed for the first time in the world by Trajan and his
successors. Neither the puerile pomp of Oriental kingdoms, founded
on the baseness and stupidity of men, nor the pedantic pride of the
kingdoms of the middle ages, founded on an exaggerated sentiment
for hereditary succession, and on a simple faith in the rights of
blood, could give an idea of the utterly republican sovereignty of
Nerva, Trajan, Hadrian, Antonine, and Marcus Aurelius.
Nothing of the prince by hereditary or divine right, nothing of the
military chieftain: it was a sort of grand civil magistracy, without
resembling a court in any way, or depriving the emperor of his
private character. Marcus Aurelius, in particular, was neither much
nor little a king in the true sense of the word. His fortune was
immense, but all employed for good: his aversion for "the Cæsars,"
whom he considered as a species of Sardanapali, magnificent,
debauched, and cruel, burst out at each instant. The civility of his
manners was extreme. He gave to the Senate all its ancient
importance: when he was at Rome, he never missed a session, and
left his place only when the Consul had pronounced the formula,
"Nihil vos moramar, patres conscripti." Almost every year of his reign
he made war, and he made it well, although he found in it only
ennui. His listless campaigns against the Quadi and Marcomanni
were very well conducted: the disgust which he felt for them did not
prevent his most conscientious attention to them. It was in the
course of one of these expeditions, that, encamped on the banks of
the Granicus, in the midst of the monotonous plains of Hungary, he
wrote the most beautiful pages of the exquisite book which has
revealed his whole soul to us. It is probable, that, when very young,
he kept a journal of his secret thoughts. He inscribed there the
maxims to which he had recourse in order to fortify himself, the
reminiscences of his favorite authors, the passages of the moralists
which appealed most to him, the principles which had sustained him
through the day, sometimes the reproaches which his scrupulous
conscience addressed to him. "One seeks for himself solitary
retreats, rustic cottages, sea-shore, or mountains: like others, thou
lovest to dream of these good things. To what end, since it is
permitted to thee to retire within thy soul each hour? Man has
nowhere a more tranquil retreat, above all, if he has within himself
those things, the contemplation of which will calm him. Learn, then,
how to enjoy this retreat, and there renew thy strength. Let there be
those short fundamental maxims, which above all will give again
serenity to thy soul, and restore thee to a state in which to support
with resignation the world to which thou shouldest return."
During the sad winters of the North, this consolation became still
more necessary to him. He was nearly sixty years old: old age was
premature with him. One evening all the pictures of his pious youth
returned to his remembrance, and he passed some delicious hours in
calculating how much he owed to each one of the virtuous beings
who had surrounded him.
"Examples of my grandfather Verus,—sweetness of manners,
unchangeable patience."
"Qualities which one valued in my father, the souvenir which he has
left me,—modesty, manly character."
"To imitate the piety of my mother, her benevolence; to abstain, like
her, not only from doing evil, but from conceiving the thought of it;
to lead her frugal life, which so little resembled the habitual luxury of
the rich."
Then appeared to him, in turn, Diagnotus, who had inspired him
with a taste for philosophy, and made agreeable to his eyes the
pallet, the covering made of a simple skin, and all the apparel of
Hellenic discipline; Junius Rusticus, who taught him to avoid all
affectation of elegance in style, and loaned him the Conversations of
Epictetus; Apollonius of Chalcis, who realized the Stoic ideal of
extreme firmness and perfect sweetness; Sextus of Chaeroneia, so
grave and so good; Alexander the grammarian, who censured with
such refined politeness; Fronto, "who taught him the envy, duplicity,
and hypocrisy of a tyrant, and the hardness which may exist in the
heart of a patrician;" his brother Severus, "who made him
understand Thrasia, Helvidius, Cato, Brutus, who gave him the idea
of what a free government is, where the rule is the natural equality
of the citizens and the equality of their rights; of a royalty which
places before all else the respect for the liberty of the citizens;" and,
rising above all others in his immaculate grandeur, Antonine, his
father by adoption, whose picture he traces for us with redoubled
gratitude and love. "I thank the gods," said he finally, "for having
given me good ancestors, good parents, a good sister, good
teachers, and in my surroundings, in my relations, in my friends,
men almost all filled with goodness. I never allowed myself to be
wanting in deference towards them: from my natural disposition, I
could sometimes have shown irreverence; but the benevolence of
the gods never permitted the occasion to present itself. I am also
indebted to the gods, who preserved pure the flower of my youth,
for having been reared under the rule of a prince, and a father who
strove to free my soul from all trace of pride, to make me
understand that it is possible, while living in a palace, to dispense
with guards, with splendid clothes, with torches, with statues, to
teach me, in short, that a prince can almost contract his life within
the limits of that of a simple citizen, without, on that account,
showing less nobility and vigor when he comes to be an emperor,
and transact the affairs of state. They gave me a brother, whose
manners were a continual exhortation to watch over myself, while
his deference and attachment should have made the joy of my
heart.
"Thanks to the gods again, that I have made haste to raise those
who have cared for my education, to the honors which they seemed
to desire. They have enabled me to understand Apollonius, Rusticus,
Maximus, and have held out to me, surrounded with brilliant light,
the picture of a life conformed to nature. I have fallen short of it in
the end, it is true; but it is my fault. If my body has long supported
the rude life which I lead; if, in spite of my frequent neglect of
Rusticus, I have never overstepped the bounds, or done any thing of
which I should repent; if my mother, who died young, was able,
nevertheless, to pass her last years near me; if, whenever I have
wished to succor the poor or afflicted, money has never been
wanting; if I have never needed to accept any thing from others; if I
have a wife of an amiable, affectionate, and pure character; if I have
found many capable men for the education of my children; if, at the
beginning of my passion for philosophy, I did not become the prey of
a sophist,—it is to the gods that I owe it all. Yes, so many blessings
could only be the result of the aid of the gods and a happy fortune."
This divine candor breathes in every page. No one has ever written
more simply than did he for the sole purpose of unburdening his
heart to God, his only witness. There is not a shadow of system in it.
Marcus Aurelius, to speak exactly, had no philosophy: although he
owed almost every thing to stoicism transformed by the Roman
spirit, it is of no school. According to our idea, he has too little
curiosity; for he knows not all that a contemporary of Ptolemy and
Galen should know: he has some opinions on the system of the
world, which were not up to the highest science of his time. But his
moral thought, thus detached from all alliance with a system,
reaches a singular height. The author of the book, "The Imitation,"
himself, although free from the quarrels of the schools, does not rise
to this, for his manner of feeling is essentially Christian. Take away
his Christian dogmas, and his book retains only a portion of its
charm. The book of Marcus Aurelius, having no dogmatic base,
preserves its freshness eternally. Every one, from the atheist, or he
who believes himself one, to the man who is the most devoted to
the especial creeds of each worship, can find in it some fruits of
edification. It is the most purely human book which exists. It deals
with no question of controversy. In theology, Marcus Aurelius floats
between pure Deism, Polytheism interpreted in a physical sense
according to the manner of the Stoics, and a sort of cosmic
Pantheism. He holds not much more firmly to one hypothesis than to
the other, and he uses indiscriminately the three vocabularies of the
Deist, Polytheist, and Pantheist. His considerations have always two
sides, according as God and the soul have, or have not, reality. It is
the reasoning which we do each hour; for, if the most complete
Materialism is right, we who have believed in truth and goodness
shall be no more duped than others. If Idealism is right, we have
been the true sages, and we have been wise in the only manner
which becomes us, that is to say, with no selfish waiting, without
having looked for a remuneration.
II.
Updated editions will replace the previous one—the old editions will
be renamed.
1.D. The copyright laws of the place where you are located also
govern what you can do with this work. Copyright laws in most
countries are in a constant state of change. If you are outside the
United States, check the laws of your country in addition to the
terms of this agreement before downloading, copying, displaying,
performing, distributing or creating derivative works based on this
work or any other Project Gutenberg™ work. The Foundation makes
no representations concerning the copyright status of any work in
any country other than the United States.
1.E.6. You may convert to and distribute this work in any binary,
compressed, marked up, nonproprietary or proprietary form,
including any word processing or hypertext form. However, if you
provide access to or distribute copies of a Project Gutenberg™ work
in a format other than “Plain Vanilla ASCII” or other format used in
the official version posted on the official Project Gutenberg™ website
(www.gutenberg.org), you must, at no additional cost, fee or
expense to the user, provide a copy, a means of exporting a copy, or
a means of obtaining a copy upon request, of the work in its original
“Plain Vanilla ASCII” or other form. Any alternate format must
include the full Project Gutenberg™ License as specified in
paragraph 1.E.1.
• You pay a royalty fee of 20% of the gross profits you derive
from the use of Project Gutenberg™ works calculated using the
method you already use to calculate your applicable taxes. The
fee is owed to the owner of the Project Gutenberg™ trademark,
but he has agreed to donate royalties under this paragraph to
the Project Gutenberg Literary Archive Foundation. Royalty
payments must be paid within 60 days following each date on
which you prepare (or are legally required to prepare) your
periodic tax returns. Royalty payments should be clearly marked
as such and sent to the Project Gutenberg Literary Archive
Foundation at the address specified in Section 4, “Information
about donations to the Project Gutenberg Literary Archive
Foundation.”
• You comply with all other terms of this agreement for free
distribution of Project Gutenberg™ works.
1.F.
1.F.4. Except for the limited right of replacement or refund set forth
in paragraph 1.F.3, this work is provided to you ‘AS-IS’, WITH NO
OTHER WARRANTIES OF ANY KIND, EXPRESS OR IMPLIED,
INCLUDING BUT NOT LIMITED TO WARRANTIES OF
MERCHANTABILITY OR FITNESS FOR ANY PURPOSE.
Please check the Project Gutenberg web pages for current donation
methods and addresses. Donations are accepted in a number of
other ways including checks, online payments and credit card
donations. To donate, please visit: www.gutenberg.org/donate.
Most people start at our website which has the main PG search
facility: www.gutenberg.org.
Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.
ebookname.com