100% found this document useful (2 votes)
32 views

PDF App Development Using iOS iCloud: Incorporating CloudKit with Swift in Xcode 1st Edition Shantanu Baruah download

Using

Uploaded by

moffakexeluz
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (2 votes)
32 views

PDF App Development Using iOS iCloud: Incorporating CloudKit with Swift in Xcode 1st Edition Shantanu Baruah download

Using

Uploaded by

moffakexeluz
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 41

Download the Full Version of ebook for Fast Typing at ebookmass.

com

App Development Using iOS iCloud: Incorporating


CloudKit with Swift in Xcode 1st Edition Shantanu
Baruah

https://ebookmass.com/product/app-development-using-ios-
icloud-incorporating-cloudkit-with-swift-in-xcode-1st-
edition-shantanu-baruah/

OR CLICK BUTTON

DOWNLOAD NOW

Download More ebook Instantly Today - Get Yours Now at ebookmass.com


Recommended digital products (PDF, EPUB, MOBI) that
you can download immediately if you are interested.

App Development Using iOS iCloud: Incorporating CloudKit


with Swift in Xcode 1st Edition Shantanu Baruah

https://ebookmass.com/product/app-development-using-ios-icloud-
incorporating-cloudkit-with-swift-in-xcode-1st-edition-shantanu-
baruah-2/
ebookmass.com

iOS Architecture Patterns: MVC, MVP, MVVM, VIPER, and VIP


in Swift 1st Edition Raúl Ferrer García

https://ebookmass.com/product/ios-architecture-patterns-mvc-mvp-mvvm-
viper-and-vip-in-swift-1st-edition-raul-ferrer-garcia/

ebookmass.com

Modern Concurrency on Apple Platforms: Using async/await


with Swift 1st Edition Andrés Ibañez Kautsch

https://ebookmass.com/product/modern-concurrency-on-apple-platforms-
using-async-await-with-swift-1st-edition-andres-ibanez-kautsch/

ebookmass.com

Beginning iPhone Development with SwiftUI: Exploring the


iOS SDK (7th Edition) Wallace Wang

https://ebookmass.com/product/beginning-iphone-development-with-
swiftui-exploring-the-ios-sdk-7th-edition-wallace-wang/

ebookmass.com
Software Development with Go: Cloud-Native Programming
using Golang with Linux and Docker 1st Edition Nanik
Tolaram
https://ebookmass.com/product/software-development-with-go-cloud-
native-programming-using-golang-with-linux-and-docker-1st-edition-
nanik-tolaram/
ebookmass.com

A Brief Introduction to Web3: Decentralized Web


Fundamentals for App Development 1st Edition Shashank
Mohan Jain
https://ebookmass.com/product/a-brief-introduction-to-
web3-decentralized-web-fundamentals-for-app-development-1st-edition-
shashank-mohan-jain/
ebookmass.com

How JavaScript Works: Master the Basics of JavaScript and


Modern Web App Development 1st Edition Jonathon Simpson

https://ebookmass.com/product/how-javascript-works-master-the-basics-
of-javascript-and-modern-web-app-development-1st-edition-jonathon-
simpson-2/
ebookmass.com

How JavaScript Works: Master the Basics of JavaScript and


Modern Web App Development 1st Edition Jonathon Simpson

https://ebookmass.com/product/how-javascript-works-master-the-basics-
of-javascript-and-modern-web-app-development-1st-edition-jonathon-
simpson/
ebookmass.com

GIS Research Methods: Incorporating Spatial Perspectives


1st Edition, (Ebook PDF)

https://ebookmass.com/product/gis-research-methods-incorporating-
spatial-perspectives-1st-edition-ebook-pdf/

ebookmass.com
App Development
Using iOS iCloud
Incorporating CloudKit with
Swift in Xcode

Shantanu Baruah
Shaurya Baruah
App Development
Using iOS iCloud
Incorporating CloudKit
with Swift in Xcode

Shantanu Baruah
Shaurya Baruah
App Development Using iOS iCloud: Incorporating CloudKit with
Swift in Xcode
Shantanu Baruah Shaurya Baruah
Somerset, NJ, USA Somerset, NJ, USA

ISBN-13 (pbk): 978-1-4842-8757-6 ISBN-13 (electronic): 978-1-4842-8758-3


https://doi.org/10.1007/978-1-4842-8758-3

Copyright © 2023 by Shantanu Baruah and Shaurya Baruah


This work is subject to copyright. All rights are reserved by the Publisher, whether the whole or
part of the material is concerned, specifically the rights of translation, reprinting, reuse of
illustrations, recitation, broadcasting, reproduction on microfilms or in any other physical way,
and transmission or information storage and retrieval, electronic adaptation, computer software,
or by similar or dissimilar methodology now known or hereafter developed.
Trademarked names, logos, and images may appear in this book. Rather than use a trademark
symbol with every occurrence of a trademarked name, logo, or image we use the names, logos,
and images only in an editorial fashion and to the benefit of the trademark owner, with no
intention of infringement of the trademark.
The use in this publication of trade names, trademarks, service marks, and similar terms, even if
they are not identified as such, is not to be taken as an expression of opinion as to whether or not
they are subject to proprietary rights.
While the advice and information in this book are believed to be true and accurate at the date of
publication, neither the authors nor the editors nor the publisher can accept any legal
responsibility for any errors or omissions that may be made. The publisher makes no warranty,
express or implied, with respect to the material contained herein.
Managing Director, Apress Media LLC: Welmoed Spahr
Acquisitions Editor: Jessica Vakili
Development Editor: James Markham
Coordinating Editor: Jessica Vakili
Distributed to the book trade worldwide by Springer Science+Business Media New York, 1
New York Plaza, Suite 4600, New York, NY 10004-1562, USA. Phone 1-800-SPRINGER, fax (201)
348-4505, e-mail orders-ny@springer-sbm.com, or visit www.springeronline.com. Apress Media,
LLC is a California LLC and the sole member (owner) is Springer Science + Business Media
Finance Inc (SSBM Finance Inc). SSBM Finance Inc is a Delaware corporation.
For information on translations, please e-mail booktranslations@springernature.com; for reprint,
paperback, or audio rights, please e-mail bookpermissions@springernature.com.
Apress titles may be purchased in bulk for academic, corporate, or promotional use. eBook
versions and licenses are also available for most titles. For more information, reference our Print
and eBook Bulk Sales web page at http://www.apress.com/bulk-sales.
Any source code or other supplementary material referenced by the author in this book is
available to readers on the Github repository: https://github.com/Apress/
App-Development-Using-iOS-iCloud. For more detailed information, please visit
http://www.apress.com/source-code.
Printed on acid-free paper
For my parents and my son’s grandparents,
Meenu Baruah and Late Sailendar Nath Baruah
Table of Contents
About the Authors�������������������������������������������������������������������������������xv

