Swift Essentials Second Edition DR Alex Blewitt Blewitt DR Alex Download
Swift Essentials Second Edition DR Alex Blewitt Blewitt DR Alex Download
https://ebookbell.com/product/swift-essentials-second-edition-dr-
alex-blewitt-blewitt-dr-alex-22533224
https://ebookbell.com/product/swift-essentials-second-edition-2nd-
edition-dr-alex-blewitt-55239792
https://ebookbell.com/product/swift-essentials-second-edition-dr-alex-
blewitt-22533206
https://ebookbell.com/product/swift-essentials-second-edition-dr-alex-
blewitt-blewitt-dr-alex-22533210
https://ebookbell.com/product/swift-essentials-alex-blewitt-4984984
Openstack Object Storage Swift Essentials Amar Kapadia Kris Rajana
https://ebookbell.com/product/openstack-object-storage-swift-
essentials-amar-kapadia-kris-rajana-6809398
https://ebookbell.com/product/swiftui-essentials-ios-16-edition-learn-
to-develop-ios-apps-using-swiftui-swift-and-xcode-14-1st-edition-neil-
smyth-49040096
Swiftui Essentials Ios Edition Learn To Develop Ios Apps Using Swiftui
Swift 5 And Xcode 11 Neil Smyth
https://ebookbell.com/product/swiftui-essentials-ios-edition-learn-to-
develop-ios-apps-using-swiftui-swift-5-and-xcode-11-neil-
smyth-52009816
https://ebookbell.com/product/ios-12-app-development-essentials-learn-
to-develop-ios-12-apps-with-xcode-10-and-swift-4-paperback-neil-
smyth-10473082
https://ebookbell.com/product/ios-9-app-development-essentials-learn-
to-develop-ios-9-apps-using-xcode-7-and-swift-2-1st-edition-neil-
smyth-6769012
Swift Essentials Second Edition
Table of Contents
Swift Essentials Second Edition
Credits
About the Author
Acknowledgments
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
Trademarks
Conventions
Reader feedback
Customer support
Downloading the example code
Errata
Piracy
Questions
1. Exploring Swift
Open source Swift
Getting started with Swift
Numeric literals
Floating point literals
String literals
Variables and constants
Collection types
Optional types
Nil coalescing operator
Conditional logic
If statements
Switch statements
Iteration
Iterating over keys and values in a dictionary
Iteration with for loops
Break and continue
Functions
Named arguments
Optional arguments and default values
Guards
Multiple return values and arguments
Returning structured values
Error handling
Throwing errors
Catching errors
Cleaning up after errors
Command-line Swift
Interpreted Swift scripts
Compiled Swift scripts
Summary
2. Playing with Swift
Getting started with playgrounds
Creating a playground
Viewing the console output
Viewing the timeline
Displaying objects with Quick Look
Showing colored labels
Showing images
Advanced techniques
Capturing values explicitly
Running asynchronous code
Playgrounds and documentation
Learning with playgrounds
Understanding the playground format
Adding a page
Documenting code
Playground navigation documentation
Text formatting
Symbol documentation
Limitations of playgrounds
Summary
3. Creating an iOS Swift App
Understanding iOS applications
Creating a single-view iOS application
Removing the storyboard
Setting up the view controller
Swift classes, protocols, and enums
Classes in Swift
Subclasses and testing in Swift
Protocols in Swift
Enums in Swift
Raw values
Associated values
Creating a master-detail iOS application
The AppDelegate class
The MasterViewController class
The DetailViewController class
Summary
4. Storyboard Applications with Swift and iOS
Storyboards, scenes, and segues
Creating a storyboard project
Scenes and view controllers
Adding views to the scene
Segues
Adding a navigation controller
Naming scenes and views
Swift and storyboards
Custom view controllers
Connecting views to outlets in Swift
Calling actions from interface builder
Triggering a segue with code
Passing data with segues
Using Auto Layout
Understanding constraints
Adding constraints
Adding a constraint with drag and drop
Adding constraints to the Press Me scene
Adding missing constraints
Summary
5. Creating Custom Views in Swift
An overview of UIView
Creating new views with Interface Builder
Creating a table view controller
Showing data in the table
Defining a view in a xib file
Wiring a custom view class
Dealing with intrinsic size
Creating new views by subclassing UIView
Auto Layout and custom views
Constraints and the visual format language
Adding the custom view to the table
Custom graphics with drawRect
Drawing graphics in drawRect
Responding to orientation changes
Custom graphics with layers
Creating a ProgressView from layers
Adding the stop square
Adding a progress bar
Clipping the view
Testing views in Xcode
Responding to change
Summary
6. Parsing Networked Data
Loading data from URLs
Dealing with errors
Dealing with missing content
Nested if and switch statements
Networking and user interfaces
Running functions on the main thread
Parsing JSON
Handling errors
Parsing XML
Creating a parser delegate
Downloading the data
Parsing the data
Direct network connections
Opening a stream-based connection
Synchronous reading and writing
Writing data to NSOutputStream
Reading from an NSInputStream
Reading and writing hexadecimal and UTF8 data
Implementing the Git protocol
Listing git references remotely
Integrating the network call into the UI
Asynchronous reading and writing
Reading data asynchronously from an NSInputStream
Creating a stream delegate
Dealing with errors
Listing references asynchronously
Displaying asynchronous references in the UI
Writing data asynchronously to an NSOutputStream
Summary
7. Building a Repository Browser
An overview of the GitHub API
Root endpoint
User resource
Repositories resource
Repository browser project
URI templates
Background threading
Parsing JSON dictionaries
Parsing JSON arrays of dictionaries
Creating the client
Talking to the GitHub API
Returning repositories for a user
Accessing data through the AppDelegate
Accessing repositories from view controllers
Adding users
Implementing the detail view
Transitioning between the master and detail views
Loading the user’s avatar
Displaying the user’s avatar
Summary
8. Adding Watch Support
Watch applications
Adding a watch target
Adding the GitHubAPI to the watch target
Creating watch interfaces
Adding a list of users to the watch
Wiring up the interface
Adding an image
Responding to user interaction
Adding context and showing repositories
Adding a detail screen
Populating the detail screen
Best practice for watch applications
UI thread considerations
Stored data
Appropriate use of complications and glances
Summary
A. References to Swift-related Websites, Blogs, and Notable Twitter Users
Language
Twitter users
Blogs and tutorial sites
Meetups
Afterword
Index
Swift Essentials Second Edition
Swift Essentials Second Edition
Copyright © 2016 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.
First published: December 2014
Second Edition: January 2016
Production reference: 1200116
Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham B3 2PB, UK.
ISBN 978-1-78588-887-8
www.packtpub.com
Credits
Author
Dr Alex Blewitt
Reviewer
Antonio Bello
Commissioning Editor
Kartikey Pandey
Acquisition Editor
Denim Pinto
Content Development Editor
Preeti Singh
Technical Editor
Siddhesh Patil
Copy Editor
Priyanka Ravi
Project Coordinator
Milton D’souza
Proofreader
Safis Editing
Indexer
Hemangini Bari
Graphics
Disha Haria
Production Coordinator
Arvindkumar Gupta
Cover Work
Arvindkumar Gupta
About the Author
Dr Alex Blewitt has over 20 years of experience in Objective-C, and he has been using
Apple frameworks since NeXTstep 3.0. He upgraded his NeXTstation for a TiBook when
Apple released Mac OS X in 2001, and he has been developing on it ever since.
Alex currently works for an investment bank in London, writes for the online technology
news site InfoQ, and has published two other books for Packt Publishing. He also has a
number of apps on the Apple AppStore through Bandlem Limited. When he’s not working
on technology and if the weather is nice, he likes to go flying from the nearby Cranfield
airport.
Alex writes regularly at his blog, http://alblue.bandlem.com, as well tweeting regularly on
Twitter as @alblue.
Acknowledgments
This book would not have been possible without the ongoing love and support of my wife,
Amy, who has helped me through both the highs and lows of life. She gave me the
freedom to work during the many late nights and weekends that it takes to produce a book
and its associated code repository. She truly is the Lem of my life.
I’d also like to thank my parents, Ann and Derek, for their encouragement and support
during my formative years. It was this work ethic that allowed me to start my technology
career as a teenager and to incorporate my first company before I was 25. I’d also like to
congratulate them on their 50th wedding anniversary in 2015, and I look forward to
reaching that goal with Amy.
Thanks are due, especially, to the reviewer of this version of the book: Antonio Bello, as
well as the previous version of this book: Nate Cook, James Robert, and Arvid Gerstmann,
who provided excellent feedback on the contents of this book during development and
caught many errors in both the text and code. Any remaining errors are my own.
I’d also like to thank my children Sam and Holly for inspiring me, and I hope that they too
can achieve anything that they set their minds to.
Finally, I’d like to thank Ben Moseley, and Eren Kotan, both of whom introduced me to
NeXT in the first place and set my career going on a twenty year journey to this book
About the Reviewer
Antonio Bello is a veteran software developer who started writing code when memory
was measured in bytes instead of gigabytes and storage was an optional add-on. During
his professional career, he’s worked with several languages and technologies until he
landed on the Apple planet.
Today, he loves developing apps for the iPhone, Apple Watch, Apple TV, and their
respective backends. Although he still thinks Objective-C is a great and unconventional
language, he prefers and has used Swift ever since it’s been announced.
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 nine entirely free books. Simply use your login credentials for
immediate access.
Preface
Swift Essentials provides an overview of the Swift language and the tooling necessary to
write iOS applications. From simple Swift commands on the command line using the open
source version of Swift, to interactively testing graphical content on OS X with the Xcode
Playground editor, Swift language and syntax is introduced by examples.
This book also introduces end-to-end iOS application development on OS X with Xcode
by showing how a simple iOS application can be created, followed by how to use
storyboards and custom views to build a more complex networked application.
The book concludes by providing a worked example from scratch that builds up a GitHub
repository browser for iOS, along with an Apple Watch application.
What this book covers
Chapter 1, Exploring Swift, presents the open source version of Swift with the Swift Read-
Evaluate-Print-Loop (REPL) and introduces the Swift language through examples of
standard data types, functions, and looping.
Chapter 2, Playing with Swift, demonstrates Swift Xcode Playgrounds as a means to
interactively play with Swift code and see graphical results. It also introduces the
playground format and shows how playgrounds can be documented.
Chapter 3, Creating an iOS Swift App, shows how to create and test an iOS application
built in Swift using Xcode, along with an overview of Swift classes, protocols, and enums.
Chapter 4, Storyboard Applications with Swift and iOS, introduces the concept of
Storyboards as a means of creating a multiscreen iOS application and shows how views in
the Interface Builder can be wired to Swift outlets and actions.
Chapter 5, Creating Custom Views in Swift, covers custom views in Swift using custom
table views, laying out nested views, and drawing custom graphics and layered
animations.
Chapter 6, Parsing Networked Data, demonstrates how Swift can talk to networked
services using both HTTP and custom stream-based protocols.
Chapter 7, Building a Repository Browser, uses the techniques described in this book to
build a repository browser that can display information about users’ GitHub repositories.
Chapter 8, Adding Watch Support, introduces the capabilities of the Apple Watch and
shows how to build an extension for the iOS app to provide data directly on the watch.
The Appendix, References to Swift-related Websites, Blogs, and Notable Twitter Users,
provides additional references and resources to continue learning about Swift.
What you need for this book
The exercises in this book were written and tested for Swift 2.1, which is bundled with
Xcode 7.2, and verified against a development build of Swift 2.2. To experiment with
Swift, you will need either a Mac OS X or Linux computer that meets the requirements
shown at https://swift.org/download/.
To run the exercises involving Xcode in Chapters 2–8, you need to have a Mac OS X
computer running 10.9 or above with Xcode 7.2 or above. If newer versions of Swift are
released, check the book’s GitHub repository or the book’s errata page at Packtpub for
details about any changes that may affect the book’s content.
Note
The Swift playground (described in Chapter 2, Playing with Swift) is only available as part
of Xcode on OS X and is not part of the open source version of Swift.
Also, iOS and watchOS development (Chapters 3-8) is only possible on OS X with
Xcode; it is not possible to create iOS or watchOS applications on other platforms. Most
of the required libraries and modules for iOS development are not available as part of the
open source version of Swift.
Xcode can be installed via the App Store as a free download; search for Xcode in the
search box. Alternatively, Xcode can be downloaded from
https://developer.apple.com/xcode/downloads/, which is referenced from the iOS
Developer Center at https://developer.apple.com/devcenter/ios/.
Once Xcode has been installed, it can be launched from /Applications/Xcode.app or
from Finder. To run the command line-based exercises, Terminal can be launched from
/Applications/Utilities/Terminal.app, and if Xcode is installed successfully, swift
can be launched by running xcrun swift.
The iOS applications can be developed and tested in the iOS simulator, which comes
bundled with Xcode. It is not necessary to have an iOS device to write or test the code. If
you want to run the code on your own iOS device, then you will need an Apple ID to sign
in, but the application will be limited to directly connected devices. Similarly, the watch
application can be tested in a local simulator or on a local device.
Publishing the application to the AppStore requires that you join the Apple Developer
Program. More information is available at https://developer.apple.com/programs/.
Who this book is for
This book is aimed at developers who are interested in learning the Swift programming
language, either using the open source version of Swift on Linux or the version bundled
with Xcode on OS X. However, after Chapter 1, Exploring Swift, the remainder of the
chapters use Xcode features or have iOS examples which can only be used on OS X with
Xcode. These chapters show how to write iOS applications on OS X using Swift. No prior
programming experience for iOS is assumed, though a basic level of programming
experience in a dynamically or statically typed programming language is expected. The
reader will be familiar with navigating and using Mac OS X and, in the cases where
Terminal commands are required, the developer will have experience of simple shell
commands or can pick it up quickly from the examples given.
Developers familiar with Objective-C will know many of the frameworks and libraries
mentioned; however, existing knowledge of Objective-C and its frameworks is neither
necessary nor assumed.
The sources are provided in a GitHub repository at
https://github.com/alblue/com.packtpub.swift.essentials/, and they can be used to switch
between the content of chapters using the tags in the repository. Knowledge of Git is
helpful if you are wanting to navigate between different versions; alternatively, the web-
based interface at GitHub may be used instead. It is highly recommended that the reader
becomes familiar with Git as it is the standard version control system for Xcode and the de
facto standard for open source projects. The reader is invited to read the Git topics at the
author’s blog http://alblue.bandlem.com/Tag/git/ if they are unfamiliar and interested in
learning more.
Trademarks
GitHub is a trademark of GitHub Inc., and the examples in this book have not been
endorsed, reviewed, or approved by GitHub Inc. Mac and OS X are trademarks of Apple
Inc., registered in the U.S. and other countries. iOS is a trademark or registered trademark
of Cisco in the U.S. and other countries and is used under license.
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: ”
"hello".hasPrefix("he") method compiles and runs successfully on OS X and iOS.”
When we wish to draw your attention to a particular part of a code block, the relevant
lines or items are set in bold:
func setupView() {
contentMode = .Redraw
}
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: “Xcode documentation
can be searched by navigating to Help | Documentation and API Reference.”
Note
Warnings or important notes appear in a box like this.
Tip
Tips and tricks appear like this.
Reader feedback
Feedback from our readers is always welcome. Let us know what you think about this
book—what you liked or disliked. Reader feedback is important for us as it helps us
develop titles that you will really get the most out of.
To send us general feedback, simply e-mail <[email protected]>, and mention the
book’s title in the subject of your message.
If there is a topic that you have expertise in and you are interested in either writing or
contributing to a book, see our author guide at www.packtpub.com/authors.
Customer support
Now that you are the proud owner of a Packt book, we have a number of things to help
you to get the most from your purchase.
Downloading the example code
You can download the example code files from your account at http://www.packtpub.com
for all the Packt Publishing books you have purchased. If you purchased this book
elsewhere, you can visit http://www.packtpub.com/support and register to have the files e-
mailed directly to you.
Errata
Although we have taken every care to ensure the accuracy of our content, mistakes do
happen. If you find a mistake in one of our books—maybe a mistake in the text or the
code—we would be grateful if you could report this to us. By doing so, you can save other
readers from frustration and help us improve subsequent versions of this book. If you find
any errata, please report them by visiting http://www.packtpub.com/submit-errata,
selecting your book, clicking on the Errata Submission Form link, and entering the
details of your errata. Once your errata are verified, your submission will be accepted and
the errata will be uploaded to our website or added to any list of existing errata under the
Errata section of that title.
To view the previously submitted errata, go to
https://www.packtpub.com/books/content/support and enter the name of the book in the
search field. The required information will appear under the Errata section.
Piracy
Piracy of copyrighted material on the Internet is an ongoing problem across all media. At
Packt, we take the protection of our copyright and licenses very seriously. If you come
across any illegal copies of our works in any form on the Internet, please provide us with
the location address or website name immediately so that we can pursue a remedy.
Please contact us at <[email protected]> with a link to the suspected pirated
material.
We appreciate your help in protecting our authors and our ability to bring you valuable
content.
Questions
If you have a problem with any aspect of this book, you can contact us at
<[email protected]>, and we will do our best to address the problem.
Chapter 1. Exploring Swift
Apple announced Swift at WWDC 2014 as a new programming language that combines
experience with the Objective-C platform and advances in dynamic and statically typed
languages over the last few decades. Before Swift, most code written for iOS and OS X
applications was in Objective-C, a set of object-oriented extensions to the C programming
language. Swift aims to build upon patterns and frameworks of Objective-C but with a
more modern runtime and automatic memory management. In December 2015, Apple
open sourced Swift at https://swift.org and made binaries available for Linux as well as
OS X. The content in this chapter can be run on either Linux or OS X, but the remainder
of the book is either Xcode-specific or depends on iOS frameworks that are not open
source. Developing iOS applications requires Xcode and OS X.
This chapter will present the following topics:
How to use the Swift REPL to evaluate Swift code
The different types of Swift literals
How to use arrays and dictionaries
Functions and the different types of function arguments
Compiling and running Swift from the command line
Open source Swift
Apple released Swift as an open source project in December 2015, hosted at
https://github.com/apple/swift/ and related repositories. Information about the open source
version of Swift is available from the https://swift.org site. The open-source version of
Swift is similar from a runtime perspective on both Linux and OS X; however, the set of
libraries available differ between the two platforms.
For example, the Objective-C runtime was not present in the initial release of Swift for
Linux; as a result, several methods that are delegated to Objective-C implementations are
not available. "hello".hasPrefix("he") compiles and runs successfully on OS X and
iOS but is a compile error in the first Swift release for Linux. In addition to missing
functions, there is also a different set of modules (frameworks) between the two platforms.
The base functionality on OS X and iOS is provided by the Darwin module, but on Linux,
the base functionality is provided by the Glibc module. The Foundation module, which
provides many of the data types that are outside of the base-collections library, is
implemented in Objective-C on OS X and iOS, but on Linux, it is a clean-room
reimplementation in Swift. As Swift on Linux evolves, more of this functionality will be
filled in, but it is worth testing on both OS X and Linux specifically if cross platform
functionality is required.
Finally, although the Swift language and core libraries have been open sourced, this does
not apply to the iOS libraries or other functionality in Xcode. As a result, it is not possible
to compile iOS or OS X applications from Linux, and building iOS applications and
editing user interfaces is something that must be done in Xcode on OS X.
Exploring the Variety of Random
Documents with Different Content
Already he had dealt with another enemy. In 1821 the plots of the
Hetairists, working for the liberation of Greece, became known.
Mahmûd immediately ordered all Greeks not engaged in trade to be
deported from Constantinople. Then he ordered the patriarch and
Synod of Constantinople to excommunicate the leaders who had
engaged in the massacre of Moslems. The act was issued; nor can
the Church be regarded as having done anything but what was
demanded by Christian charity.
Hardly was the excommunication issued before a number of rich
Greeks escaped from the city, evidently with the intention of joining
the revolutionary armies. On March 26 the city was filled with troops,
and arms were issued to the citizens. Several Hetairists were
executed; and when the news came of the murder of Moslems in
Greece, Mahmûd, who had already imprisoned seven Greek bishops,
ordered the public execution of a number of prominent Greeks, who
were entirely innocent, solely for the purpose of alarming their
compatriots. But this was not sufficient. On Easter Day, April 22,
1821, the Patriarch of Constantinople, Gregorios, was summoned, at
dawn, when he had finished the offering of the Holy Eucharist in his
Cathedral Church, into the hall of the Synod at the Phanar, by the
officers of the Sultan. There, before the clergy and the heads of the
chief Greek families, he was declared deposed by the authority of
the State, and the trembling priests were required to elect a new
Patriarch in his stead.
HOUSES IN THE PHANAR
Within a few hours Gregorios was hung from the gate of the
patriarchate, with a document pinned to his breast, declaring him a
traitor in that he knew of the Hetairist conspiracy, and did not reveal
it. Of the charge there is no known proof; and the Greeks have
always regarded him as a martyr. If he knew the details of the
conspiracy at all it is more than probable that he knew them only in
confession; nor is it at all probable that he knew anything but that
the Greeks intended to strike for their freedom.
Three bishops were executed on the same day. It was not a day to
be forgotten. When the body of the martyred Gregorios was taken
down it was given to the Jews to be dragged through the streets
and cast into the sea. It was recovered by night and taken by ship to
Odessa, where it was interred with solemn ceremonial as the
remains of a saint and martyr.
This horrible deed was followed by the outbreak of anarchy in
Constantinople. The Janissaries called for a massacre of the
Christians in the city to avenge the Moslems who had been killed in
Greece. The Christian quarters were attacked, the Christian villages
on the Bosphorus were robbed, and the patriarchate was sacked.
Greek clergy and nobles were executed daily, and four bishops were
among the slain. No Christians were allowed to leave the city
without a passport or vengeance was exacted upon the family. The
massacres that occurred in Constantinople were tolerated if they
were not organised by the authorities; several subjects of Western
nations were murdered. All that was done by Christian Europe was
to protest. The Russian ambassador left Constantinople, having
demanded that the massacres should cease and the churches be
rebuilt that had been destroyed. Mahmûd replied that only traitors
were ill-treated. But the massacres ended, at least for a time.
While all danger of a Christian rising in Constantinople was thus
prevented, Mahmûd was maturing the plans which in 1825 made
him at last an absolute ruler, at least in his own city.
For seventeen years Mahmûd prepared for this great stroke. First by
gifts and offices he detached many of the supporters of the
Janissaries and the Ulemas from the party which supported them.
Some less important members of the body were arrested for
infraction of the laws and were publicly executed. Others were
secretly made away with. The Sultan was surrounding himself with
an elaborate spy system and with agents who were capable of
dealing in detail with those whom he wished to be put out of the
way. Lord Stratford de Redcliffe, in his "Memoirs," says: "I remember
that in crossing the Golden Horn from time to time I had observed
loose mats floating here and there upon the water, and that in
answer to my enquiries I had been told in a mysterious manner that
they had served for covering the bodies thrown after private
executions into the harbour." All this was done slowly; the power of
the Janissaries was gradually undermined; "almost unparalleled craft
and cruelty," some observers called the process, but to Mahmûd it
seemed absolutely necessary.
In 1826 the Sultan perceived that the time limit had come. A
meeting of all the chief functionaries of the Empire and chief officers
of the Janissaries was held. They agreed to submit to the new
military discipline and organisation which the Sultan designed. All
signed their names. On June 12 the first exercises of the new order
were begun. On the 16th the inferior officers and the soldiers
declared that they would not submit. The revolt was proclaimed in
the ancient manner. The kettles were overturned, and the whole
force was called to arms. Mahmûd crossed from Bekistasch to the
Seraglio; the standard of the Prophet was displayed; the city was
filled with the troops upon whom the Sultan could rely; the Moslem
population rallied round the green flag. The people assembled in the
Atmeidan (the Hippodrome); Mahmûd went to the mosque of
Ahmed. The Janissaries were summoned to submit to the new order.
They in return demanded the destruction of the "subverters of the
ancient usages of the Empire." Then their fate was sealed. They had
advanced to the mosque of Bayezid; they were rapidly driven back
and hemmed in in their quarters in the Etmeidan. Then from every
side artillery was directed upon them. From his house in Pera
Stratford Canning, at dinner, saw "two slender columns of smoke
rising above the opposite horizon." What did they mean? The Sultan,
he was answered, had fired the barracks of the Janissaries. The rest
of the tragedy may best be told in Canning's own words:[45]
"The Sultan was determined to make the most of his victory. From
the time of his cousin Selim's death he had lived in dread of the
Janissaries. A strong impression must have been made upon his
mind by the personal danger which he had encountered. It was said
that he had escaped with his life by getting into an oven when the
search for him was hottest. His duty as sovereign gave strength as
well as dignity to his private resentment. That celebrated militia,
which in earlier times had extended the bounds of the empire, and
given the title of conqueror to so many of the Sultans, which had
opened the walls of Constantinople itself to their triumphant leader,
the second Mohammed, were now to be swept away with an
unsparing hand and to make room for a new order of things, for a
disciplined army and a charter of reform. From their high claims to
honour and confidence they had sadly declined. They had become
the masters of the government, the butchers of their sovereigns,
and a source of terror to all but the enemies of their country.
Whatever compassion might be felt for individual sufferers, including
as they did the innocent with the guilty, it could hardly be said that
their punishment as a body was untimely or undeserved.
The complaints of those who were doomed to destruction found no
echo in the bosoms of their conquerors. They were mostly citizens
having their wives, their children, or their parents, to witness the
calamity which they had brought in thunder on their necks. Many
had fallen under the Sultan's artillery; many were fugitives and
outlaws. The mere name of Janissary, compromised or not by an
overt act, operated like a sentence of death. A special commission
sat for the trial, or rather for the condemnation of crowds. Every
victim passed at once from the tribunal into the hands of the
executioner. The bowstring and the scimitar were constantly in play.
People could not stir from their houses without the risk of falling in
with some terrible sight. The Sea of Marmora was mottled with dead
bodies. Nor was the tragedy confined to Constantinople and its
neighbourhood. Messengers were sent in haste to every provincial
city where any considerable number of Janissaries existed, and the
slightest tendency to insurrection was so promptly and effectually
repressed, that no disquieting reports were conveyed to us from any
quarter of the Empire. Not a day passed without my receiving a
requisition from the Porte, calling upon me to send thither
immediately the officer and soldiers comprising my official guard. I
had no reason to suppose that any of them had been concerned in
the revolt, and I was pretty sure that they could not repair to the
Porte without imminent danger of being sacrificed. I ventured,
therefore, to detain them day after day, first on one pretext, then on
another, until, at the end of a week, the fever at headquarters had
so far subsided as to open a door for reflection and mercy. Relying
on this abatement of wrath, I complied, and the interpreter whom I
directed to accompany them, gave every assurance on their behalf
which I was entitled to offer. The men were banished from the
capital, but their lives were spared, and many years later I was
much pleased by a visit from their officer, who displayed his
gratitude by coming from a distance on foot to regale me with a
bunch of dried grapes and a pitcher of choice water. Let me add that
this instance of good feeling on the part of a Turk towards a
Christian is only one of many which have come to my knowledge."
On June 17, 1826, the Janissaries ceased to exist. The Sheik-ul-Islam
formally proclaimed the extinction of the corps. A solemn divan was
held within the Seraglio, and the victory of Mahmûd was ratified by
the council. Then Canning writing on the 20th records the end of the
revolution which re-established the authority of the Sultan in a
position as absolute and despotic as it had been in the days of
Mohammed II.
"The Sultan's ministers are still encamped in the outer court of the
Seraglio, and I grieve to add that frequent executions continue to
take place under their very eyes. This afternoon, when the person,
to whom I have already alluded, was standing near the Reis Efendi's
tent, his attention was suddenly caught by the sound of drums and
fifes, and on turning round he saw, to his utter astonishment, a body
of Turks in various dresses, but armed with muskets and bayonets,
arranged in European order, and going through the new form of
exercise. He supposes the number to have been about two
thousand, but never before having seen troops in line he may have
been deceived in this particular. He says that the men acted by word
of command, both in marching and in handling their arms. The
Sultan, who was at first stationed at the window within sight,
descended after a time, and passed the men in review. His Highness
was dressed in Egyptian fashion, armed with pistols and sabre, and
on his head in place of the Imperial turban was a sort of Egyptian
bonnet.
"Rank, poverty, age, and numbers are alike impotent to shelter those
who are known as culprits or marked as victims. It is confidently
asserted that a register has been kept of all persons who, since the
accession of the Sultan, have in any way shown a disposition to
favour the designs of the Janissaries, and that all such individuals
are diligently sought out and cut off as soon as discovered.
Respectable persons are seized in the street and hurried before the
Seraskier or Grand Vizier for immediate judgment. There are
instances of elderly men having pleaded a total ignorance of the late
conspiracy, and being reminded of some petty incident which
happened twenty years ago, in proof of their deserving condign
punishment as abettors of the Janissaries. Whole companies of
labouring men are seized and either executed or forcibly obliged to
quit Constantinople.
"The entrance to the Seraglio, the shore under the Sultan's windows,
and the sea itself, are crowded with dead bodies—many of them
torn and in part devoured by the dogs."[46]
Théophile Gautier adds even more gruesome details. To the
destruction of the Janissaries was added that of the Becktash
derviches. Then the new army was formed, organized, drilled. For
the rest of his reign, Mahmûd's chief thought was to perfect the
reforms which he had inaugurated in blood. When in 1834 he struck
coins bearing his own portrait, so grave a breach of the rules of the
Koran caused another insurrection. It was suppressed with fearful
severity, and added four thousand victims to the tale. But the
coinage had to be called in. Fanatics, whom the people regarded as
saints, coveted martyrdom by seizing the Sultan's bridle as he rode
over the new bridge which he had made from Galata to Stambûl,
calling him "Giaour Padishah" and paying Heaven's vengeance on his
head. Nothing moved Mahmûd. Without, misfortunes befell his
power on every side. He held steadfastly on, and when he died in
1839, he left behind him a strong government, and an appearance—
it may have been little more—of approximation to the ways of
Western Europe. The aim of Mahmûd, indeed, was not unlike that of
Peter the Great: he wished to make his State an integral part of the
European system. Hitherto, admitted though she was into European
politics, coveted as ally and dreaded as a foe, Turkey had occupied
no place among the permanent factors of European politics.
Mahmûd thought to make Turkey, really and essentially, a European
power. It was impossible.
The external events of the reign, the revolt of Mohammed Ali, the
treaty of Adrianople, the creation of Greece as an independent State,
important as they were in the history of the Ottoman power, hardly
affected Constantinople.
In 1832, Stratford Canning returned on a special mission to
Constantinople. He found the outer change extraordinary. Mahmûd
received him as an European sovereign would receive. He began to
think a real reform of Turkey possible. He secured the concession
that he sought on behalf of Greece: "The new Hellas was lifted up to
that great mountain ridge whence the eye of the traveller may range
unchecked over the pastures of Thessaly." Canning, after renewed
experience of the delays and intrigues of the Turkish ministers, bade
farewell to the Sultan for the last time. His character of Mahmûd is
too important to be omitted from our view. It may well conclude
what we have to say of the most important reign in recent Turkish
history.
"Resolution and energy were the foremost qualities of his mind. His
natural abilities would hardly have distinguished him in private life.
In personal courage, if not deficient, he was by no means superior.
His morality, measured by the rules of the Koran, was anything but
exemplary. He had no scruple of taking life at pleasure from motives
of policy or interest. He was not inattentive to changes of
circumstance, or insensible to the requirements of time. There was
even from early days a vein of liberality in his views, but either from
want of foresight, or owing to a certain rigidity of mind, he missed at
critical times the precious opportunity and incurred thereby an
aggravated loss. His reign of more than thirty years was marked by
disastrous wars and compulsory cessions. Greece, Egypt, and Algiers
escaped successively from his rule. He had to lament the destruction
of his fleet at Navarino. On the other hand, he gathered up the reins
of sovereign power, which had fallen from the hands of his
immediate predecessors; he repressed rebellion in more than one of
the provinces, and his just resentment crushed the mutinous
Janissaries once and for ever. Checked no longer by them, he
introduced a system of reforms which has tended greatly to renovate
the Ottoman Empire, and to bring it into friendly communion with
the Powers of Christendom. To him, moreover, is due the formation
of a regular and disciplined army in place of a factious fanatical
militia, more dangerous to the country than to its foes. Unfortunately
his habits of self-indulgence kept pace with the revival of his
authority, and the premature close of his life superseded for a while
the progress of improvement. Mahmûd when young had rather an
imposing countenance; his dark beard set off the paleness of his
face, but time added to its expression. His stature was slightly below
the average standard, his countenance was healthy, he wrote well,
he rode well, and acquired a reputation for skill in archery. It may be
said with truth that whatever merit he possessed was his own, and
that much of what was wrong in his character and conduct resulted
from circumstances beyond his control. Peace to his memory!"[47]
Abdul-Mejid (1839-1861), the son of Mahmûd II., had been brought
up in the harem. He was only sixteen at his accession, and was
utterly ignorant of politics. But he had some wise ministers, and the
defeats of the earlier part of his reign were wisely utilised. In 1841
came the practical separation of Egypt, the family of Mohammed Ali
being established there as perpetual pashas or deputies of the
Sultan, paying tribute, but otherwise free and guaranteed in their
position by the Powers.
Unquestionably the great figure in Constantinople during the reign of
Abdul Mejid was Stratford Canning, who came in 1842 as British
ambassador. He remained till 1852. He returned in 1853, and he left
finally in 1858. During these years he devoted himself to the
preservation of Turkey as a Power, but only with the hope, and on
the condition, that she should become civilized. It may have been a
hopeless task, but in the endeavour it is astounding to observe the
high measure of success which came to the noble Englishman who
gave the best years of his life to it. Kinglake has immortalised him as
"the great Elchi." No greater ambassador ever lived; and his
greatness lay in the fact that he passed entirely beyond the range of
ordinary diplomatic functions, and made himself as really a part of
the Empire to which he was accredited as he was essentially the
representative of the British nation. Needless to tell again the tale
that has been so well told, of his diplomatic triumphs, of his
supreme honesty and loyalty, of his ceaseless energy, of his
magnificent services to humanity and religion.
Throughout the whole of his life in Turkey he kept his one aim
steadily before his eyes, and never deviated from it. If Turkey could
be saved he would save her; but it could only be done by carrying
out what had been the real intention of Mahmûd the reformer, and
making an Oriental despotism resemble an European government
with constitutional guarantees for personal and religious freedom.
That in the long-run he utterly failed is now quite plain. What he
wrote more than fifty years ago, in spite of superficial outward
changes is really true to-day. "There is no such thing as system in
Turkey. Every man according to his means and opportunities gets
what he can, commands when he dares, and submits when he
must." None the less Canning won real victories. He procured a
declaration that the punishment of death should no longer be
inflicted on those who gave up Islam for Christianity. "It was the first
dagger," he wrote himself, "thrust into the side of the false prophet
and his creed." And indeed so long as Lord Stratford de Redcliffe
remained at Constantinople justice, toleration, good government
made progress such as could hardly have been conceived before.
It is needless here to inquire how far the success of Turkey in the
Crimean War led to the casting aside of all reforms, or whether the
war was justified or how it was caused. Russia's declaration of her
protectorate over the Orthodox Church; the belief of England and
France that they were bound to protect Turkey against wanton
aggression; the earnest desire of "the great Elchi" to avoid war:
these things may be read in the Blue Books[48] and in Kinglake's
great History. Constantinople saw the encampment of British troops
at Gallipoli and at Skutari; and then came the sad days of the
hospitals on the Asiatic shore and the English cemetery where sleep
so many English dead. The Hatti-Humayun of February 21, 1856,
seemed to embody all that the best friends of Turkey could have
wished, in its abolition of all distinctions telling unfavourably against
the exercise of any religion, its fine declarations of freedom and
equality among all subjects of the Porte. But who could enforce it?
The story is pitiful, and it shall not here be told. Rather let it be
remembered when we sail into the harbour of Constantinople that
the Crimean Memorial Church which stands boldly on the heights of
Pera was the sign of the noble work for religion and freedom that
had been done by the great Englishman whose last public act in the
city it was to lay the foundation-stone, and whose noble life is simply
commemorated on a tablet within its walls.
It was in 1858 that this great embassy ended. Three years later
Abdul Mejid died; and his brother Abdul Aziz was girt with the sword
in the mosque of Eyûb. Under his rule outward reforms progressed
gaily, but the reckless extravagance of the Sultan brought the
country to financial ruin. Reforms, insurrections, the creation of
Roumania, the insurrection of Crete, how did these affect
Constantinople? Not at all. Only daily the financial disorder became
more apparent. On May 10, 1876, the city witnessed a scene which
might have seemed proof that Turkey was regenerated. The Sultan's
son was stopped in the streets by crowds who demanded the
dismissal of the Grand Vizier and the Sheik-ul-Islam. From the
gorgeous new palace which he had built on the Bosporus came the
reply of Abdul Aziz—"His Majesty is deeply touched with the proof of
confidence you place in him. It is his pleasure in no way to resist the
will of his faithful people." But it was merely one of those delusive
pictures which remind one of the tricks of the genii in the Arabian
Nights. There was no real change; and on May 29, again resort was
had as in the old days to the Sheik-ul-Islam. A reformer, who had
been but a few days elevated to the post, he declared the lawfulness
of deposing a Sultan whose conduct was insensate, who had no
political judgment, who spent on himself sums which the Empire
could not afford. At dawn on May 30 the palace of Dolma Bagtché
was surrounded by troops, the Sultan was declared a prisoner, and
then was hurried across to the old Seraglio. A few days later he
returned to the gorgeous palace of Tcheragan. On June 4, he was
found dead. It was certified that he had opened his veins with a pair
of scissors. Few Sultans have long survived deposition.
Murad V. the eldest son of Abdul Mejid was received at the
Seraskierat with enthusiasm. Announcements were made which
declared him a reformer. He was Sultan for only three months.
Within the first few days a number of the ministers were murdered,
as they sat in Council, by the brother of the wife of Abdul Aziz. A few
weeks later it was declared that the Sultan was incapable of
Government. He was deposed with as much ease as his predecessor,
no one knows to-day whether he is alive or not, and Abdul Hamed
II., his brother, reigned in his stead. Of his reign little need be said.
It has seen the Bulgarian atrocities, the defeat of Turkey by Russia,
the encampment of the Russian troops at San Stefano, the
proclamation of a Constitution, a parliament with two houses opened
by the Sultan himself. It has seen also the suppression of that
Constitution; it has seen the liberty of Bulgaria, Bosnia, Herzegovina,
Cyprus and Crete.
And Constantinople, what may be told here in brief is what cannot
be forgotten. The Sultan no longer lives, like his predecessors, within
earshot of his people. Yildiz-Kiosk high on the hills above the
Bosphorus secludes him from the world. No longer does the
Commander of the Faithful visit the mosques of Stambûl or ride
through the streets with a gorgeous military display. The massacres
for which precedent was set centuries ago have again given the city
a ghastly fame. In October 1895 crowds of Softas—religious
students—assembled in the Atmeidan and a massacre of Armenians
began. The riots lasted for three days. The authorities declared that
the cause was the revolutionary plots of the Armenians themselves,
that they did their utmost to preserve order, and that they would
punish all who were responsible. Ten months passed. Constantinople
in the spring of 1896 was outwardly at peace, but arrests were
constantly being made, and there was a general feeling of insecurity.
On August 28, 1896, a band of Armenians seized the Ottoman Bank
at Galata, killing the guard and imprisoning the officials. After some
hours they were allowed to depart under a safe conduct. But for
nearly two days the city was given up to massacre. Bands of
Moslems rose simultaneously at different parts before the police or
the military appeared, led or accompanied by Softas, by soldiers, by
police officers. When the troops appeared they looked on. The
scenes in the streets beggar description. Christians were butchered
wherever they appeared, were chased into houses and over roofs,
were shot in their houses by men who took the tiles from the roofs
across the street, broke the windows, and then fired into the rooms
where Armenians had crowded for refuge. The churches were filled
with people who sought sanctuary, who had lost everything they
possessed and dared not leave the security of the sacred walls. The
churches of Pera and Galata, the buildings of the Patriarchate in the
Psamatia quarter seemed the only safe places. Of the numbers killed
no count can be given; two thousand certainly perished, but five
thousand has been declared to have been the total of the victims.
For days the dead-cart passed through the streets and the murdered
Christians were carried off with indescribable brutality to be cast into
huge pits or into the sea. It is impossible as yet to tell the full story.
It seems still like a horrible dream, a reminiscence of the worst
terrors of the Middle Age.
STREET IN GALATA
Though as it has already been said there is but one church which
has survived the Turkish conquest without ever ceasing to be used
for its divine purpose, there are very many buildings in
Constantinople still remaining, with more or less change, that were
once hallowed to the worship of the Church of Christ.
Very many have perished, the most notable among them that
Church of the Holy Apostles, which was destroyed by Mohammed
the Conqueror to build the great mosque which bears his name. But
those which still remain were among the chiefest wonders of the City
of the Emperors, and there is not one of them which does not
deserve an extensive study.
The volumes that have been written on Byzantine architecture
cannot be compressed into a few pages. It must suffice to recall
what are the chief characteristics of the style which may still be seen
in its perfection at Constantinople, as at Salonica. The origin of what
had so wide an extension over the East, of the art which made a
new departure under Constantine, and a still more important one
under Justinian, is simply the basilica, the law court of ancient
Rome. A long nave and aisles separated by rows of pillars,
surmounted by a flat roof and ending in an apse: that is the familiar
type of which a splendid example built under Byzantine influence is
to be found in the church of S. Apollinare Nuovo at Ravenna. To this
simple design the East added the development of the dome. In the
sixth century the domical style decisively replaced the basilican; and
nowhere can the transition be more clearly traced than in
Constantinople.
We have
then, in
our
examinati
on of the
still
remaining
specimens
of
Byzantine
art, to
observe
first the
CAPITAL FROM RAVENNA
basilicas,
SHOWING EARLY FORM OF
then the
IMPOST
combinati
on of
basilica
with
dome,
then the
examples
of the
completed
domical
style. But
Metal Socket this is by
no means
all.
Byzantine
art, in the
carving of
capitals,
in the
creation
of the
impost-
capital, in
its
achievem
ent of
"teaching
the
column to
CAPITALS FROM S. SOPHIA support
(IMPOST ABSORBED) the arch,"
in
sculpture,
in bronze
work, in the detail of inscriptions, and above all, in mosaic, is worth
the most attentive study, and happily in spite of time, war and
barbarism, Constantinople still furnishes a fruitful field for the
student.
Of the basilicas which existed before the time of Justinian, there are
two impressive examples remaining. The first is the church of S.
John Baptist, once attached to the monastery called the Studium. It
was originally built in 463, and was attached to the monastery
founded by one of the early emigrants from the old Rome, Studius.
This monastery became the most important centre of the Akoimetai,
the "sleepless ones," an order which kept up perpetual intercession
for the sins of the world, and whose importance from the fifth
century to the time of the Latin Conquest was very great.[51] It was
in this church that many of the icons were preserved during the first
fury of iconoclasm: in the monastery, Isaac Comnenus and Michael
VII. assumed the monastic habit.
The church has undergone several restorations, but is now in a
ruinous state. It was turned into a mosque under Bayezid II.—it is
called Mir Achor Djami—but its structural arrangements have not
been altered. It is a basilica with two aisles and apse, narthex and
atrium. On each side the aisles are divided from the nave by seven
marble pillars, the capitals Corinthian, the work below Byzantine.
The design on the capitals is that of the double acanthus, "one leaf
lying over and within another." Outside in the atrium the columns
are Corinthian, and so also below in the great crypt or cistern. The
door of the narthex is inserted between the two columns. Of the
many memorials that the church once contained only one may now
be seen. In a wall marking a small enclosure behind the apse, at the
north-east, is a tombstone upside down on which may be traced the
Greek inscription to the memory of Dionysios, a Russian monk, who
fell asleep on September 6, 1387.
Beautiful in its ruin, with the creepers hiding many of the great gaps
in the Western entrance, the church of S. John Baptist does not
differ essentially from the common Western type of basilica. The
galleries (now without floors) mark, it has been said, the advent of
organised monasticism earlier than in the West; but there is, save
for some of the work on the pillars, nothing of an especially
Byzantine style about the church. It seems certain to perish in a few
years if nothing is done. Meanwhile it should be visited by every
student of history or art.
COURTYARD OF THE CHURCH OF THE
STUDIUM
S. Irene, now within the grounds of the Seraglio, is of more
importance. It owes its original foundation to Constantine, but it
suffered severely in the Nika riot and was rebuilt by Justinian in 532.
It was again restored in 740. Little if anything has been done to it
since the Turkish Conquest, and it may be taken as certain that its
original structure remains practically unaltered. For the historical
interest of its contents as well as for its architectural importance, it is
well worth a visit; but it is rarely that permission is accorded to view
it.[52] It has been used since the Turkish Conquest as an armoury,
and an irardé from the Sultan himself is necessary to authorise the
Minister of Ordnance to permit any one to see it.
Its form is basilican, a nave with two aisles and an apse. The dome
rests upon a drum lighted by twenty windows. It is probable that
this was built by Justinian. In the apse is a characteristic feature
which shows what must have been the arrangement at S. Sophia.
There are five rows of seats for the clergy, facing west—an unusual
number of seats I think, for at Ravenna there is but one row. Under
the seats there is a passage round the apse.
There were originally a narthex and an atrium. The narthex seems to
have been thrown into the church, as is shown by the heavy pier
supporting the gallery, with its counterpart in the outer walls ending
abruptly at the wall plate. It seems probable that this was done in
order to make room for the second dome, the original structure
being that of the ordinary Roman basilica. The atrium seems to have
undergone many changes: possibly it is entirely of Mohammedan
work, as it has pointed arches. The interior of the church is solemn
and impressive, an effect due to the great dignity of the general
lines. Originally no doubt the walls and domes were covered with
mosaics. Part of the apse still bears its decoration uncovered with
the wash which is over all the rest of the surface. A gigantic cross of
black tesseræ stretches up the vault, and large inscriptions remain
over the arch. The apse is lighted by three great windows, a feature
never seen in Roman basilicas till much later. The columns which
support the galleries are plain, the arch resting on simple uncarved
blocks. It may be seen, even from this brief description, how
interesting the church is as a representation in Constantinople of the
style brought to the East by the Christian architects of the Empire,
and exposed to many foreign influences, but as yet showing no
important signs of departure from the original type.
But the church is interesting not only architecturally, but historically.
It has never been used for the worship of Islam. It could be restored
in a few hours to the worship of the Christian Church. Its
incongruous contents, too, have an interest. There are weapons of
the Crusaders, chainmail, great swords; the curious machines of
Alexius Comnenus; keys of conquered cities, bags of earth in token
of conquest. There are five fine bells, two with dates 1600 and 1658,
one dedicated "Vero Deo Patri Filio Spiritui Sancto." There are
swords of the Janissaries, and their curiously shaped helmets, and
their famous kettle drums, differing in size according to the number
of companies that were assembled. Most interesting of all, perhaps,
are the fragments of the great chain which stretched across the
Golden Horn. In the court are two fine sarcophagi, which are called
those of Constantine and Irene.
COMPARATIVE SIZES OF GREAT AND
LITTLE S. SOPHIA.
PLAN OF SS. SERGIUS AND BACCHUS.
These two examples of the basilican style are clear and distinct.
There are other churches which have basilican features, but do not
belong to the period before Justinian, and are worthy of detailed
examination. S. Thekla stands back from the walls on the Golden
Horn not far from the gate now called Aivan Serai Kapoussi, which
was once the Porta Kiliomené. The foundation of this is not earlier
than the ninth century, and Anna Comnena mentions its restoration
in the eleventh. It is a curious survival of an early style, for it has no
dome, and is simply a basilica about forty feet long and twenty
broad, with an apse. It was gaily restored a few years ago, and
bears as a mosque the name of Toklou Ibrahim Dedeh Mesjid.
S. Theodore Tyrone (Killisé Djami) stands not far to the west of the
mosque of Suleiman. It was built about 450, but much of the
present building is of the twelfth century. It is not improbable that in
its chief features it may be older than any church in Constantinople.
The central dome has ten arches, perhaps originally windows, now
closed. All the domes are small, and the columns are without
ornament. There are narthex and exo-narthex, and in the latter is a
mysterious opening, full of stones and fragments of mortar, leading,
it is said, to a long passage which the Turks fancy once led to S.
Sophia.
But more interesting than either of these is that unique building
which the Turks have happily named "Kutchuk Aya Sofia," little S.
Sophia, the Church of S. Sergius and S. Bacchus.[53] It stands not
far from Koum Kapoussi in the Marmora Walls, and quite close to the
railway. Originally it was connected with the Church of S. Peter and
S. Paul. Procopius describes the churches as standing obliquely
towards each other, "joined together, and vieing one with another.
They have," he says, "a common entrance, are equal to one another
in all respects, are surrounded by a boundary wall, and neither of
them exceeds the other or falls short of it, either in beauty, size, or
any other respect; for each alike reflects the rays of the sun from its
polished marble, and is alike covered with rich gold and adorned
with offerings. In one respect alone they differ, that the one is built
longitudinally, whereas the columns of the other for the most part
stand in a semi-circle. The portico at their entrance is common to
both, and from its great length is called narthex (i.e. a reed). The
whole propylea, the atrium, and the doors from the atrium, and the
entrance to the palace, are common to both." A door now closed at
the south of the narthex shows where was the entrance to the
Church of S. Peter and S. Paul. S. Sergius and S. Bacchus has
happily suffered but little. It has, as has been said, a structural
narthex. The atrium can still be traced in the arrangement of the
Turkish houses and garden separated now from the church by a
narrow pathway.
The Church of S. Sergius and S. Bacchus is a square with a dome.
Columned exedras fill out the angles of the square under the domed
vaults, and the piers supporting the dome form an octagon. A small
apse is added at the east end. The ground plan of the church almost
exactly repeats that of S. Vitale at Ravenna, which was probably
begun a year before its companion in Constantinople. The
resemblance is most marked in the six windows of the apse, the
galleries and the columns on which they rest. The details also of the
work closely resemble each other. We have the simplest form of the
impost capital and the eight-lobed melon-formed capital. Vine-leaves
form part of the decoration of some of the capitals and of the frieze:
some say that this is a fanciful allusion to the associations of the
name of one of the saints to whom the church is dedicated. Many
crosses are cut in the marble of the west gallery; and on the south
side over the imperial entrance from the palace are the monograms
of Justinian and Theodora.
Justinian built the Church in 527, and dedicated it to the soldier
saints who were martyred under Maximianus, to commemorate his
preservation when he was charged with treason during the reign of
Anastasius. An inscription commemorates the Emperor "inspired by
pity," and his wife Theodora, "the divinely crowned." Its historic
associations are interesting. It was there that representatives of the
Latin Church on a visit to Constantinople were generally allowed to
worship according to their own rite. It is probable that Gregory the
Great, who was so long the Papal representative at the Byzantine
court, often said mass there. It suffered severely during the Latin
conquest, and it was repaired by Michael VIII.
Interesting, and in spite of whitewash and colouring, even beautiful
in itself, it is important architecturally as illustrating the process
which developed the design of S. Irene into that of S. Sophia.
Closely resembling S. Vitale at Ravenna, it is yet, in little, a very
distinct anticipation of the great church of the Divine Wisdom of
which we have now to speak.
Something has been said already (above, pp. 35-39) of the historic
circumstances under which this, "the fairest church in all the world,"
as our Sir John Mandeville hath it, was built. Hardly a month after
the burning of the first church of the Divine Wisdom in 532, the new
building was begun. On S. Stephen's Day 537, it was consecrated. In
558 much of it was seriously damaged by an earthquake, the
eastern part of the dome, with the apse, being thrown down,
"destroying in its fall the holy table, the ciborium, and the ambo." At
their restoration, the dome was raised twenty feet.
From the first, it was recognised as the greatest work that had ever
been completed by architects. Not only the eulogists of Justinian,
but every chronicler of the age, and for some centuries after, bear
testimony to the fascination which its splendour and dignity
exercised upon the imagination of beholders. It was the great
outward expression of the power of a world-empire consecrated to
the religion of Christ. It was the symbol of the offering of all
beautiful things, all art, now conquered from the corruptions of
paganism, all riches, all human skill and thought, to God the Creator.
The Divine Wisdom which made the world and designed all things so
great and so fair, was to hallow all, now that man offered them up in
continual sacrifice to God from Whom alone their use and blessing
came. S. Sophia's was the highest outward expression which man
had given to the idea of God's omnipotence and omnipresence, and
to the absolute dependence of man upon the Divine ordering of life.
"Anima naturaliter Christiana" was the noble saying of Tertullian. The
Church of S. Sophia was the expression of that thought by the
genius of Anthemius of Tralles under the direction of Justinian,
Cæsar and Augustus.
We can hardly see the great church better than with the words of
Procopius, the first to describe it, before us.
In his Ædifices, a glorification perhaps too glorious of the great
Emperor's wisdom in his buildings, the strange historian, half soldier,
half philosopher, who followed the greatest captain of the age in his
campaigns, who lived in the close presence of the splendid works
which made the men of the sixth century famous in the history of
the world, and yet had a mind utterly sceptical as to real goodness,
entirely credulous of evil, perhaps for once threw aside his sardonic
humour when he wrote of the great church. Here at least, in all
those high-wrought pages, he is sincere.
Justinian, he says, is highly to be regarded for his wisdom and his
good fortune that he found architects and workmen so skilful, and
was "able to choose the most suitable of mankind to execute the
noblest of his works."
It was this, he says, which caused the matchless achievement. Cost
was not spared, workmen were brought from every land.
ebookbell.com