About the Technical Reviewer����������������������������������������������������������xvii

Acknowledgments�����������������������������������������������������������������������������xix

Introduction���������������������������������������������������������������������������������������xxi

Part I: Basic App Development Using Swift Core Concepts���������1


Chapter 1: Xcode Introduction��������������������������������������������������������������3
About Xcode����������������������������������������������������������������������������������������������������������3
Installation and System Requirements�����������������������������������������������������������������5
Interface Introduction��������������������������������������������������������������������������������������������6
Chapter Summary�������������������������������������������������������������������������������������������������9

Chapter 2: CloudKit Overview�������������������������������������������������������������11


CloudKit at a Glance��������������������������������������������������������������������������������������������11
Setting Up CloudKit���������������������������������������������������������������������������������������������13
Exploring CloudKit Dashboard�����������������������������������������������������������������������������18
Accessing the iCloud Dashboard�������������������������������������������������������������������19
Understanding the Dashboard�����������������������������������������������������������������������19
Creating Book Tracker Table (Table, type, Indexes)����������������������������������������21
Summary������������������������������������������������������������������������������������������������������������25

v
Table of Contents

Chapter 3: Core Swift Concepts����������������������������������������������������������27


Variables�������������������������������������������������������������������������������������������������������������27
Let and Var�����������������������������������������������������������������������������������������������������27
Basic Types���������������������������������������������������������������������������������������������������������28
Classes, Structures, and Objects������������������������������������������������������������������������28
Array��������������������������������������������������������������������������������������������������������������30
Scope�������������������������������������������������������������������������������������������������������������32
Functions�������������������������������������������������������������������������������������������������������34
Beautifying Strings Using NSAttributedString�����������������������������������������������36
Life Cycle Methods����������������������������������������������������������������������������������������37
Type Casting��������������������������������������������������������������������������������������������������39
Loop Controls������������������������������������������������������������������������������������������������42
UI Color���������������������������������������������������������������������������������������������������������������45
Overview��������������������������������������������������������������������������������������������������������45
Guidelines for UI Color�����������������������������������������������������������������������������������46
System Colors�����������������������������������������������������������������������������������������������47
Dynamic System Colors���������������������������������������������������������������������������������48
Getting System Colors�����������������������������������������������������������������������������������49
Syntax������������������������������������������������������������������������������������������������������������49
UIImage and UIImageView�����������������������������������������������������������������������������53
UITextField�����������������������������������������������������������������������������������������������������56
UIAlertController��������������������������������������������������������������������������������������������60
UITableView���������������������������������������������������������������������������������������������������62
Summary������������������������������������������������������������������������������������������������������������69

Chapter 4: Book Tracker Basic App Building��������������������������������������71


Setting Up the Tab View Controller����������������������������������������������������������������������71
Creating a Tab Application�����������������������������������������������������������������������������������76
Summary������������������������������������������������������������������������������������������������������������85

vi
Table of Contents

Chapter 5: Adding Book Screen����������������������������������������������������������87


Designing the Add Screen�����������������������������������������������������������������������������������88
Assigning the Add View Controller File in Main.storyboard��������������������������������92
Running the Code������������������������������������������������������������������������������������������������93
Defining the UI Objects for the Add Screen���������������������������������������������������������97
Running the Program����������������������������������������������������������������������������������������114
Saving the Book Record in iCloud���������������������������������������������������������������������115
Data Validation Is an Important Step�����������������������������������������������������������115
Create a Database Function File������������������������������������������������������������������123
Preparation Before Saving the Book������������������������������������������������������������123
Function to Save Book Record��������������������������������������������������������������������124
Setting Value Before Calling saveBook��������������������������������������������������������128
Post Save�����������������������������������������������������������������������������������������������������131
Reset Field���������������������������������������������������������������������������������������������������134
Summary����������������������������������������������������������������������������������������������������������136

Chapter 6: Displaying the Book Records������������������������������������������137


Setting Up Display View Controller��������������������������������������������������������������������137
Assigning the Display View Controller File in Main.storyboard�������������������������141
Query the Book Table����������������������������������������������������������������������������������������142
Call the Query Book������������������������������������������������������������������������������������������147
Create a Table View�������������������������������������������������������������������������������������������149
Step 1: Define the Table Object��������������������������������������������������������������������151
Step 2: Extending the Table Delegate and Table Data Source���������������������152
Step 3: Setting the Table Delegate and Table Cell���������������������������������������152
Step 4: Drawing the Table����������������������������������������������������������������������������154
Step 5: Implementing numberOfRowsInSection������������������������������������������155
Step 6: Implementing the cellForRowAt������������������������������������������������������156
Step 6: Run the program�����������������������������������������������������������������������������157
vii
Table of Contents

Detailed Text Label��������������������������������������������������������������������������������������������158


Setting a Table Header��������������������������������������������������������������������������������������162
Summary����������������������������������������������������������������������������������������������������������164

Chapter 7: Deleting a Table Record��������������������������������������������������165


Trailing Swipe Function�������������������������������������������������������������������������������������165
Deleting book from CloudKit Database�������������������������������������������������������������169
Summary����������������������������������������������������������������������������������������������������������174

Chapter 8: Searching Data Screen����������������������������������������������������175


Create the Search View Controller��������������������������������������������������������������������175
Draw the Search Screen�����������������������������������������������������������������������������������175
Query for All Records to Enable Search������������������������������������������������������������181
Text Field Events, Operations, and Display��������������������������������������������������������186
Remove Constraints������������������������������������������������������������������������������������������191
Table Functions�������������������������������������������������������������������������������������������������192
Summary����������������������������������������������������������������������������������������������������������196

Chapter 9: App Development Part 2 Overview����������������������������������199


What Lies Ahead . . .�����������������������������������������������������������������������������������������199
iCloud Setup������������������������������������������������������������������������������������������������������200
Summary����������������������������������������������������������������������������������������������������������202

Part II: Overview����������������������������������������������������������������������203


Chapter 10: Redesigning the Display Screen������������������������������������205
Redesigning the UI of the Display Book Screen������������������������������������������������207
Initial Setup�������������������������������������������������������������������������������������������������207
Defining UI Objects for the Top Views����������������������������������������������������������207
Lifecycle Method and Initial Setup��������������������������������������������������������������214
Drawing the Screen�������������������������������������������������������������������������������������223

viii
Table of Contents

Table Setup��������������������������������������������������������������������������������������������������231
Top View Blocks�������������������������������������������������������������������������������������������243
Custom Delegation��������������������������������������������������������������������������������������������249
Define the Delegate Protocol�����������������������������������������������������������������������250
Implementing the Delegate�������������������������������������������������������������������������251
Calling the Delegate������������������������������������������������������������������������������������254
Summary����������������������������������������������������������������������������������������������������������256

Chapter 11: Adding a Book���������������������������������������������������������������257


Creation of View Controller and Linking It to the Tab Bar����������������������������������259
Inheriting Delegates������������������������������������������������������������������������������������260
Declaring Variables��������������������������������������������������������������������������������������260
Declaring Screen Objects����������������������������������������������������������������������������261
Screen Load Event and Initial Functions�����������������������������������������������������266
Displaying the Genre and Status Table��������������������������������������������������������278
Input Text Field Events���������������������������������������������������������������������������������285
Save the Book����������������������������������������������������������������������������������������������287
Saving Book Record to iCloud���������������������������������������������������������������������294
Reset Fields�������������������������������������������������������������������������������������������������300
Summary����������������������������������������������������������������������������������������������������������300

Chapter 12: Book Details View Controller����������������������������������������301


Initial Setup�������������������������������������������������������������������������������������������������������301
Create the View Controller���������������������������������������������������������������������������301
Class Inheritance�����������������������������������������������������������������������������������������302
Class Variables��������������������������������������������������������������������������������������������302
Initial Load Functions����������������������������������������������������������������������������������304
Setup�����������������������������������������������������������������������������������������������������������304
Set Book Details������������������������������������������������������������������������������������������307

ix
Table of Contents

Drawing the Screen������������������������������������������������������������������������������������������311


Screen Objects��������������������������������������������������������������������������������������������312
UI Object Code Snippets������������������������������������������������������������������������������313
UI Object Code Snippets������������������������������������������������������������������������������316
UI Object Code Snippets������������������������������������������������������������������������������325
UI Object Code Snippets������������������������������������������������������������������������������326
Drawing Screen�������������������������������������������������������������������������������������������328
Displaying the Book Details������������������������������������������������������������������������������333
Number of Sections�������������������������������������������������������������������������������������333
Number of Rows������������������������������������������������������������������������������������������333
Display the Table�����������������������������������������������������������������������������������������334
Row Height��������������������������������������������������������������������������������������������������336
Header View������������������������������������������������������������������������������������������������337
Header Height����������������������������������������������������������������������������������������������338
Defining the Custom Cell�����������������������������������������������������������������������������338
Tab Bar Function������������������������������������������������������������������������������������������342
Summary����������������������������������������������������������������������������������������������������������343

Chapter 13: Sharing Book with Other Users�������������������������������������345


Import CloudKit�������������������������������������������������������������������������������������������������347
Share Button Click Event����������������������������������������������������������������������������������348
Share Record Functions������������������������������������������������������������������������������������349
Cloud Sharing Call Back Function���������������������������������������������������������������������356
Summary����������������������������������������������������������������������������������������������������������357

Chapter 14: Edit Book�����������������������������������������������������������������������359


Calling the Edit View Controller�������������������������������������������������������������������������359
Edit View Controller�������������������������������������������������������������������������������������������360
Class Level Variable�������������������������������������������������������������������������������������361

x
Table of Contents

Navigation Bar���������������������������������������������������������������������������������������������361
Setup�����������������������������������������������������������������������������������������������������������363
Save Book����������������������������������������������������������������������������������������������������364
Update Book Database Functions����������������������������������������������������������������365
Summary����������������������������������������������������������������������������������������������������������367

Chapter 15: Book Delete�������������������������������������������������������������������369


Delete Block Button Action��������������������������������������������������������������������������������370
Custom Delete Book Function���������������������������������������������������������������������������371
Delete Book Database Function������������������������������������������������������������������������372
Summary����������������������������������������������������������������������������������������������������������374

Chapter 16: Book Notes��������������������������������������������������������������������375


Marking Book as FavoriteBook Notes Touch Up Inside Event���������������������������376
Book Notes View Controller�������������������������������������������������������������������������������377
Class Level Variables�����������������������������������������������������������������������������������378
Book Notes Variable������������������������������������������������������������������������������������������378
Class Level UI Objects���������������������������������������������������������������������������������������380
Initial Loading���������������������������������������������������������������������������������������������������383
Custom Table View Cell for Book Notes������������������������������������������������������������386
Draw the Notes Screen�������������������������������������������������������������������������������������388
Table View Function������������������������������������������������������������������������������������������389
Table View Trailing Swipe Control���������������������������������������������������������������������394
Delete Notes������������������������������������������������������������������������������������������������������399
Adding Notes�����������������������������������������������������������������������������������������������������400
Draw the Add Notes Popup��������������������������������������������������������������������������402
Add Notes Navigation Bar Function�������������������������������������������������������������404
Remove Constraints������������������������������������������������������������������������������������405

xi
Table of Contents

Save Book Method��������������������������������������������������������������������������������������������406


Database Save Book Method�����������������������������������������������������������������������408
Tab Bar Function�����������������������������������������������������������������������������������������������410
Summary����������������������������������������������������������������������������������������������������������411

Chapter 17: Book Reminder��������������������������������������������������������������413


Reminder Action Button������������������������������������������������������������������������������������415
Draw Reminder Screen�������������������������������������������������������������������������������������415
Save Reminder��������������������������������������������������������������������������������������������������418
Setup Reminder������������������������������������������������������������������������������������������������419
Reset Reminder������������������������������������������������������������������������������������������������424
Update Reminder����������������������������������������������������������������������������������������������425
Update Database with Reminder Date��������������������������������������������������������426
Remove Reminder Screen��������������������������������������������������������������������������������428
Summary����������������������������������������������������������������������������������������������������������429

Chapter 18: Mark Favorite����������������������������������������������������������������431


Frequency Button Action�����������������������������������������������������������������������������������432
Database Functions Update Favorite Status�����������������������������������������������������435
Animation Function�������������������������������������������������������������������������������������������438
Summary����������������������������������������������������������������������������������������������������������440

Chapter 19: Shared Books Tab����������������������������������������������������������441


Accept the Share Record: Scene Delegate�������������������������������������������������������441
Share Record Function��������������������������������������������������������������������������������������444
Shared Book Database Function�����������������������������������������������������������������������449
Shared Task Zones��������������������������������������������������������������������������������������������449
Query Functions������������������������������������������������������������������������������������������������451
Summary����������������������������������������������������������������������������������������������������������454

xii
Table of Contents

Chapter 20: Search Screen���������������������������������������������������������������455


Create the View Controller��������������������������������������������������������������������������������456
Class Variables��������������������������������������������������������������������������������������������������457
Class UI Objects������������������������������������������������������������������������������������������������458
Screen Setup����������������������������������������������������������������������������������������������������460
View Did Load����������������������������������������������������������������������������������������������460
Book Query function������������������������������������������������������������������������������������461
Database Function for Book Query��������������������������������������������������������������461
Setup�����������������������������������������������������������������������������������������������������������463
Draw Search Screen������������������������������������������������������������������������������������466
Text Field Function��������������������������������������������������������������������������������������������467
Editing Begin�����������������������������������������������������������������������������������������������467
Editing Changed������������������������������������������������������������������������������������������467
Editing End��������������������������������������������������������������������������������������������������470
Pressing the Return Key on Keyboard���������������������������������������������������������471
Drawing the Table���������������������������������������������������������������������������������������������472
Removing the Constraints���������������������������������������������������������������������������������472
Table Function���������������������������������������������������������������������������������������������������473
Summary����������������������������������������������������������������������������������������������������������476

Chapter 21: Packaging and Releasing����������������������������������������������477


Setting Up the Application Logo������������������������������������������������������������������������477
Build the Archive and Publish���������������������������������������������������������������������������478
Set Up Test Flight Account���������������������������������������������������������������������������479
Menu Option������������������������������������������������������������������������������������������������482
Distribute App����������������������������������������������������������������������������������������������482
Setting Up the App in App Store������������������������������������������������������������������������486

xiii
Table of Contents

Promote Development Database to Production Database��������������������������������487


Invite Test Users in Test Flight���������������������������������������������������������������������������490
Test-Driven Development����������������������������������������������������������������������������492
Summary����������������������������������������������������������������������������������������������������������493

Index�������������������������������������������������������������������������������������������������495

xiv
About the Authors
Shantanu Baruah is an Executive Vice
President leading new business acquisition
in the Life Sciences and Healthcare business
at HCL Technologies. With over 21+ years
of experience across multiple disciplines,
Shantanu has been a pioneer in the fields
of healthcare, life sciences, and digital and
information technology at HCL Technologies.
His leadership has guided delivery, practice
building, and development of market-leading
solutions to reach new heights. A leader
with global exposure, Shantanu has successfully led teams across India,
Singapore, France, and the United States. His technological expertise
and innovative leadership qualities have placed him at the forefront
of important business acquisitions. Shantanu is active in the App
development community and has an approved App on Apple App Store.
He has been recognized as one of the top 25 Healthcare IT Executives of
2020 by the IT Services Report. He is also recognized as one of the Top 50
Healthcare Leaders in Consulting by The Consulting Report Magazine in
August 2022. Shantanu lives in New Jersey. His philanthropic outreach
includes education for children in developing nations.

xv
Discovering Diverse Content Through
Random Scribd Documents
ARTICLE L.
When the agents and counsel of the parties have submitted
all explanations and evidence in support of their case, the
President pronounces the discussion closed.

ARTICLE LI.
The deliberations of the Tribunal take place in private.
Every decision is taken by a majority of members of the
Tribunal. The refusal of a member to vote must be recorded
in the "procès-verbal."

ARTICLE LII.
The award, given by a majority of votes, is accompanied by
a statement of reasons. It is drawn up in writing and
signed by each member of the Tribunal. Those members who
are in the minority may record their dissent when signing.

ARTICLE LIII.
The award is read out at a public meeting of the Tribunal,
the agents and counsel of the parties being present, or
duly summoned to attend.

{359}

ARTICLE LIV.
The award, duly pronounced and notified to the agents of
the parties at variance, puts an end to the dispute
definitely and without appeal.

ARTICLE LV.
The parties can reserve in the "Compromis" the right to
demand the revision of the award. In this case, and unless
there be an agreement to the contrary, the demand must be
addressed to the Tribunal which pronounced the award. It
can only be made on the ground of the discovery of some new
fact calculated to exercise a decisive influence on the
award, and which, at the time the discussion was closed,
was unknown to the Tribunal and to the party demanding the
revision. Proceedings for revision can only be instituted
by a decision of the Tribunal expressly recording the
existence of the new fact, recognizing in it the character
described in the foregoing paragraph, and declaring the
demand admissible on this ground. The "Compromis" fixes the
period within which the demand for revision must be made.

ARTICLE LVI.
The award is only binding on the parties who concluded the
"Compromis." When there is a question of interpreting a
Convention to which Powers other than those concerned in
the dispute are parties, the latter notify to the former
the "Compromis" they have concluded. Each of these Powers
has the right to intervene in the case. If one or more of
them avail themselves of this right, the interpretation
contained in the award is equally binding on them.

ARTICLE LVII.
Each party pays its own expenses and an equal share of
those of the Tribunal.

General Provisions.

ARTICLE LVIII.
The present Convention shall be ratified as speedily as
possible. The ratification shall be deposited at The Hague.
A "procès-verbal" shall be drawn up recording the receipt
of each ratification, and a copy duly certified shall be
sent, through the diplomatic channel, to all the Powers who
were represented at the International Peace Conference at
The Hague.

ARTICLE LIX.
The non-Signatory Powers who were represented at the
International Peace Conference can adhere to the present
Convention. For this purpose they must make known their
adhesion to the Contracting Powers by a written
notification addressed to the Netherland Government, and
communicated by it to all the other Contracting Powers.

ARTICLE LX.
The conditions on which the Powers who were not represented
at the International Peace Conference can adhere to the
present Convention shall form the subject of a subsequent
Agreement among the Contracting Powers.

ARTICLE LXI.
In the event of one of the High Contracting Parties
denouncing the present Convention, this denunciation would
not take effect until a year after its notification made in
writing to the Netherland Government, and by it
communicated at once to all the other Contracting Powers.
This denunciation shall on]y affect the notifying Power. In
faith of which the Plenipotentiaries have signed the
present Convention and affixed their seals to it. Done at
The Hague, the 29th July, 1899, in a single copy, which
shall remain in the archives of the Netherland Government,
and copies of it, duly certified, be sent through the
diplomatic channel to the Contracting Powers.
United States, 56th Congress,
1st Session., Senate Document 159.

PEACE CONFERENCE:
The Permanent Court of Arbitration.

The following is the membership of the Permanent Court of


Arbitration, as finally organized, in January, 1901, and
announced to be prepared for the consideration of any
international dispute that may be submitted to it. Fifteen of
the greater nations of the world are represented in this most
august tribunal that has ever sat for judgment of the disputes
of men:

Austria-Hungary.

His Excellency Count Frederic Schonborn, LL. D., president


of the Imperial Royal Court of Administrative Justice,
former Austrian Minister of Justice, member of the House of
Lords of the Austrian Parliament, etc.

His Excellency Mr. D. de Szilagyi, ex-Minister of Justice,


member of the House of Deputies of the Hungarian
Parliament.

Count Albert Apponyi, member of the Chamber of Magnates and


of the Chamber of Deputies of the Hungarian Parliament,
etc.

Mr. Henri Lammasch, LL. D., member of the House of Lords of


the Austrian Parliament, etc.

Belgium.

His Excellency Mr. Beernaert, Minister of State, member of


the Chamber of Representatives, etc.
His Excellency Baron Lambermont, Minister of State, Envoy
Extraordinary and Minister Plenipotentiary,
Secretary-General of the Ministry of Foreign Affairs.

The Chevalier Descamps, Senator.

Mr. Rolin Jacquemyns, ex-Minister of the Interior.

Denmark.

Professor H. Matzen, LL. D., Professor of the Copenhagen


University, Counsellor Extraordinary of the Supreme Court,
President of the Landsthing.

France.

M. Leon Bourgeois, Deputy, ex-President of the Cabinet


Council, ex-Minister for Foreign Affairs.

M. de Laboulaye, ex-Ambassador.

Baron Destournelles de Constant, Minister Plenipotentiary,


Deputy.

M. Louis Renault, Minister Plenipotentiary, Professor in


the Faculty of Law at Paris, Law Office of the Department
of Foreign Affairs.

Germany.

His Excellency Mr. Bingner, LL. D., Privy Councillor,


Senate President of the Imperial High Court at Leipsic.

Mr. von Frantzius, Privy Councillor, Solicitor of the


Department of Foreign Affairs at Berlin.
Mr. von Martitz, LL. D., Associate Justice of the Superior
Court of Administrative Justice in Prussia, Professor of
Law at the Berlin University.

Mr. von Bar, LL. D., Judicial Privy Councillor, Professor


of Law at the Göttingen University.

Great Britain.

His Excellency the Right Honorable Lord Pauncefote of


Preston, G. C. B., G. C. M. G., Privy Councillor,
Ambassador at Washington.

The Right Honorable Sir Edward Baldwin Malet,


ex-Ambassador.

The Right Honorable Sir Edward Fry, member of the Privy


Council, Q. C.

Professor John Westlake, LL. D., Q. C.

Italy.

His Excellency Count Constantin Nigra, Senator of the


Kingdom, Ambassador at Vienna.

His Excellency Commander Jean Baptiste Pagano


Guarnaschelli, Senator of the Kingdom, First President of
the Court of Cassation at Rome.

His Excellency Count Tornielli Brusati di Vergano, Senator


of the Kingdom, Ambassador at Paris.

Commander Joseph Zanardelli, Attorney at Law, Deputy to the


National Parliament.

{360}
Japan.
Mr. Motono, Envoy Extraordinary and Minister
Plenipotentiary at Brussels.

Mr. H. Willard Denison, Law Officer of the Minister for


Foreign Affairs at Tokio.

Netherlands.
Mr. T. M. C. Asser, LL. D., member of the Council of
State, ex-Professor of the University of Amsterdam.

Mr. F. B. Coninck Liefsting, LL. D.,


President of the Court of Cassation.

Jonkheer A. F. de Savornin Lohman, LL. D.,


ex-Minister of the Interior, ex-Professor of the Free
University of Amsterdam, member of the Lower House of the
States-General.

Jonkheer G. L. M. H. Ruis de Beerenbrouck,


ex-Minister of Justice, Commissioner of the Queen in the
Province of Limbourg.

Portugal.
Count de Macedo, Peer of the Realm,
ex-Minister of Marine and Colonies, Envoy Extraordinary and
Minister Plenipotentiary at Madrid.

Rumania.
Mr. Theodore Rosetti, Senator,
ex-President of the High Court of Cassation and Justice.

Mr. Jean Kalindero, Administrator of the Crown Domain,


ex-Judge of the High Court of Cassation and Justice.

Mr. Eugene Statsco,


ex-President of the Senate, ex-Minister of Justice and
Foreign Affairs.

Mr. Jean N. Lahovari, Deputy, ex-Envoy Extraordinary and


Minister Plenipotentiary, ex-Minister of Foreign Affairs.

Russia.
Mr. N. V. Mouravieff, Minister of Justice, Active Privy
Councillor, Secretary of State of His Majesty the Emperor.

Mr. C. P. Pobedonostzeff, Attorney-General of the Most


Holy Synod, Active Privy Councillor, Secretary of State of
His Majesty the Emperor.

Mr. E. V. Frisch,
President of the Department of Legislation of the Imperial
Council, Active Privy Councillor, Secretary of State of His
Majesty the Emperor.

Mr. de Martens, Privy Councillor,


permanent member of the Council of the Ministry of Foreign
Affairs.

Spain.
His Excellency the Duke of Tetuan,
ex-Minister of Foreign Affairs, Senator of the Kingdom,
Grandee of Spain.

Mr. Bienvenido Oliver,


Director-General of the Ministry of Justice, ex-Delegate of
Spain to the Conference on Private International Law at The
Hague.

Dr. Manuel Torres Campos,


Professor of international law at the University of
Grenada, associate member of the Institute of International
Law.
Sweden and Norway.
Mr. S. R D. K. D'Olivecrona,
member of the International Law Institute, ex-Associate
Justice of the Supreme Court of the Kingdom of Sweden,
Doctor of Laws and Letters at Stockholm.

Mr. G. Gram,
ex-Minister of State of Norway, Governor of the Province of
Hamar, Norway.

United States.
Mr. Benjamin Harrison,
ex-President of the United States.

Mr. Melville W. Fuller,


Chief Justice of the United States.

Mr. John W. Griggs,


Attorney-General of the United States.

Mr. George Gray,


United States Circuit Judge.
First Secretary of the Court

J. J. Rochussen.
Second Secretary of the Court

Jonkheer W. Roell.

The Administrative Council consists of the Minister of Foreign


Affairs of the Netherlands and the diplomatic representatives
at The Hague of the ratifying Powers.

Secretary-General
Mr. R Melvil, Baron Van Leyden,
Judge of the District Court of Utrecht and a member of the
First Chamber of the States-General.

PEACE CONFERENCE:
Convention with respect to the Laws and Customs of
War on Land.

ARTICLE I.
The High Contracting Parties shall issue instructions to their
armed land forces, which shall be in conformity with the
"Regulations respecting the Laws and Customs of War on Land"
annexed to the present Convention.

ARTICLE II.
The provisions contained in the Regulations mentioned in
Article I. are only binding on the Contracting Powers, in case
of war between two or more of them. These provisions shall
cease to be binding from the time when, in a war between
Contracting Powers, a non-Contracting Power joins one of the
belligerents.

ARTICLE III.
The present Convention shall be ratified as speedily as
possible. The ratifications shall be deposited at The Hague. A
"procès-verbal" shall be drawn up recording the receipt of
each ratification, and a copy, duly certified, shall be sent
through the diplomatic channel, to all the Contracting Powers.

ARTICLE IV.
Non-Signatory Powers are allowed to adhere to the present
Convention. For this purpose they must make their adhesion
known to the Contracting Powers by means of a written
notification addressed to the Netherland Government, and by it
communicated to all the other Contracting Powers.

ARTICLE V.
In the event of one of the High Contracting Parties denouncing
the present Convention, such denunciation would not take
effect until a year after the written notification made to the
Nethterland Government, and by it at once communicated to all
the other Contracting Powers. This denunciation shall affect
only the notifying Power.

In faith of which the Plenipotentiaries have signed the


present Convention and affixed their seals thereto.

[Signed by representatives of Belgium, Denmark, Spain, Mexico,


France, Greece, Montenegro, the Netherlands, Persia, Portugal,
Roumania, Russia, Siam, Sweden and Norway, and Bulgaria.]

REGULATIONS.

SECTION I.
On Belligerents.

CHAPTER I.
On the qualifications of Belligerents.

ARTICLE I.
The laws, rights, and duties of war apply not only to armies,
but also to militia and volunteer corps, fulfilling the
following conditions:

1. To be commanded by a person responsible for his


subordinates;

2. To have a fixed distinctive emblem recognizable at a


distance;

3. To carry arms openly; and,

4. To conduct their operations in accordance with the laws


and customs of war. In countries where militia or volunteer
corps constitute the army, or form part of it, they are
included under the denomination "army."

ARTICLE II.
The population of a territory which has not been occupied who,
on the enemy's approach, spontaneously take up arms to resist
the invading troops without having time to organize themselves
in accordance with Article I, shall be regarded a belligerent,
if they respect the laws and customs of war.

ARTICLE III.
The armed forces of the belligerent parties may consist of
combatants and non-combatants. In case of capture by the enemy
both have a right to be treated as prisoners of war.

{361}

CHAPTER II.
On Prisoners of War.

ARTICLE IV.
Prisoners of war are in the power of the hostile Government,
but not in that of the individuals or corps who captured them.
They must be humanely treated. All their personal belongings,
except arms, horses, and military papers remain their
property.

ARTICLE V.
Prisoners of war may be interned in a town, fortress, camp, or
any other locality, and bound not to go beyond certain fixed
limits; but they can only be confined as an indispensable
measure of safety.

ARTICLE VI.
The State may utilize the labour of prisoners of war according
to their rank and aptitude. Their tasks shall not be
excessive, and shall have nothing to do with the military
operations. Prisoners may be authorized to work for the Public
Service, for private persons, or on their own account. Work
done for the State shall be paid for according to the tariffs
in force for soldiers of the national army employed on similar
tasks. When the work is for other branches of the Public
Service or for private persons, the conditions shall be
settled in agreement with the military authorities. The wages
of the prisoners shall go towards improving their position,
and the balance shall be paid them at the time of their
release, after deducting the cost of their maintenance.

ARTICLE VII.
The Government into whose hands prisoners of war have fallen
is bound to maintain them. Failing a special agreement between
the belligerents, prisoners of war shall be treated as regards
food, quarters, and clothing, on the same footing as the
troops of the Government which has captured them.

ARTICLE VIII.
Prisoners of war shall be subject to the laws, regulations,
and orders in force in the army of the State into whose hands
they have fallen. Any act of insubordination warrants the
adoption, as regards them, of such measures of severity as may
be necessary. Escaped prisoners, recaptured before they have
succeeded in rejoining their army, or before quitting the
territory occupied by the army that captured them, are liable
to disciplinary punishment. Prisoners who, after succeeding in
escaping, are again taken prisoners, are not liable to any
punishment for the previous flight.

ARTICLE IX.
Every prisoner of war, if questioned, is bound to declare his
true name and rank, and if he disregards this rule, he is
liable to a curtailment of the advantages accorded to the
prisoners of war of his class.

ARTICLE X.
Prisoners of war may be set at liberty on parole if the laws
of their country authorize it, and, in such a case, they are
bound, on their personal honour, scrupulously to fulfil, both
as regards their own Government and the Government by whom
they were made prisoners, the engagements they have
contracted. In such cases, their own Government shall not
require of nor accept from them any service incompatible with
the parole given.

ARTICLE XI.
A prisoner of war cannot be forced to accept his liberty on
parole; similarly the hostile Government is not obliged to
assent to the prisoner's request to be set at liberty on
parole.

ARTICLE XII.
Any prisoner of war, who is liberated on parole and
recaptured, bearing arms against the Government to whom he had
pledged his honour, or against the allies of that Government,
forfeits his right to be treated as a prisoner of war, and can
be brought before the Courts.

ARTICLE XIII.
Individuals who follow an army without directly belonging to
it, such as newspaper correspondents and reporters, sutlers,
contractors, who fall into the enemy's hands, and whom the
latter think fit to detain, have a right to be treated as
prisoners of war, provided they can produce a certificate from
the military authorities of the army they were accompanying.

ARTICLE XIV.
A Bureau for information relative to prisoners of war is
instituted, on the commencement of hostilities, in each of the
belligerent States and, when necessary, in the neutral
countries on whose territory belligerents have been received.
This Bureau is intended to answer all inquiries about
prisoners of war, and is furnished by the various services
concerned with all the necessary information to enable it to
keep an individual return for each prisoner of war. It is kept
informed of internments and changes, as well as of admissions
into hospital and deaths. It is also the duty of the
Information Bureau to receive and collect all objects of
personal use, valuables, letters, &c., found on the
battlefields or left by prisoners who have died in hospital or
ambulance, and to transmit them to those interested.

ARTICLE XV.
Relief Societies for prisoners of war, which are regularly
constituted in accordance with the law of the country with the
object of serving as the intermediary for charity, shall
receive from the belligerents for themselves and their duly
accredited agents every facility, within the bounds of
military requirements and Administrative Regulations, for the
effective accomplishment of their humane task. Delegates of
these Societies may be admitted to the places of internment
for the distribution of relief, as also to the halting places
of repatriated prisoners, if furnished with a personal permit
by the military authorities, and on giving an engagement in
writing to comply with all their Regulations for order and
police.

ARTICLE XVI.
The Information Bureau shall have the privilege of free
postage. Letters, money orders, and valuables, as well as
postal parcels destined for the prisoners of war or despatched
by them, shall be free of all postal duties, both in the
countries of origin and destination, as well as in those they
pass through. Gifts and relief in kind for prisoners of war
shall be admitted free of all duties of entry and others, as
well as of payments for carriage by the Government rail ways.

ARTICLE XVII.
Officers taken prisoners may receive, if necessary, the full
pay allowed them in this position by their country's
regulations, the amount to be repaid by their Government.
ARTICLE XVIII.
Prisoners of war shall enjoy every latitude in the exercise of
their religion, including attendance at their own church
services, provided only they comply with the regulations for
order and police issued by the military authorities.

ARTICLE XIX.
The wills of prisoners of war are received or drawn up on the
same conditions as for soldiers of the national army. The same
rules shall be observed regarding death certificates, as well as
for the burial of prisoners of war, due regard being paid to
their grade and rank.

{362}

ARTICLE XX.
After the conclusion of peace, the repatriation of prisoners
of war shall take place as speedily as possible.

CHAPTER III.
On the Sick and Wounded.

ARTICLE XXI.
The obligations of belligerents with regard to the sick and
wounded are governed by the Geneva Convention of the 22d
August, 1864, subject to any modifications which may be
introduced into it.

SECTION II.
On Hostilities.

CHAPTER I.
On means of injuring the Enemy, Sieges: and Bombardments.

ARTICLE XXII.
The right of belligerents to adopt means of injuring the enemy
is not unlimited.

ARTICLE XXIII.
Besides the prohibitions provided
by special Conventions, it is especially prohibited:

(a.) To employ poison or poisoned arms;

(b.) To kill or wound treacherously individuals belonging


to the hostile nation or army;

(c.) To kill or wound an enemy who, having laid down arms,


or having no longer means of defence, has surrendered at
discretion;

(d.) To declare that no quarter will be given;

(e.) To employ arms, projectiles, or material of a nature


to cause superfluous injury;

(f.) To make improper use of a flag of truce, the national


flag, or military ensigns and the enemy's uniform, as well
as the distinctive badges of the Geneva Convention;

(g.) To destroy or seize the enemy's property, unless such


destruction or seizure be imperatively demanded by the
necessities of war.

ARTICLE XXIV.
Ruses of war and the employment of methods necessary to obtain
information about the enemy and the country, are considered
allowable.

ARTICLE XXV.
The attack or bombardment of towns, villages, habitations or
buildings which are not defended, is prohibited.
ARTICLE XXVI.
The Commander of an attacking force, before commencing a
bombardment, except in the case of an assault, should do all
he can to warn the authorities.

ARTICLE XXVII.
In sieges and bombardments all necessary steps should be taken
to spare as far as possible edifices devoted to religion, art,
science, and charity, hospitals, and places where the sick and
wounded are collected, provided they are not used at the same
time for military purposes. The besieged should indicate these
buildings or places by some particular and visible signs,
which should previously be notified to the assailants.

ARTICLE XXVIII.
The pillage of a town or place, even when taken by assault, is
prohibited.

CHAPTER II.
On Spies.

ARTICLE XXIX.
An individual can only be considered a spy if, acting
clandestinely, or on false pretences, he obtains, or seeks to
obtain information in the zone of operations of a belligerent,
with the intention of communicating it to the hostile party.
Thus, soldiers not in disguise who have penetrated into the
zone of operations of a hostile army to obtain information are
not considered spies. Similarly, the following are not
considered spies: soldiers or civilians, carrying out their
mission openly, charged with the delivery of despatches
destined either for their own army or for that of the enemy.
To this class belong likewise individuals sent in balloons to
deliver despatches, and generally to maintain communication
between the various parts of an army or a territory.

ARTICLE XXX.
A spy taken in the act cannot be punished without previous
trial.

ARTICLE XXXI.
A spy who, after rejoining the army to which he belongs, is
subsequently captured by the enemy, is treated as a prisoner
of war, and incurs no responsibility for his previous acts of
espionage.

CHAPTER III.
On Flags of Truce.

ARTICLE XXXII.
An individual is considered as bearing a flag of truce who is
authorized by one of the belligerents to enter into
communication with the other, and who carries a white flag. He
has a right to inviolability, as well as the trumpeter,
bugler, or drummer, the flag-bearer, and the interpreter who
may accompany him.

ARTICLE XXXIII.
The Chief to whom a flag of truce is sent is not obliged to
receive it in all circumstances. He can take all steps
necessary to prevent the envoy taking advantage of his mission
to obtain information. In case of abuse, he has the right to
detain the envoy temporarily.

ARTICLE XXXIV.
The envoy loses his rights of inviolability if it is proved
beyond doubt that he has taken advantage of his privileged
position to provoke or commit an act of treachery.

CHAPTER IV.
On Capitulations.

ARTICLE XXXV.
Capitulations agreed on between the Contracting Parties must
be in accordance with the rules of military honour. When once
settled, they must be scrupulously observed by both the
parties.

CHAPTER V.
On Armistices.

ARTICLE XXXVI.
An armistice suspends military operations by mutual agreement
between the belligerent parties. If its duration is not fixed,
the belligerent parties can resume operations at any time,
provided always the enemy is warned within the time agreed
upon, in accordance with the terms of the armistice.

ARTICLE XXXVII.
An armistice may be general or local. The first suspends all
military operations of the belligerent States; the second,
only those between certain fractions of the belligerent armies
and in a fixed radius.

ARTICLE XXXVIII.
An armistice must be notified officially, and in good time, to
the competent authorities and the troops. Hostilities are
suspended immediately lifter the notification, or at a fixed
date.

ARTICLE XXXIX.
It is for the Contracting Parties to settle, in the terms of
the armistice, what communications may be held, on the theatre
of war, with the population and with each other.

ARTICLE XL.
Any serious violation of the armistice by one of the parties
gives the other party the right to denounce it, and even, in
case of urgency, to recommence hostilities at once.

ARTICLE XLI.
Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade

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.

Let us accompany you on the journey of exploring knowledge and


personal growth!

ebookmass.com

You might also like