Repository: RefactoringGuru/design-patterns-swift
Branch: main
Commit: 16ee19fb9046
Files: 182
Total size: 516.2 KB
Directory structure:
gitextract_bw7a_rjj/
├── .gitignore
├── LICENSE.txt
├── ProjectBundle/
│ └── Info.plist
├── RefactoringGuru.Patterns.xcodeproj/
│ ├── project.pbxproj
│ ├── project.xcworkspace/
│ │ ├── contents.xcworkspacedata
│ │ └── xcshareddata/
│ │ └── IDEWorkspaceChecks.plist
│ └── xcshareddata/
│ └── xcschemes/
│ ├── AbstractFactoryConceptual.xcscheme
│ ├── AbstractFactoryRealWorld.xcscheme
│ ├── AdapterConceptual.xcscheme
│ ├── AdapterRealWorld.xcscheme
│ ├── BridgeConceptual.xcscheme
│ ├── BridgeRealWorld.xcscheme
│ ├── BuilderConceptual.xcscheme
│ ├── BuilderRealWorld.xcscheme
│ ├── ChainOfResponsibilityConceptual.xcscheme
│ ├── ChainOfResponsibilityRealWorld.xcscheme
│ ├── CommandConceptual.xcscheme
│ ├── CommandRealWorld.xcscheme
│ ├── CompositeConceptual.xcscheme
│ ├── CompositeRealWorld.xcscheme
│ ├── DecoratorConceptual.xcscheme
│ ├── DecoratorRealWorld.xcscheme
│ ├── FacadeConceptual.xcscheme
│ ├── FacadeRealWorld.xcscheme
│ ├── FactoryMethodConceptual.xcscheme
│ ├── FactoryMethodRealWorld.xcscheme
│ ├── FlyweightConceptual.xcscheme
│ ├── FlyweightRealWorld.xcscheme
│ ├── IteratorConceptual.xcscheme
│ ├── IteratorRealWorld.xcscheme
│ ├── MediatorConceptual.xcscheme
│ ├── MediatorRealWorld.xcscheme
│ ├── MementoConceptual.xcscheme
│ ├── MementoRealWorld.xcscheme
│ ├── ObserverConceptual.xcscheme
│ ├── ObserverRealWorld.xcscheme
│ ├── PrototypeConceptual.xcscheme
│ ├── PrototypeRealWorld.xcscheme
│ ├── ProxyConceptual.xcscheme
│ ├── ProxyRealWorld.xcscheme
│ ├── SingletonConceptual.xcscheme
│ ├── SingletonRealWorld.xcscheme
│ ├── StateConceptual.xcscheme
│ ├── StateRealWorld.xcscheme
│ ├── StrategyConceptual.xcscheme
│ ├── StrategyRealWorld.xcscheme
│ ├── TemplateMethodConceptual.xcscheme
│ ├── TemplateMethodRealWorld.xcscheme
│ ├── VisitorConceptual.xcscheme
│ └── VisitorRealWorld.xcscheme
└── Sources/
├── AbstractFactory/
│ ├── Conceptual/
│ │ ├── Example.swift
│ │ ├── Info.plist
│ │ └── Output.txt
│ └── RealWorld/
│ ├── Example.swift
│ ├── Info.plist
│ └── Output.txt
├── Adapter/
│ ├── Conceptual/
│ │ ├── Example.swift
│ │ ├── Info.plist
│ │ └── Output.txt
│ └── RealWorld/
│ ├── Example.swift
│ ├── Info.plist
│ └── Output.txt
├── Bridge/
│ ├── Conceptual/
│ │ ├── Example.swift
│ │ ├── Info.plist
│ │ └── Output.txt
│ └── RealWorld/
│ ├── Example.swift
│ ├── Info.plist
│ └── Output.txt
├── Builder/
│ ├── Conceptual/
│ │ ├── Example.swift
│ │ ├── Info.plist
│ │ └── Output.txt
│ └── RealWorld/
│ ├── Example.swift
│ ├── Info.plist
│ └── Output.txt
├── ChainOfResponsibility/
│ ├── Conceptual/
│ │ ├── Example.swift
│ │ ├── Info.plist
│ │ └── Output.txt
│ └── RealWorld/
│ ├── Example.swift
│ ├── Info.plist
│ └── Output.txt
├── Command/
│ ├── Conceptual/
│ │ ├── Example.swift
│ │ ├── Info.plist
│ │ └── Output.txt
│ └── RealWorld/
│ ├── Example.swift
│ ├── Info.plist
│ └── Output.txt
├── Composite/
│ ├── Conceptual/
│ │ ├── Example.swift
│ │ ├── Info.plist
│ │ └── Output.txt
│ └── RealWorld/
│ ├── Example.swift
│ ├── Info.plist
│ └── Output.txt
├── Decorator/
│ ├── Conceptual/
│ │ ├── Example.swift
│ │ ├── Info.plist
│ │ └── Output.txt
│ └── RealWorld/
│ ├── Example.swift
│ ├── Info.plist
│ └── Output.txt
├── Facade/
│ ├── Conceptual/
│ │ ├── Example.swift
│ │ ├── Info.plist
│ │ └── Output.txt
│ └── RealWorld/
│ ├── Example.swift
│ ├── Info.plist
│ └── Output.txt
├── FactoryMethod/
│ ├── Conceptual/
│ │ ├── Example.swift
│ │ ├── Info.plist
│ │ └── Output.txt
│ └── RealWorld/
│ ├── Example.swift
│ ├── Info.plist
│ └── Output.txt
├── Flyweight/
│ ├── Conceptual/
│ │ ├── Example.swift
│ │ ├── Info.plist
│ │ └── Output.txt
│ └── RealWorld/
│ ├── Example.swift
│ ├── Info.plist
│ └── Output.txt
├── Iterator/
│ ├── Conceptual/
│ │ ├── Example.swift
│ │ ├── Info.plist
│ │ └── Output.txt
│ └── RealWorld/
│ ├── Example.swift
│ ├── Info.plist
│ └── Output.txt
├── Mediator/
│ ├── Conceptual/
│ │ ├── Example.swift
│ │ ├── Info.plist
│ │ └── Output.txt
│ └── RealWorld/
│ ├── Example.swift
│ ├── Info.plist
│ └── Output.txt
├── Memento/
│ ├── Conceptual/
│ │ ├── Example.swift
│ │ ├── Info.plist
│ │ └── Output.txt
│ └── RealWorld/
│ ├── Example.swift
│ ├── Info.plist
│ └── Output.txt
├── Observer/
│ ├── Conceptual/
│ │ ├── Example.swift
│ │ ├── Info.plist
│ │ └── Output.txt
│ └── RealWorld/
│ ├── Example.swift
│ ├── Info.plist
│ └── Output.txt
├── Prototype/
│ ├── Conceptual/
│ │ ├── Example.swift
│ │ ├── Info.plist
│ │ └── Output.txt
│ └── RealWorld/
│ ├── Example.swift
│ ├── Info.plist
│ └── Output.txt
├── Proxy/
│ ├── Conceptual/
│ │ ├── Example.swift
│ │ ├── Info.plist
│ │ └── Output.txt
│ └── RealWorld/
│ ├── Example.swift
│ ├── Info.plist
│ └── Output.txt
├── Singleton/
│ ├── Conceptual/
│ │ ├── Example.swift
│ │ ├── Info.plist
│ │ └── Output.txt
│ └── RealWorld/
│ ├── Example.swift
│ ├── Info.plist
│ └── Output.txt
├── State/
│ ├── Conceptual/
│ │ ├── Example.swift
│ │ ├── Info.plist
│ │ └── Output.txt
│ └── RealWorld/
│ ├── Example.swift
│ ├── Info.plist
│ └── Output.txt
├── Strategy/
│ ├── Conceptual/
│ │ ├── Example.swift
│ │ ├── Info.plist
│ │ └── Output.txt
│ └── RealWorld/
│ ├── Example.swift
│ ├── Info.plist
│ └── Output.txt
├── TemplateMethod/
│ ├── Conceptual/
│ │ ├── Example.swift
│ │ ├── Info.plist
│ │ └── Output.txt
│ └── RealWorld/
│ ├── Example.swift
│ ├── Info.plist
│ └── Output.txt
└── Visitor/
├── Conceptual/
│ ├── Example.swift
│ ├── Info.plist
│ └── Output.txt
└── RealWorld/
├── Example.swift
├── Info.plist
└── Output.txt
================================================
FILE CONTENTS
================================================
================================================
FILE: .gitignore
================================================
# Xcode
#
build/
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
xcuserdata
*.xccheckout
*.moved-aside
DerivedData
*.hmap
*.ipa
*.xcuserstate
*.gcno
*.gcda
.DS_Store
#markdown files
*.md
*.mlmodel
fastlane/report.xml
Pods/
.idea
================================================
FILE: LICENSE.txt
================================================
Refactoring.Guru: Design Patterns in Swift
© by Eremenko Maxim and Alexander Shvets
This work is licensed under a
Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License.
You should have received a copy of the license along with this
work. If not, see .
=======================================================================
Attribution-NonCommercial-NoDerivatives 4.0 International
=======================================================================
Creative Commons Corporation ("Creative Commons") is not a law firm and
does not provide legal services or legal advice. Distribution of
Creative Commons public licenses does not create a lawyer-client or
other relationship. Creative Commons makes its licenses and related
information available on an "as-is" basis. Creative Commons gives no
warranties regarding its licenses, any material licensed under their
terms and conditions, or any related information. Creative Commons
disclaims all liability for damages resulting from their use to the
fullest extent possible.
Using Creative Commons Public Licenses
Creative Commons public licenses provide a standard set of terms and
conditions that creators and other rights holders may use to share
original works of authorship and other material subject to copyright
and certain other rights specified in the public license below. The
following considerations are for informational purposes only, are not
exhaustive, and do not form part of our licenses.
Considerations for licensors: Our public licenses are
intended for use by those authorized to give the public
permission to use material in ways otherwise restricted by
copyright and certain other rights. Our licenses are
irrevocable. Licensors should read and understand the terms
and conditions of the license they choose before applying it.
Licensors should also secure all rights necessary before
applying our licenses so that the public can reuse the
material as expected. Licensors should clearly mark any
material not subject to the license. This includes other CC-
licensed material, or material used under an exception or
limitation to copyright. More considerations for licensors:
wiki.creativecommons.org/Considerations_for_licensors
Considerations for the public: By using one of our public
licenses, a licensor grants the public permission to use the
licensed material under specified terms and conditions. If
the licensor's permission is not necessary for any reason--for
example, because of any applicable exception or limitation to
copyright--then that use is not regulated by the license. Our
licenses grant only permissions under copyright and certain
other rights that a licensor has authority to grant. Use of
the licensed material may still be restricted for other
reasons, including because others have copyright or other
rights in the material. A licensor may make special requests,
such as asking that all changes be marked or described.
Although not required by our licenses, you are encouraged to
respect those requests where reasonable. More_considerations
for the public:
wiki.creativecommons.org/Considerations_for_licensees
=======================================================================
Creative Commons Attribution-NonCommercial-NoDerivatives 4.0
International Public License
By exercising the Licensed Rights (defined below), You accept and agree
to be bound by the terms and conditions of this Creative Commons
Attribution-NonCommercial-NoDerivatives 4.0 International Public
License ("Public License"). To the extent this Public License may be
interpreted as a contract, You are granted the Licensed Rights in
consideration of Your acceptance of these terms and conditions, and the
Licensor grants You such rights in consideration of benefits the
Licensor receives from making the Licensed Material available under
these terms and conditions.
Section 1 -- Definitions.
a. Adapted Material means material subject to Copyright and Similar
Rights that is derived from or based upon the Licensed Material
and in which the Licensed Material is translated, altered,
arranged, transformed, or otherwise modified in a manner requiring
permission under the Copyright and Similar Rights held by the
Licensor. For purposes of this Public License, where the Licensed
Material is a musical work, performance, or sound recording,
Adapted Material is always produced where the Licensed Material is
synched in timed relation with a moving image.
b. Copyright and Similar Rights means copyright and/or similar rights
closely related to copyright including, without limitation,
performance, broadcast, sound recording, and Sui Generis Database
Rights, without regard to how the rights are labeled or
categorized. For purposes of this Public License, the rights
specified in Section 2(b)(1)-(2) are not Copyright and Similar
Rights.
c. Effective Technological Measures means those measures that, in the
absence of proper authority, may not be circumvented under laws
fulfilling obligations under Article 11 of the WIPO Copyright
Treaty adopted on December 20, 1996, and/or similar international
agreements.
d. Exceptions and Limitations means fair use, fair dealing, and/or
any other exception or limitation to Copyright and Similar Rights
that applies to Your use of the Licensed Material.
e. Licensed Material means the artistic or literary work, database,
or other material to which the Licensor applied this Public
License.
f. Licensed Rights means the rights granted to You subject to the
terms and conditions of this Public License, which are limited to
all Copyright and Similar Rights that apply to Your use of the
Licensed Material and that the Licensor has authority to license.
g. Licensor means the individual(s) or entity(ies) granting rights
under this Public License.
h. NonCommercial means not primarily intended for or directed towards
commercial advantage or monetary compensation. For purposes of
this Public License, the exchange of the Licensed Material for
other material subject to Copyright and Similar Rights by digital
file-sharing or similar means is NonCommercial provided there is
no payment of monetary compensation in connection with the
exchange.
i. Share means to provide material to the public by any means or
process that requires permission under the Licensed Rights, such
as reproduction, public display, public performance, distribution,
dissemination, communication, or importation, and to make material
available to the public including in ways that members of the
public may access the material from a place and at a time
individually chosen by them.
j. Sui Generis Database Rights means rights other than copyright
resulting from Directive 96/9/EC of the European Parliament and of
the Council of 11 March 1996 on the legal protection of databases,
as amended and/or succeeded, as well as other essentially
equivalent rights anywhere in the world.
k. You means the individual or entity exercising the Licensed Rights
under this Public License. Your has a corresponding meaning.
Section 2 -- Scope.
a. License grant.
1. Subject to the terms and conditions of this Public License,
the Licensor hereby grants You a worldwide, royalty-free,
non-sublicensable, non-exclusive, irrevocable license to
exercise the Licensed Rights in the Licensed Material to:
a. reproduce and Share the Licensed Material, in whole or
in part, for NonCommercial purposes only; and
b. produce and reproduce, but not Share, Adapted Material
for NonCommercial purposes only.
2. Exceptions and Limitations. For the avoidance of doubt, where
Exceptions and Limitations apply to Your use, this Public
License does not apply, and You do not need to comply with
its terms and conditions.
3. Term. The term of this Public License is specified in Section
6(a).
4. Media and formats; technical modifications allowed. The
Licensor authorizes You to exercise the Licensed Rights in
all media and formats whether now known or hereafter created,
and to make technical modifications necessary to do so. The
Licensor waives and/or agrees not to assert any right or
authority to forbid You from making technical modifications
necessary to exercise the Licensed Rights, including
technical modifications necessary to circumvent Effective
Technological Measures. For purposes of this Public License,
simply making modifications authorized by this Section 2(a)
(4) never produces Adapted Material.
5. Downstream recipients.
a. Offer from the Licensor -- Licensed Material. Every
recipient of the Licensed Material automatically
receives an offer from the Licensor to exercise the
Licensed Rights under the terms and conditions of this
Public License.
b. No downstream restrictions. You may not offer or impose
any additional or different terms or conditions on, or
apply any Effective Technological Measures to, the
Licensed Material if doing so restricts exercise of the
Licensed Rights by any recipient of the Licensed
Material.
6. No endorsement. Nothing in this Public License constitutes or
may be construed as permission to assert or imply that You
are, or that Your use of the Licensed Material is, connected
with, or sponsored, endorsed, or granted official status by,
the Licensor or others designated to receive attribution as
provided in Section 3(a)(1)(A)(i).
b. Other rights.
1. Moral rights, such as the right of integrity, are not
licensed under this Public License, nor are publicity,
privacy, and/or other similar personality rights; however, to
the extent possible, the Licensor waives and/or agrees not to
assert any such rights held by the Licensor to the limited
extent necessary to allow You to exercise the Licensed
Rights, but not otherwise.
2. Patent and trademark rights are not licensed under this
Public License.
3. To the extent possible, the Licensor waives any right to
collect royalties from You for the exercise of the Licensed
Rights, whether directly or through a collecting society
under any voluntary or waivable statutory or compulsory
licensing scheme. In all other cases the Licensor expressly
reserves any right to collect such royalties, including when
the Licensed Material is used other than for NonCommercial
purposes.
Section 3 -- License Conditions.
Your exercise of the Licensed Rights is expressly made subject to the
following conditions.
a. Attribution.
1. If You Share the Licensed Material, You must:
a. retain the following if it is supplied by the Licensor
with the Licensed Material:
i. identification of the creator(s) of the Licensed
Material and any others designated to receive
attribution, in any reasonable manner requested by
the Licensor (including by pseudonym if
designated);
ii. a copyright notice;
iii. a notice that refers to this Public License;
iv. a notice that refers to the disclaimer of
warranties;
v. a URI or hyperlink to the Licensed Material to the
extent reasonably practicable;
b. indicate if You modified the Licensed Material and
retain an indication of any previous modifications; and
c. indicate the Licensed Material is licensed under this
Public License, and include the text of, or the URI or
hyperlink to, this Public License.
For the avoidance of doubt, You do not have permission under
this Public License to Share Adapted Material.
2. You may satisfy the conditions in Section 3(a)(1) in any
reasonable manner based on the medium, means, and context in
which You Share the Licensed Material. For example, it may be
reasonable to satisfy the conditions by providing a URI or
hyperlink to a resource that includes the required
information.
3. If requested by the Licensor, You must remove any of the
information required by Section 3(a)(1)(A) to the extent
reasonably practicable.
Section 4 -- Sui Generis Database Rights.
Where the Licensed Rights include Sui Generis Database Rights that
apply to Your use of the Licensed Material:
a. for the avoidance of doubt, Section 2(a)(1) grants You the right
to extract, reuse, reproduce, and Share all or a substantial
portion of the contents of the database for NonCommercial purposes
only and provided You do not Share Adapted Material;
b. if You include all or a substantial portion of the database
contents in a database in which You have Sui Generis Database
Rights, then the database in which You have Sui Generis Database
Rights (but not its individual contents) is Adapted Material; and
c. You must comply with the conditions in Section 3(a) if You Share
all or a substantial portion of the contents of the database.
For the avoidance of doubt, this Section 4 supplements and does not
replace Your obligations under this Public License where the Licensed
Rights include other Copyright and Similar Rights.
Section 5 -- Disclaimer of Warranties and Limitation of Liability.
a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE
EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS
AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF
ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS,
IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION,
WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR
PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS,
ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT
KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT
ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU.
b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE
TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION,
NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT,
INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES,
COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR
USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN
ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR
DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR
IN PART, THIS LIMITATION MAY NOT APPLY TO YOU.
c. The disclaimer of warranties and limitation of liability provided
above shall be interpreted in a manner that, to the extent
possible, most closely approximates an absolute disclaimer and
waiver of all liability.
Section 6 -- Term and Termination.
a. This Public License applies for the term of the Copyright and
Similar Rights licensed here. However, if You fail to comply with
this Public License, then Your rights under this Public License
terminate automatically.
b. Where Your right to use the Licensed Material has terminated under
Section 6(a), it reinstates:
1. automatically as of the date the violation is cured, provided
it is cured within 30 days of Your discovery of the
violation; or
2. upon express reinstatement by the Licensor.
For the avoidance of doubt, this Section 6(b) does not affect any
right the Licensor may have to seek remedies for Your violations
of this Public License.
c. For the avoidance of doubt, the Licensor may also offer the
Licensed Material under separate terms or conditions or stop
distributing the Licensed Material at any time; however, doing so
will not terminate this Public License.
d. Sections 1, 5, 6, 7, and 8 survive termination of this Public
License.
Section 7 -- Other Terms and Conditions.
a. The Licensor shall not be bound by any additional or different
terms or conditions communicated by You unless expressly agreed.
b. Any arrangements, understandings, or agreements regarding the
Licensed Material not stated herein are separate from and
independent of the terms and conditions of this Public License.
Section 8 -- Interpretation.
a. For the avoidance of doubt, this Public License does not, and
shall not be interpreted to, reduce, limit, restrict, or impose
conditions on any use of the Licensed Material that could lawfully
be made without permission under this Public License.
b. To the extent possible, if any provision of this Public License is
deemed unenforceable, it shall be automatically reformed to the
minimum extent necessary to make it enforceable. If the provision
cannot be reformed, it shall be severed from this Public License
without affecting the enforceability of the remaining terms and
conditions.
c. No term or condition of this Public License will be waived and no
failure to comply consented to unless expressly agreed to by the
Licensor.
d. Nothing in this Public License constitutes or may be interpreted
as a limitation upon, or waiver of, any privileges and immunities
that apply to the Licensor or You, including from the legal
processes of any jurisdiction or authority.
=======================================================================
Creative Commons is not a party to its public
licenses. Notwithstanding, Creative Commons may elect to apply one of
its public licenses to material it publishes and in those instances
will be considered the “Licensor.” The text of the Creative Commons
public licenses is dedicated to the public domain under the CC0 Public
Domain Dedication. Except for the limited purpose of indicating that
material is shared under a Creative Commons public license or as
otherwise permitted by the Creative Commons policies published at
creativecommons.org/policies, Creative Commons does not authorize the
use of the trademark "Creative Commons" or any other trademark or logo
of Creative Commons without its prior written consent including,
without limitation, in connection with any unauthorized modifications
to any of its public licenses or any other arrangements,
understandings, or agreements concerning use of licensed material. For
the avoidance of doubt, this paragraph does not form part of the
public licenses.
Creative Commons may be contacted at creativecommons.org.
================================================
FILE: ProjectBundle/Info.plist
================================================
CFBundleDevelopmentRegion
$(DEVELOPMENT_LANGUAGE)
CFBundleExecutable
$(EXECUTABLE_NAME)
CFBundleIdentifier
$(PRODUCT_BUNDLE_IDENTIFIER)
CFBundleInfoDictionaryVersion
6.0
CFBundleName
$(PRODUCT_NAME)
CFBundlePackageType
BNDL
CFBundleShortVersionString
1.0
CFBundleVersion
1
================================================
FILE: RefactoringGuru.Patterns.xcodeproj/project.pbxproj
================================================
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 48;
objects = {
/* Begin PBXBuildFile section */
912C5CE2210BC33E007DC364 /* Example.swift in Sources */ = {isa = PBXBuildFile; fileRef = 912C5CE1210BC33E007DC364 /* Example.swift */; };
912C5CEF210BC3A4007DC364 /* Example.swift in Sources */ = {isa = PBXBuildFile; fileRef = 912C5CEE210BC3A4007DC364 /* Example.swift */; };
912C5D05210BC4A5007DC364 /* Example.swift in Sources */ = {isa = PBXBuildFile; fileRef = 912C5D03210BC4A5007DC364 /* Example.swift */; };
912C5D0E210BC4D9007DC364 /* Example.swift in Sources */ = {isa = PBXBuildFile; fileRef = 912C5D0D210BC4D9007DC364 /* Example.swift */; };
912C5D1B210BC553007DC364 /* Example.swift in Sources */ = {isa = PBXBuildFile; fileRef = 912C5D1A210BC553007DC364 /* Example.swift */; };
912C5D27210BC594007DC364 /* Example.swift in Sources */ = {isa = PBXBuildFile; fileRef = 912C5D26210BC594007DC364 /* Example.swift */; };
912C5D33210BC5E1007DC364 /* Example.swift in Sources */ = {isa = PBXBuildFile; fileRef = 912C5D32210BC5E1007DC364 /* Example.swift */; };
912C5D40210BC62D007DC364 /* Example.swift in Sources */ = {isa = PBXBuildFile; fileRef = 912C5D3F210BC62D007DC364 /* Example.swift */; };
912C5D4D210BC6A8007DC364 /* Example.swift in Sources */ = {isa = PBXBuildFile; fileRef = 912C5D4C210BC6A8007DC364 /* Example.swift */; };
912C5D59210BC6F1007DC364 /* Example.swift in Sources */ = {isa = PBXBuildFile; fileRef = 912C5D58210BC6F1007DC364 /* Example.swift */; };
912C5D65210BC749007DC364 /* Example.swift in Sources */ = {isa = PBXBuildFile; fileRef = 912C5D64210BC749007DC364 /* Example.swift */; };
912C5D72210BC7B1007DC364 /* Example.swift in Sources */ = {isa = PBXBuildFile; fileRef = 912C5D71210BC7B1007DC364 /* Example.swift */; };
912C5D7F210BC81E007DC364 /* Example.swift in Sources */ = {isa = PBXBuildFile; fileRef = 912C5D7E210BC81E007DC364 /* Example.swift */; };
912C5D8B210BC865007DC364 /* Example.swift in Sources */ = {isa = PBXBuildFile; fileRef = 912C5D8A210BC865007DC364 /* Example.swift */; };
91301AD520F55C25003B4FC0 /* Example.swift in Sources */ = {isa = PBXBuildFile; fileRef = 91301AD420F55C25003B4FC0 /* Example.swift */; };
91301AE220F55CAA003B4FC0 /* Example.swift in Sources */ = {isa = PBXBuildFile; fileRef = 91301AE120F55CAA003B4FC0 /* Example.swift */; };
919C89FA20DD7F03006EE57D /* Example.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9187BFB220B5D0A600266EF8 /* Example.swift */; };
919C8A0D20DD7F58006EE57D /* Example.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9187BFB620B5D0A600266EF8 /* Example.swift */; };
919C8A1B20DD81E7006EE57D /* Example.swift in Sources */ = {isa = PBXBuildFile; fileRef = 916B889F20BC6E6800BA92DF /* Example.swift */; };
919C8A2820DD829C006EE57D /* Example.swift in Sources */ = {isa = PBXBuildFile; fileRef = 916B88A520BD468100BA92DF /* Example.swift */; };
919C8A4120DD832C006EE57D /* Example.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9187BFDF20B5D0A700266EF8 /* Example.swift */; };
919C8A4E20DD83AA006EE57D /* Example.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9187BFDC20B5D0A700266EF8 /* Example.swift */; };
919C8A6720DD84DB006EE57D /* Example.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9187BFE520B5D0A700266EF8 /* Example.swift */; };
919C8A7520DD85A3006EE57D /* Example.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9187BFE320B5D0A700266EF8 /* Example.swift */; };
919C8A8220DD8698006EE57D /* Example.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9187BFD520B5D0A700266EF8 /* Example.swift */; };
919C8A8F20DD86EB006EE57D /* Example.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9187BFD220B5D0A700266EF8 /* Example.swift */; };
919C8AAA20DD879C006EE57D /* Example.swift in Sources */ = {isa = PBXBuildFile; fileRef = 916B889220BC4DA400BA92DF /* Example.swift */; };
919C8AB220DD87F2006EE57D /* Example.swift in Sources */ = {isa = PBXBuildFile; fileRef = 919C8AB120DD87F2006EE57D /* Example.swift */; };
919C8ACF20DD887F006EE57D /* Example.swift in Sources */ = {isa = PBXBuildFile; fileRef = 916B889A20BC587D00BA92DF /* Example.swift */; };
919C8AD720DD88C6006EE57D /* Example.swift in Sources */ = {isa = PBXBuildFile; fileRef = 919C8AD620DD88C6006EE57D /* Example.swift */; };
919C8AE820DD894F006EE57D /* Example.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9187BFBB20B5D0A600266EF8 /* Example.swift */; };
919C8AF520DD89CE006EE57D /* Example.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9187BFBF20B5D0A600266EF8 /* Example.swift */; };
919C8B0220DD8AB3006EE57D /* Example.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9187BFEE20B5D0A700266EF8 /* Example.swift */; };
919C8B0F20DD8B12006EE57D /* Example.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9187BFEA20B5D0A700266EF8 /* Example.swift */; };
919C8B1C20DD8B70006EE57D /* Example.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9187BFCC20B5D0A700266EF8 /* Example.swift */; };
919C8B2920DD8BC3006EE57D /* Example.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9187BFC920B5D0A700266EF8 /* Example.swift */; };
91B1206E20F610E400730C37 /* Example.swift in Sources */ = {isa = PBXBuildFile; fileRef = 91B1206D20F610E400730C37 /* Example.swift */; };
91B1207A20F6114A00730C37 /* Example.swift in Sources */ = {isa = PBXBuildFile; fileRef = 91B1207920F6114A00730C37 /* Example.swift */; };
91B1208620F611DA00730C37 /* Example.swift in Sources */ = {isa = PBXBuildFile; fileRef = 91B1208520F611DA00730C37 /* Example.swift */; };
91B1209320F6120C00730C37 /* Example.swift in Sources */ = {isa = PBXBuildFile; fileRef = 91B1209220F6120C00730C37 /* Example.swift */; };
91B120A020F6125500730C37 /* Example.swift in Sources */ = {isa = PBXBuildFile; fileRef = 91B1209F20F6125500730C37 /* Example.swift */; };
91B120AC20F6127400730C37 /* Example.swift in Sources */ = {isa = PBXBuildFile; fileRef = 91B120AB20F6127400730C37 /* Example.swift */; };
91B120B920F6130A00730C37 /* Example.swift in Sources */ = {isa = PBXBuildFile; fileRef = 91B120B820F6130A00730C37 /* Example.swift */; };
91B120C520F6132E00730C37 /* Example.swift in Sources */ = {isa = PBXBuildFile; fileRef = 91B120C420F6132E00730C37 /* Example.swift */; };
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
912C5CDF210BC33D007DC364 /* MediatorConceptual.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = MediatorConceptual.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
912C5CE1210BC33E007DC364 /* Example.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Example.swift; sourceTree = ""; };
912C5CE3210BC33E007DC364 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
912C5CEC210BC3A4007DC364 /* MediatorRealWorld.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = MediatorRealWorld.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
912C5CEE210BC3A4007DC364 /* Example.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Example.swift; sourceTree = ""; };
912C5CF0210BC3A4007DC364 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
912C5CF8210BC3F5007DC364 /* MementoConceptual.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = MementoConceptual.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
912C5D03210BC4A5007DC364 /* Example.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Example.swift; sourceTree = ""; };
912C5D04210BC4A5007DC364 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
912C5D0B210BC4D8007DC364 /* MementoRealWorld.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = MementoRealWorld.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
912C5D0D210BC4D9007DC364 /* Example.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Example.swift; sourceTree = ""; };
912C5D0F210BC4D9007DC364 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
912C5D18210BC553007DC364 /* ObserverConceptual.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ObserverConceptual.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
912C5D1A210BC553007DC364 /* Example.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Example.swift; sourceTree = ""; };
912C5D1C210BC553007DC364 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
912C5D24210BC594007DC364 /* ObserverRealWorld.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ObserverRealWorld.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
912C5D26210BC594007DC364 /* Example.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Example.swift; sourceTree = ""; };
912C5D28210BC594007DC364 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
912C5D30210BC5E1007DC364 /* StateConceptual.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = StateConceptual.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
912C5D32210BC5E1007DC364 /* Example.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Example.swift; sourceTree = ""; };
912C5D34210BC5E1007DC364 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
912C5D3D210BC62D007DC364 /* StateRealWorld.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = StateRealWorld.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
912C5D3F210BC62D007DC364 /* Example.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Example.swift; sourceTree = ""; };
912C5D41210BC62D007DC364 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
912C5D4A210BC6A8007DC364 /* StrategyConceptual.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = StrategyConceptual.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
912C5D4C210BC6A8007DC364 /* Example.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Example.swift; sourceTree = ""; };
912C5D4E210BC6A8007DC364 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
912C5D56210BC6F0007DC364 /* StrategyRealWorld.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = StrategyRealWorld.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
912C5D58210BC6F1007DC364 /* Example.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Example.swift; sourceTree = ""; };
912C5D5A210BC6F1007DC364 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
912C5D62210BC749007DC364 /* TemplateMethodConceptual.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = TemplateMethodConceptual.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
912C5D64210BC749007DC364 /* Example.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Example.swift; sourceTree = ""; };
912C5D66210BC749007DC364 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
912C5D6F210BC7B1007DC364 /* TemplateMethodRealWorld.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = TemplateMethodRealWorld.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
912C5D71210BC7B1007DC364 /* Example.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Example.swift; sourceTree = ""; };
912C5D73210BC7B1007DC364 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
912C5D7C210BC81E007DC364 /* VisitorConceptual.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = VisitorConceptual.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
912C5D7E210BC81E007DC364 /* Example.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Example.swift; sourceTree = ""; };
912C5D80210BC81E007DC364 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
912C5D88210BC865007DC364 /* VisitorRealWorld.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = VisitorRealWorld.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
912C5D8A210BC865007DC364 /* Example.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Example.swift; sourceTree = ""; };
912C5D8C210BC865007DC364 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
91301AD220F55C25003B4FC0 /* FlyweightConceptual.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = FlyweightConceptual.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
91301AD420F55C25003B4FC0 /* Example.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Example.swift; sourceTree = ""; };
91301AD620F55C25003B4FC0 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
91301ADF20F55CAA003B4FC0 /* FlyweightRealWorld.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = FlyweightRealWorld.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
91301AE120F55CAA003B4FC0 /* Example.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Example.swift; sourceTree = ""; };
91301AE320F55CAA003B4FC0 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
913E0137210CA53800B7D71E /* Output.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Output.txt; sourceTree = ""; };
913E0139210CA54F00B7D71E /* Output.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Output.txt; sourceTree = ""; };
913E013B210CA55A00B7D71E /* Output.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Output.txt; sourceTree = ""; };
913E013D210CA56000B7D71E /* Output.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Output.txt; sourceTree = ""; };
913E013F210CA57200B7D71E /* Output.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Output.txt; sourceTree = ""; };
913E0141210CA57900B7D71E /* Output.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Output.txt; sourceTree = ""; };
913E0143210CA58300B7D71E /* Output.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Output.txt; sourceTree = ""; };
913E0145210CA58900B7D71E /* Output.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Output.txt; sourceTree = ""; };
913E0147210CA59400B7D71E /* Output.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Output.txt; sourceTree = ""; };
913E0149210CA59A00B7D71E /* Output.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Output.txt; sourceTree = ""; };
913E014B210CA5A200B7D71E /* Output.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Output.txt; sourceTree = ""; };
913E014D210CA5AE00B7D71E /* Output.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Output.txt; sourceTree = ""; };
913E014F210CA5B800B7D71E /* Output.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Output.txt; sourceTree = ""; };
913E0151210CA5BE00B7D71E /* Output.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Output.txt; sourceTree = ""; };
913FF2262097835E00193902 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
916B888F20BC4B1900BA92DF /* Output.txt */ = {isa = PBXFileReference; lastKnownFileType = text; path = Output.txt; sourceTree = ""; };
916B889220BC4DA400BA92DF /* Example.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Example.swift; sourceTree = ""; };
916B889420BC56FD00BA92DF /* Output.txt */ = {isa = PBXFileReference; lastKnownFileType = text; path = Output.txt; sourceTree = ""; };
916B889A20BC587D00BA92DF /* Example.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Example.swift; sourceTree = ""; };
916B889C20BC5B7600BA92DF /* Output.txt */ = {isa = PBXFileReference; lastKnownFileType = text; path = Output.txt; sourceTree = ""; };
916B889F20BC6E6800BA92DF /* Example.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Example.swift; sourceTree = ""; };
916B88A120BC717400BA92DF /* Output.txt */ = {isa = PBXFileReference; lastKnownFileType = text; path = Output.txt; sourceTree = ""; };
916B88A520BD468100BA92DF /* Example.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Example.swift; sourceTree = ""; };
916B88A720BD537300BA92DF /* Output.txt */ = {isa = PBXFileReference; lastKnownFileType = text; path = Output.txt; sourceTree = ""; };
9187BFAB20B5D0A600266EF8 /* Output.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Output.txt; sourceTree = ""; };
9187BFB220B5D0A600266EF8 /* Example.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Example.swift; sourceTree = ""; };
9187BFB420B5D0A600266EF8 /* Output.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Output.txt; sourceTree = ""; };
9187BFB620B5D0A600266EF8 /* Example.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Example.swift; sourceTree = ""; };
9187BFBB20B5D0A600266EF8 /* Example.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Example.swift; sourceTree = ""; };
9187BFBC20B5D0A600266EF8 /* Output.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Output.txt; sourceTree = ""; };
9187BFBF20B5D0A600266EF8 /* Example.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Example.swift; sourceTree = ""; };
9187BFC220B5D0A600266EF8 /* Output.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Output.txt; sourceTree = ""; };
9187BFC820B5D0A700266EF8 /* Output.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Output.txt; sourceTree = ""; };
9187BFC920B5D0A700266EF8 /* Example.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Example.swift; sourceTree = ""; };
9187BFCB20B5D0A700266EF8 /* Output.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Output.txt; sourceTree = ""; };
9187BFCC20B5D0A700266EF8 /* Example.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Example.swift; sourceTree = ""; };
9187BFD220B5D0A700266EF8 /* Example.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Example.swift; sourceTree = ""; };
9187BFD320B5D0A700266EF8 /* Output.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Output.txt; sourceTree = ""; };
9187BFD520B5D0A700266EF8 /* Example.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Example.swift; sourceTree = ""; };
9187BFD820B5D0A700266EF8 /* Output.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Output.txt; sourceTree = ""; };
9187BFDC20B5D0A700266EF8 /* Example.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Example.swift; sourceTree = ""; };
9187BFDE20B5D0A700266EF8 /* Output.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Output.txt; sourceTree = ""; };
9187BFDF20B5D0A700266EF8 /* Example.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Example.swift; sourceTree = ""; };
9187BFE220B5D0A700266EF8 /* Output.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Output.txt; sourceTree = ""; };
9187BFE320B5D0A700266EF8 /* Example.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Example.swift; sourceTree = ""; };
9187BFE520B5D0A700266EF8 /* Example.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Example.swift; sourceTree = ""; };
9187BFE620B5D0A700266EF8 /* Output.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Output.txt; sourceTree = ""; };
9187BFE920B5D0A700266EF8 /* Output.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Output.txt; sourceTree = ""; };
9187BFEA20B5D0A700266EF8 /* Example.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Example.swift; sourceTree = ""; };
9187BFEC20B5D0A700266EF8 /* Output.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Output.txt; sourceTree = ""; };
9187BFEE20B5D0A700266EF8 /* Example.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Example.swift; sourceTree = ""; };
919C89F120DD7EE4006EE57D /* AbstractFactoryRealWorld.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = AbstractFactoryRealWorld.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
919C89F520DD7EE4006EE57D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
919C8A0520DD7F3C006EE57D /* AbstractFactoryConceptual.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = AbstractFactoryConceptual.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
919C8A0920DD7F3C006EE57D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
919C8A1320DD81D0006EE57D /* FacadeConceptual.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = FacadeConceptual.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
919C8A1720DD81D0006EE57D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
919C8A2020DD8261006EE57D /* FacadeRealWorld.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = FacadeRealWorld.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
919C8A2420DD8261006EE57D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
919C8A3920DD82F0006EE57D /* BridgeConceptual.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = BridgeConceptual.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
919C8A3D20DD82F0006EE57D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
919C8A4620DD8393006EE57D /* BridgeRealWorld.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = BridgeRealWorld.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
919C8A4A20DD8393006EE57D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
919C8A5F20DD849A006EE57D /* AdapterConceptual.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = AdapterConceptual.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
919C8A6320DD849B006EE57D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
919C8A6C20DD858C006EE57D /* AdapterRealWorld.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = AdapterRealWorld.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
919C8A7020DD858C006EE57D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
919C8A7A20DD8688006EE57D /* BuilderConceptual.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = BuilderConceptual.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
919C8A7E20DD8688006EE57D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
919C8A8720DD86DC006EE57D /* BuilderRealWorld.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = BuilderRealWorld.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
919C8A8B20DD86DC006EE57D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
919C8AA220DD878D006EE57D /* CompositeConceptual.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = CompositeConceptual.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
919C8AA620DD878E006EE57D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
919C8AAF20DD87F2006EE57D /* CompositeRealWorld.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = CompositeRealWorld.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
919C8AB120DD87F2006EE57D /* Example.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Example.swift; sourceTree = ""; };
919C8AB320DD87F2006EE57D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
919C8AC720DD8873006EE57D /* DecoratorConceptual.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = DecoratorConceptual.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
919C8ACB20DD8873006EE57D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
919C8AD420DD88C6006EE57D /* DecoratorRealWorld.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = DecoratorRealWorld.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
919C8AD620DD88C6006EE57D /* Example.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Example.swift; sourceTree = ""; };
919C8AD820DD88C6006EE57D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
919C8AE020DD893E006EE57D /* FactoryMethodRealWorld.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = FactoryMethodRealWorld.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
919C8AE420DD893E006EE57D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
919C8AED20DD897E006EE57D /* FactoryMethodConceptual.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = FactoryMethodConceptual.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
919C8AF120DD897E006EE57D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
919C8AFA20DD8A98006EE57D /* PrototypeConceptual.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = PrototypeConceptual.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
919C8AFE20DD8A98006EE57D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
919C8B0720DD8AF0006EE57D /* PrototypeRealWorld.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = PrototypeRealWorld.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
919C8B0B20DD8AF0006EE57D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
919C8B1420DD8B59006EE57D /* SingletonConceptual.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = SingletonConceptual.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
919C8B1820DD8B59006EE57D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
919C8B2120DD8BA9006EE57D /* SingletonRealWorld.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = SingletonRealWorld.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
919C8B2520DD8BA9006EE57D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
91B1206220F56BFA00730C37 /* Output.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Output.txt; sourceTree = ""; };
91B1206420F56C0100730C37 /* Output.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Output.txt; sourceTree = ""; };
91B1206B20F610E400730C37 /* ChainOfResponsibilityConceptual.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ChainOfResponsibilityConceptual.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
91B1206D20F610E400730C37 /* Example.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Example.swift; sourceTree = ""; };
91B1206F20F610E400730C37 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
91B1207720F6114A00730C37 /* ChainOfResponsibilityRealWorld.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ChainOfResponsibilityRealWorld.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
91B1207920F6114A00730C37 /* Example.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Example.swift; sourceTree = ""; };
91B1207B20F6114A00730C37 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
91B1208320F611DA00730C37 /* CommandConceptual.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = CommandConceptual.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
91B1208520F611DA00730C37 /* Example.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Example.swift; sourceTree = ""; };
91B1208720F611DA00730C37 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
91B1209020F6120C00730C37 /* CommandRealWorld.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = CommandRealWorld.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
91B1209220F6120C00730C37 /* Example.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Example.swift; sourceTree = ""; };
91B1209420F6120C00730C37 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
91B1209D20F6125500730C37 /* IteratorConceptual.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = IteratorConceptual.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
91B1209F20F6125500730C37 /* Example.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Example.swift; sourceTree = ""; };
91B120A120F6125500730C37 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
91B120A920F6127400730C37 /* IteratorRealWorld.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = IteratorRealWorld.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
91B120AB20F6127400730C37 /* Example.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Example.swift; sourceTree = ""; };
91B120AD20F6127400730C37 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
91B120B620F6130900730C37 /* ProxyConceptual.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ProxyConceptual.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
91B120B820F6130A00730C37 /* Example.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Example.swift; sourceTree = ""; };
91B120BA20F6130A00730C37 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
91B120C220F6132E00730C37 /* ProxyRealWorld.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ProxyRealWorld.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
91B120C420F6132E00730C37 /* Example.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Example.swift; sourceTree = ""; };
91B120C620F6132E00730C37 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
91B120CA20F61BAD00730C37 /* Output.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Output.txt; sourceTree = ""; };
91B120CC20F61BBC00730C37 /* Output.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Output.txt; sourceTree = ""; };
91B120CE20F61BC600730C37 /* Output.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Output.txt; sourceTree = ""; };
91B120D020F61BD000730C37 /* Output.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Output.txt; sourceTree = ""; };
91B120D220F61BDA00730C37 /* Output.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Output.txt; sourceTree = ""; };
91B120D420F61BE300730C37 /* Output.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Output.txt; sourceTree = ""; };
91B120D620F61BE900730C37 /* Output.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Output.txt; sourceTree = ""; };
91B120D820F61BF000730C37 /* Output.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Output.txt; sourceTree = ""; };
91F0DA9520E6552A001F1C1A /* Output.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Output.txt; sourceTree = ""; };
91F0DAAC20E68AAD001F1C1A /* Output.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Output.txt; sourceTree = ""; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
912C5CDC210BC33D007DC364 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
912C5CE9210BC3A4007DC364 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
912C5CF5210BC3F5007DC364 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
912C5D08210BC4D8007DC364 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
912C5D15210BC553007DC364 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
912C5D21210BC594007DC364 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
912C5D2D210BC5E1007DC364 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
912C5D3A210BC62D007DC364 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
912C5D47210BC6A8007DC364 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
912C5D53210BC6F0007DC364 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
912C5D5F210BC749007DC364 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
912C5D6C210BC7B1007DC364 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
912C5D79210BC81E007DC364 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
912C5D85210BC865007DC364 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
91301ACF20F55C25003B4FC0 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
91301ADC20F55CAA003B4FC0 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
919C89EE20DD7EE4006EE57D /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
919C8A0220DD7F3C006EE57D /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
919C8A1020DD81D0006EE57D /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
919C8A1D20DD8261006EE57D /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
919C8A3620DD82F0006EE57D /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
919C8A4320DD8393006EE57D /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
919C8A5C20DD849A006EE57D /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
919C8A6920DD858C006EE57D /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
919C8A7720DD8688006EE57D /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
919C8A8420DD86DC006EE57D /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
919C8A9F20DD878D006EE57D /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
919C8AAC20DD87F2006EE57D /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
919C8AC420DD8873006EE57D /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
919C8AD120DD88C6006EE57D /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
919C8ADD20DD893E006EE57D /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
919C8AEA20DD897E006EE57D /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
919C8AF720DD8A98006EE57D /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
919C8B0420DD8AF0006EE57D /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
919C8B1120DD8B59006EE57D /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
919C8B1E20DD8BA9006EE57D /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
91B1206820F610E400730C37 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
91B1207420F6114A00730C37 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
91B1208020F611DA00730C37 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
91B1208D20F6120C00730C37 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
91B1209A20F6125500730C37 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
91B120A620F6127400730C37 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
91B120B320F6130900730C37 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
91B120BF20F6132E00730C37 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
912C5CE0210BC33D007DC364 /* Conceptual */ = {
isa = PBXGroup;
children = (
912C5CE1210BC33E007DC364 /* Example.swift */,
912C5CE3210BC33E007DC364 /* Info.plist */,
913E0137210CA53800B7D71E /* Output.txt */,
);
path = Conceptual;
sourceTree = "";
};
912C5CE7210BC34E007DC364 /* Mediator */ = {
isa = PBXGroup;
children = (
912C5CE0210BC33D007DC364 /* Conceptual */,
912C5CED210BC3A4007DC364 /* RealWorld */,
);
path = Mediator;
sourceTree = "";
};
912C5CED210BC3A4007DC364 /* RealWorld */ = {
isa = PBXGroup;
children = (
912C5CEE210BC3A4007DC364 /* Example.swift */,
913E0139210CA54F00B7D71E /* Output.txt */,
912C5CF0210BC3A4007DC364 /* Info.plist */,
);
path = RealWorld;
sourceTree = "";
};
912C5D01210BC4A5007DC364 /* Memento */ = {
isa = PBXGroup;
children = (
912C5D02210BC4A5007DC364 /* Conceptual */,
912C5D0C210BC4D9007DC364 /* RealWorld */,
);
path = Memento;
sourceTree = "";
};
912C5D02210BC4A5007DC364 /* Conceptual */ = {
isa = PBXGroup;
children = (
912C5D03210BC4A5007DC364 /* Example.swift */,
913E013B210CA55A00B7D71E /* Output.txt */,
912C5D04210BC4A5007DC364 /* Info.plist */,
);
path = Conceptual;
sourceTree = "";
};
912C5D0C210BC4D9007DC364 /* RealWorld */ = {
isa = PBXGroup;
children = (
912C5D0D210BC4D9007DC364 /* Example.swift */,
913E013D210CA56000B7D71E /* Output.txt */,
912C5D0F210BC4D9007DC364 /* Info.plist */,
);
path = RealWorld;
sourceTree = "";
};
912C5D13210BC53A007DC364 /* Observer */ = {
isa = PBXGroup;
children = (
912C5D19210BC553007DC364 /* Conceptual */,
912C5D25210BC594007DC364 /* RealWorld */,
);
path = Observer;
sourceTree = "";
};
912C5D19210BC553007DC364 /* Conceptual */ = {
isa = PBXGroup;
children = (
912C5D1A210BC553007DC364 /* Example.swift */,
913E013F210CA57200B7D71E /* Output.txt */,
912C5D1C210BC553007DC364 /* Info.plist */,
);
path = Conceptual;
sourceTree = "";
};
912C5D25210BC594007DC364 /* RealWorld */ = {
isa = PBXGroup;
children = (
912C5D26210BC594007DC364 /* Example.swift */,
913E0141210CA57900B7D71E /* Output.txt */,
912C5D28210BC594007DC364 /* Info.plist */,
);
path = RealWorld;
sourceTree = "";
};
912C5D31210BC5E1007DC364 /* Conceptual */ = {
isa = PBXGroup;
children = (
912C5D32210BC5E1007DC364 /* Example.swift */,
913E0143210CA58300B7D71E /* Output.txt */,
912C5D34210BC5E1007DC364 /* Info.plist */,
);
path = Conceptual;
sourceTree = "";
};
912C5D38210BC5EB007DC364 /* State */ = {
isa = PBXGroup;
children = (
912C5D31210BC5E1007DC364 /* Conceptual */,
912C5D3E210BC62D007DC364 /* RealWorld */,
);
path = State;
sourceTree = "";
};
912C5D3E210BC62D007DC364 /* RealWorld */ = {
isa = PBXGroup;
children = (
912C5D3F210BC62D007DC364 /* Example.swift */,
913E0145210CA58900B7D71E /* Output.txt */,
912C5D41210BC62D007DC364 /* Info.plist */,
);
path = RealWorld;
sourceTree = "";
};
912C5D45210BC687007DC364 /* Strategy */ = {
isa = PBXGroup;
children = (
912C5D4B210BC6A8007DC364 /* Conceptual */,
912C5D57210BC6F1007DC364 /* RealWorld */,
);
path = Strategy;
sourceTree = "";
};
912C5D4B210BC6A8007DC364 /* Conceptual */ = {
isa = PBXGroup;
children = (
912C5D4C210BC6A8007DC364 /* Example.swift */,
913E0149210CA59A00B7D71E /* Output.txt */,
912C5D4E210BC6A8007DC364 /* Info.plist */,
);
path = Conceptual;
sourceTree = "";
};
912C5D57210BC6F1007DC364 /* RealWorld */ = {
isa = PBXGroup;
children = (
912C5D58210BC6F1007DC364 /* Example.swift */,
913E0147210CA59400B7D71E /* Output.txt */,
912C5D5A210BC6F1007DC364 /* Info.plist */,
);
path = RealWorld;
sourceTree = "";
};
912C5D63210BC749007DC364 /* Conceptual */ = {
isa = PBXGroup;
children = (
912C5D64210BC749007DC364 /* Example.swift */,
913E014D210CA5AE00B7D71E /* Output.txt */,
912C5D66210BC749007DC364 /* Info.plist */,
);
path = Conceptual;
sourceTree = "";
};
912C5D6A210BC750007DC364 /* TemplateMethod */ = {
isa = PBXGroup;
children = (
912C5D63210BC749007DC364 /* Conceptual */,
912C5D70210BC7B1007DC364 /* RealWorld */,
);
path = TemplateMethod;
sourceTree = "";
};
912C5D70210BC7B1007DC364 /* RealWorld */ = {
isa = PBXGroup;
children = (
912C5D71210BC7B1007DC364 /* Example.swift */,
913E014B210CA5A200B7D71E /* Output.txt */,
912C5D73210BC7B1007DC364 /* Info.plist */,
);
path = RealWorld;
sourceTree = "";
};
912C5D77210BC80B007DC364 /* Visitor */ = {
isa = PBXGroup;
children = (
912C5D7D210BC81E007DC364 /* Conceptual */,
912C5D89210BC865007DC364 /* RealWorld */,
);
path = Visitor;
sourceTree = "";
};
912C5D7D210BC81E007DC364 /* Conceptual */ = {
isa = PBXGroup;
children = (
912C5D7E210BC81E007DC364 /* Example.swift */,
913E014F210CA5B800B7D71E /* Output.txt */,
912C5D80210BC81E007DC364 /* Info.plist */,
);
path = Conceptual;
sourceTree = "";
};
912C5D89210BC865007DC364 /* RealWorld */ = {
isa = PBXGroup;
children = (
912C5D8A210BC865007DC364 /* Example.swift */,
913E0151210CA5BE00B7D71E /* Output.txt */,
912C5D8C210BC865007DC364 /* Info.plist */,
);
path = RealWorld;
sourceTree = "";
};
91301AD320F55C25003B4FC0 /* Conceptual */ = {
isa = PBXGroup;
children = (
91301AD420F55C25003B4FC0 /* Example.swift */,
91301AD620F55C25003B4FC0 /* Info.plist */,
91B1206420F56C0100730C37 /* Output.txt */,
);
path = Conceptual;
sourceTree = "";
};
91301ADA20F55C4E003B4FC0 /* Flyweight */ = {
isa = PBXGroup;
children = (
91301AE020F55CAA003B4FC0 /* RealWorld */,
91301AD320F55C25003B4FC0 /* Conceptual */,
);
path = Flyweight;
sourceTree = "";
};
91301AE020F55CAA003B4FC0 /* RealWorld */ = {
isa = PBXGroup;
children = (
91301AE120F55CAA003B4FC0 /* Example.swift */,
91301AE320F55CAA003B4FC0 /* Info.plist */,
91B1206220F56BFA00730C37 /* Output.txt */,
);
path = RealWorld;
sourceTree = "";
};
9139FA6F2088D85C00229150 = {
isa = PBXGroup;
children = (
913FF2252097835E00193902 /* ProjectBundle */,
914ADA0420B2D4D200E0A74F /* Sources */,
9139FA792088D85C00229150 /* Products */,
);
sourceTree = "";
};
9139FA792088D85C00229150 /* Products */ = {
isa = PBXGroup;
children = (
919C89F120DD7EE4006EE57D /* AbstractFactoryRealWorld.xctest */,
919C8A0520DD7F3C006EE57D /* AbstractFactoryConceptual.xctest */,
919C8A1320DD81D0006EE57D /* FacadeConceptual.xctest */,
919C8A2020DD8261006EE57D /* FacadeRealWorld.xctest */,
919C8A3920DD82F0006EE57D /* BridgeConceptual.xctest */,
919C8A4620DD8393006EE57D /* BridgeRealWorld.xctest */,
919C8A5F20DD849A006EE57D /* AdapterConceptual.xctest */,
919C8A6C20DD858C006EE57D /* AdapterRealWorld.xctest */,
919C8A7A20DD8688006EE57D /* BuilderConceptual.xctest */,
919C8A8720DD86DC006EE57D /* BuilderRealWorld.xctest */,
919C8AA220DD878D006EE57D /* CompositeConceptual.xctest */,
919C8AAF20DD87F2006EE57D /* CompositeRealWorld.xctest */,
919C8AC720DD8873006EE57D /* DecoratorConceptual.xctest */,
919C8AD420DD88C6006EE57D /* DecoratorRealWorld.xctest */,
919C8AE020DD893E006EE57D /* FactoryMethodRealWorld.xctest */,
919C8AED20DD897E006EE57D /* FactoryMethodConceptual.xctest */,
919C8AFA20DD8A98006EE57D /* PrototypeConceptual.xctest */,
919C8B0720DD8AF0006EE57D /* PrototypeRealWorld.xctest */,
919C8B1420DD8B59006EE57D /* SingletonConceptual.xctest */,
919C8B2120DD8BA9006EE57D /* SingletonRealWorld.xctest */,
91301AD220F55C25003B4FC0 /* FlyweightConceptual.xctest */,
91301ADF20F55CAA003B4FC0 /* FlyweightRealWorld.xctest */,
91B1206B20F610E400730C37 /* ChainOfResponsibilityConceptual.xctest */,
91B1207720F6114A00730C37 /* ChainOfResponsibilityRealWorld.xctest */,
91B1208320F611DA00730C37 /* CommandConceptual.xctest */,
91B1209020F6120C00730C37 /* CommandRealWorld.xctest */,
91B1209D20F6125500730C37 /* IteratorConceptual.xctest */,
91B120A920F6127400730C37 /* IteratorRealWorld.xctest */,
91B120B620F6130900730C37 /* ProxyConceptual.xctest */,
91B120C220F6132E00730C37 /* ProxyRealWorld.xctest */,
912C5CDF210BC33D007DC364 /* MediatorConceptual.xctest */,
912C5CEC210BC3A4007DC364 /* MediatorRealWorld.xctest */,
912C5CF8210BC3F5007DC364 /* MementoConceptual.xctest */,
912C5D0B210BC4D8007DC364 /* MementoRealWorld.xctest */,
912C5D18210BC553007DC364 /* ObserverConceptual.xctest */,
912C5D24210BC594007DC364 /* ObserverRealWorld.xctest */,
912C5D30210BC5E1007DC364 /* StateConceptual.xctest */,
912C5D3D210BC62D007DC364 /* StateRealWorld.xctest */,
912C5D4A210BC6A8007DC364 /* StrategyConceptual.xctest */,
912C5D56210BC6F0007DC364 /* StrategyRealWorld.xctest */,
912C5D62210BC749007DC364 /* TemplateMethodConceptual.xctest */,
912C5D6F210BC7B1007DC364 /* TemplateMethodRealWorld.xctest */,
912C5D7C210BC81E007DC364 /* VisitorConceptual.xctest */,
912C5D88210BC865007DC364 /* VisitorRealWorld.xctest */,
);
name = Products;
sourceTree = "";
};
913FF2252097835E00193902 /* ProjectBundle */ = {
isa = PBXGroup;
children = (
913FF2262097835E00193902 /* Info.plist */,
);
path = ProjectBundle;
sourceTree = "";
};
914ADA0420B2D4D200E0A74F /* Sources */ = {
isa = PBXGroup;
children = (
919C8A0E20DD7F7B006EE57D /* AbstractFactory */,
9187BFB820B5D0A600266EF8 /* FactoryMethod */,
9187BFCD20B5D0A700266EF8 /* Builder */,
9187BFE720B5D0A700266EF8 /* Prototype */,
9187BFC320B5D0A700266EF8 /* Singleton */,
9187BFE020B5D0A700266EF8 /* Adapter */,
9187BFDA20B5D0A700266EF8 /* Bridge */,
916B889120BC4D8100BA92DF /* Composite */,
916B889620BC582D00BA92DF /* Decorator */,
916B889E20BC5C5800BA92DF /* Facade */,
91301ADA20F55C4E003B4FC0 /* Flyweight */,
91B120B120F612F600730C37 /* Proxy */,
91B1206620F610B600730C37 /* ChainOfResponsibility */,
91B1208B20F611EF00730C37 /* Command */,
91B1209820F6124200730C37 /* Iterator */,
912C5CE7210BC34E007DC364 /* Mediator */,
912C5D01210BC4A5007DC364 /* Memento */,
912C5D13210BC53A007DC364 /* Observer */,
912C5D38210BC5EB007DC364 /* State */,
912C5D45210BC687007DC364 /* Strategy */,
912C5D6A210BC750007DC364 /* TemplateMethod */,
912C5D77210BC80B007DC364 /* Visitor */,
);
path = Sources;
sourceTree = "";
};
916B889120BC4D8100BA92DF /* Composite */ = {
isa = PBXGroup;
children = (
919C8AB020DD87F2006EE57D /* RealWorld */,
919C8AA320DD878E006EE57D /* Conceptual */,
);
path = Composite;
sourceTree = "";
};
916B889620BC582D00BA92DF /* Decorator */ = {
isa = PBXGroup;
children = (
919C8AD520DD88C6006EE57D /* RealWorld */,
919C8AC820DD8873006EE57D /* Conceptual */,
);
path = Decorator;
sourceTree = "";
};
916B889E20BC5C5800BA92DF /* Facade */ = {
isa = PBXGroup;
children = (
919C8A2120DD8261006EE57D /* RealWorld */,
919C8A1420DD81D0006EE57D /* Conceptual */,
);
path = Facade;
sourceTree = "";
};
9187BFB820B5D0A600266EF8 /* FactoryMethod */ = {
isa = PBXGroup;
children = (
919C8AEE20DD897E006EE57D /* Conceptual */,
919C8AE120DD893E006EE57D /* RealWorld */,
);
path = FactoryMethod;
sourceTree = "";
};
9187BFC320B5D0A700266EF8 /* Singleton */ = {
isa = PBXGroup;
children = (
919C8B2220DD8BA9006EE57D /* RealWorld */,
919C8B1520DD8B59006EE57D /* Conceptual */,
);
path = Singleton;
sourceTree = "";
};
9187BFCD20B5D0A700266EF8 /* Builder */ = {
isa = PBXGroup;
children = (
919C8A8820DD86DC006EE57D /* RealWorld */,
919C8A7B20DD8688006EE57D /* Conceptual */,
);
path = Builder;
sourceTree = "";
};
9187BFDA20B5D0A700266EF8 /* Bridge */ = {
isa = PBXGroup;
children = (
919C8A4720DD8393006EE57D /* RealWorld */,
919C8A3A20DD82F0006EE57D /* Conceptual */,
);
path = Bridge;
sourceTree = "";
};
9187BFE020B5D0A700266EF8 /* Adapter */ = {
isa = PBXGroup;
children = (
919C8A6D20DD858C006EE57D /* RealWorld */,
919C8A6020DD849B006EE57D /* Conceptual */,
);
path = Adapter;
sourceTree = "";
};
9187BFE720B5D0A700266EF8 /* Prototype */ = {
isa = PBXGroup;
children = (
919C8B0820DD8AF0006EE57D /* RealWorld */,
919C8AFB20DD8A98006EE57D /* Conceptual */,
);
path = Prototype;
sourceTree = "";
};
919C89F220DD7EE4006EE57D /* RealWorld */ = {
isa = PBXGroup;
children = (
9187BFB220B5D0A600266EF8 /* Example.swift */,
9187BFAB20B5D0A600266EF8 /* Output.txt */,
919C89F520DD7EE4006EE57D /* Info.plist */,
);
path = RealWorld;
sourceTree = "";
};
919C8A0620DD7F3C006EE57D /* Conceptual */ = {
isa = PBXGroup;
children = (
9187BFB620B5D0A600266EF8 /* Example.swift */,
9187BFB420B5D0A600266EF8 /* Output.txt */,
919C8A0920DD7F3C006EE57D /* Info.plist */,
);
path = Conceptual;
sourceTree = "";
};
919C8A0E20DD7F7B006EE57D /* AbstractFactory */ = {
isa = PBXGroup;
children = (
919C89F220DD7EE4006EE57D /* RealWorld */,
919C8A0620DD7F3C006EE57D /* Conceptual */,
);
path = AbstractFactory;
sourceTree = "";
};
919C8A1420DD81D0006EE57D /* Conceptual */ = {
isa = PBXGroup;
children = (
916B889F20BC6E6800BA92DF /* Example.swift */,
916B88A120BC717400BA92DF /* Output.txt */,
919C8A1720DD81D0006EE57D /* Info.plist */,
);
path = Conceptual;
sourceTree = "";
};
919C8A2120DD8261006EE57D /* RealWorld */ = {
isa = PBXGroup;
children = (
916B88A520BD468100BA92DF /* Example.swift */,
916B88A720BD537300BA92DF /* Output.txt */,
919C8A2420DD8261006EE57D /* Info.plist */,
);
path = RealWorld;
sourceTree = "";
};
919C8A3A20DD82F0006EE57D /* Conceptual */ = {
isa = PBXGroup;
children = (
9187BFDF20B5D0A700266EF8 /* Example.swift */,
9187BFDE20B5D0A700266EF8 /* Output.txt */,
919C8A3D20DD82F0006EE57D /* Info.plist */,
);
path = Conceptual;
sourceTree = "";
};
919C8A4720DD8393006EE57D /* RealWorld */ = {
isa = PBXGroup;
children = (
9187BFDC20B5D0A700266EF8 /* Example.swift */,
916B888F20BC4B1900BA92DF /* Output.txt */,
919C8A4A20DD8393006EE57D /* Info.plist */,
);
path = RealWorld;
sourceTree = "";
};
919C8A6020DD849B006EE57D /* Conceptual */ = {
isa = PBXGroup;
children = (
9187BFE520B5D0A700266EF8 /* Example.swift */,
9187BFE620B5D0A700266EF8 /* Output.txt */,
919C8A6320DD849B006EE57D /* Info.plist */,
);
path = Conceptual;
sourceTree = "";
};
919C8A6D20DD858C006EE57D /* RealWorld */ = {
isa = PBXGroup;
children = (
9187BFE320B5D0A700266EF8 /* Example.swift */,
9187BFE220B5D0A700266EF8 /* Output.txt */,
919C8A7020DD858C006EE57D /* Info.plist */,
);
path = RealWorld;
sourceTree = "";
};
919C8A7B20DD8688006EE57D /* Conceptual */ = {
isa = PBXGroup;
children = (
9187BFD520B5D0A700266EF8 /* Example.swift */,
9187BFD820B5D0A700266EF8 /* Output.txt */,
919C8A7E20DD8688006EE57D /* Info.plist */,
);
path = Conceptual;
sourceTree = "";
};
919C8A8820DD86DC006EE57D /* RealWorld */ = {
isa = PBXGroup;
children = (
9187BFD220B5D0A700266EF8 /* Example.swift */,
9187BFD320B5D0A700266EF8 /* Output.txt */,
919C8A8B20DD86DC006EE57D /* Info.plist */,
);
path = RealWorld;
sourceTree = "";
};
919C8AA320DD878E006EE57D /* Conceptual */ = {
isa = PBXGroup;
children = (
916B889220BC4DA400BA92DF /* Example.swift */,
916B889420BC56FD00BA92DF /* Output.txt */,
919C8AA620DD878E006EE57D /* Info.plist */,
);
path = Conceptual;
sourceTree = "";
};
919C8AB020DD87F2006EE57D /* RealWorld */ = {
isa = PBXGroup;
children = (
919C8AB120DD87F2006EE57D /* Example.swift */,
91F0DAAC20E68AAD001F1C1A /* Output.txt */,
919C8AB320DD87F2006EE57D /* Info.plist */,
);
path = RealWorld;
sourceTree = "";
};
919C8AC820DD8873006EE57D /* Conceptual */ = {
isa = PBXGroup;
children = (
916B889A20BC587D00BA92DF /* Example.swift */,
916B889C20BC5B7600BA92DF /* Output.txt */,
919C8ACB20DD8873006EE57D /* Info.plist */,
);
path = Conceptual;
sourceTree = "";
};
919C8AD520DD88C6006EE57D /* RealWorld */ = {
isa = PBXGroup;
children = (
919C8AD620DD88C6006EE57D /* Example.swift */,
91F0DA9520E6552A001F1C1A /* Output.txt */,
919C8AD820DD88C6006EE57D /* Info.plist */,
);
path = RealWorld;
sourceTree = "";
};
919C8AE120DD893E006EE57D /* RealWorld */ = {
isa = PBXGroup;
children = (
9187BFBB20B5D0A600266EF8 /* Example.swift */,
9187BFBC20B5D0A600266EF8 /* Output.txt */,
919C8AE420DD893E006EE57D /* Info.plist */,
);
path = RealWorld;
sourceTree = "";
};
919C8AEE20DD897E006EE57D /* Conceptual */ = {
isa = PBXGroup;
children = (
9187BFBF20B5D0A600266EF8 /* Example.swift */,
9187BFC220B5D0A600266EF8 /* Output.txt */,
919C8AF120DD897E006EE57D /* Info.plist */,
);
path = Conceptual;
sourceTree = "";
};
919C8AFB20DD8A98006EE57D /* Conceptual */ = {
isa = PBXGroup;
children = (
9187BFEE20B5D0A700266EF8 /* Example.swift */,
9187BFEC20B5D0A700266EF8 /* Output.txt */,
919C8AFE20DD8A98006EE57D /* Info.plist */,
);
path = Conceptual;
sourceTree = "";
};
919C8B0820DD8AF0006EE57D /* RealWorld */ = {
isa = PBXGroup;
children = (
9187BFEA20B5D0A700266EF8 /* Example.swift */,
9187BFE920B5D0A700266EF8 /* Output.txt */,
919C8B0B20DD8AF0006EE57D /* Info.plist */,
);
path = RealWorld;
sourceTree = "";
};
919C8B1520DD8B59006EE57D /* Conceptual */ = {
isa = PBXGroup;
children = (
9187BFCC20B5D0A700266EF8 /* Example.swift */,
9187BFCB20B5D0A700266EF8 /* Output.txt */,
919C8B1820DD8B59006EE57D /* Info.plist */,
);
path = Conceptual;
sourceTree = "";
};
919C8B2220DD8BA9006EE57D /* RealWorld */ = {
isa = PBXGroup;
children = (
9187BFC920B5D0A700266EF8 /* Example.swift */,
9187BFC820B5D0A700266EF8 /* Output.txt */,
919C8B2520DD8BA9006EE57D /* Info.plist */,
);
path = RealWorld;
sourceTree = "";
};
91B1206620F610B600730C37 /* ChainOfResponsibility */ = {
isa = PBXGroup;
children = (
91B1206C20F610E400730C37 /* Conceptual */,
91B1207820F6114A00730C37 /* RealWorld */,
);
path = ChainOfResponsibility;
sourceTree = "";
};
91B1206C20F610E400730C37 /* Conceptual */ = {
isa = PBXGroup;
children = (
91B1206D20F610E400730C37 /* Example.swift */,
91B1206F20F610E400730C37 /* Info.plist */,
91B120CA20F61BAD00730C37 /* Output.txt */,
);
path = Conceptual;
sourceTree = "";
};
91B1207820F6114A00730C37 /* RealWorld */ = {
isa = PBXGroup;
children = (
91B1207920F6114A00730C37 /* Example.swift */,
91B120CC20F61BBC00730C37 /* Output.txt */,
91B1207B20F6114A00730C37 /* Info.plist */,
);
path = RealWorld;
sourceTree = "";
};
91B1208420F611DA00730C37 /* Conceptual */ = {
isa = PBXGroup;
children = (
91B1208520F611DA00730C37 /* Example.swift */,
91B1208720F611DA00730C37 /* Info.plist */,
91B120D020F61BD000730C37 /* Output.txt */,
);
path = Conceptual;
sourceTree = "";
};
91B1208B20F611EF00730C37 /* Command */ = {
isa = PBXGroup;
children = (
91B1208420F611DA00730C37 /* Conceptual */,
91B1209120F6120C00730C37 /* RealWorld */,
);
path = Command;
sourceTree = "";
};
91B1209120F6120C00730C37 /* RealWorld */ = {
isa = PBXGroup;
children = (
91B1209220F6120C00730C37 /* Example.swift */,
91B120CE20F61BC600730C37 /* Output.txt */,
91B1209420F6120C00730C37 /* Info.plist */,
);
path = RealWorld;
sourceTree = "";
};
91B1209820F6124200730C37 /* Iterator */ = {
isa = PBXGroup;
children = (
91B120AA20F6127400730C37 /* RealWorld */,
91B1209E20F6125500730C37 /* Conceptual */,
);
path = Iterator;
sourceTree = "";
};
91B1209E20F6125500730C37 /* Conceptual */ = {
isa = PBXGroup;
children = (
91B1209F20F6125500730C37 /* Example.swift */,
91B120D420F61BE300730C37 /* Output.txt */,
91B120A120F6125500730C37 /* Info.plist */,
);
path = Conceptual;
sourceTree = "";
};
91B120AA20F6127400730C37 /* RealWorld */ = {
isa = PBXGroup;
children = (
91B120AB20F6127400730C37 /* Example.swift */,
91B120D220F61BDA00730C37 /* Output.txt */,
91B120AD20F6127400730C37 /* Info.plist */,
);
path = RealWorld;
sourceTree = "";
};
91B120B120F612F600730C37 /* Proxy */ = {
isa = PBXGroup;
children = (
91B120C320F6132E00730C37 /* RealWorld */,
91B120B720F6130A00730C37 /* Conceptual */,
);
path = Proxy;
sourceTree = "";
};
91B120B720F6130A00730C37 /* Conceptual */ = {
isa = PBXGroup;
children = (
91B120B820F6130A00730C37 /* Example.swift */,
91B120D820F61BF000730C37 /* Output.txt */,
91B120BA20F6130A00730C37 /* Info.plist */,
);
path = Conceptual;
sourceTree = "";
};
91B120C320F6132E00730C37 /* RealWorld */ = {
isa = PBXGroup;
children = (
91B120C420F6132E00730C37 /* Example.swift */,
91B120D620F61BE900730C37 /* Output.txt */,
91B120C620F6132E00730C37 /* Info.plist */,
);
path = RealWorld;
sourceTree = "";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
912C5CDE210BC33D007DC364 /* MediatorConceptual */ = {
isa = PBXNativeTarget;
buildConfigurationList = 912C5CE4210BC33E007DC364 /* Build configuration list for PBXNativeTarget "MediatorConceptual" */;
buildPhases = (
912C5CDB210BC33D007DC364 /* Sources */,
912C5CDC210BC33D007DC364 /* Frameworks */,
912C5CDD210BC33D007DC364 /* Resources */,
);
buildRules = (
);
dependencies = (
);
name = MediatorConceptual;
productName = MediatorConceptual;
productReference = 912C5CDF210BC33D007DC364 /* MediatorConceptual.xctest */;
productType = "com.apple.product-type.bundle.unit-test";
};
912C5CEB210BC3A4007DC364 /* MediatorRealWorld */ = {
isa = PBXNativeTarget;
buildConfigurationList = 912C5CF1210BC3A4007DC364 /* Build configuration list for PBXNativeTarget "MediatorRealWorld" */;
buildPhases = (
912C5CE8210BC3A4007DC364 /* Sources */,
912C5CE9210BC3A4007DC364 /* Frameworks */,
912C5CEA210BC3A4007DC364 /* Resources */,
);
buildRules = (
);
dependencies = (
);
name = MediatorRealWorld;
productName = MediatorRealWorld;
productReference = 912C5CEC210BC3A4007DC364 /* MediatorRealWorld.xctest */;
productType = "com.apple.product-type.bundle.unit-test";
};
912C5CF7210BC3F5007DC364 /* MementoConceptual */ = {
isa = PBXNativeTarget;
buildConfigurationList = 912C5CFD210BC3F5007DC364 /* Build configuration list for PBXNativeTarget "MementoConceptual" */;
buildPhases = (
912C5CF4210BC3F5007DC364 /* Sources */,
912C5CF5210BC3F5007DC364 /* Frameworks */,
912C5CF6210BC3F5007DC364 /* Resources */,
);
buildRules = (
);
dependencies = (
);
name = MementoConceptual;
productName = MementoConceptual;
productReference = 912C5CF8210BC3F5007DC364 /* MementoConceptual.xctest */;
productType = "com.apple.product-type.bundle.unit-test";
};
912C5D0A210BC4D8007DC364 /* MementoRealWorld */ = {
isa = PBXNativeTarget;
buildConfigurationList = 912C5D10210BC4D9007DC364 /* Build configuration list for PBXNativeTarget "MementoRealWorld" */;
buildPhases = (
912C5D07210BC4D8007DC364 /* Sources */,
912C5D08210BC4D8007DC364 /* Frameworks */,
912C5D09210BC4D8007DC364 /* Resources */,
);
buildRules = (
);
dependencies = (
);
name = MementoRealWorld;
productName = MementoRealWorld;
productReference = 912C5D0B210BC4D8007DC364 /* MementoRealWorld.xctest */;
productType = "com.apple.product-type.bundle.unit-test";
};
912C5D17210BC553007DC364 /* ObserverConceptual */ = {
isa = PBXNativeTarget;
buildConfigurationList = 912C5D1D210BC553007DC364 /* Build configuration list for PBXNativeTarget "ObserverConceptual" */;
buildPhases = (
912C5D14210BC553007DC364 /* Sources */,
912C5D15210BC553007DC364 /* Frameworks */,
912C5D16210BC553007DC364 /* Resources */,
);
buildRules = (
);
dependencies = (
);
name = ObserverConceptual;
productName = ObserverConceptual;
productReference = 912C5D18210BC553007DC364 /* ObserverConceptual.xctest */;
productType = "com.apple.product-type.bundle.unit-test";
};
912C5D23210BC594007DC364 /* ObserverRealWorld */ = {
isa = PBXNativeTarget;
buildConfigurationList = 912C5D29210BC594007DC364 /* Build configuration list for PBXNativeTarget "ObserverRealWorld" */;
buildPhases = (
912C5D20210BC594007DC364 /* Sources */,
912C5D21210BC594007DC364 /* Frameworks */,
912C5D22210BC594007DC364 /* Resources */,
);
buildRules = (
);
dependencies = (
);
name = ObserverRealWorld;
productName = ObserverRealWorld;
productReference = 912C5D24210BC594007DC364 /* ObserverRealWorld.xctest */;
productType = "com.apple.product-type.bundle.unit-test";
};
912C5D2F210BC5E1007DC364 /* StateConceptual */ = {
isa = PBXNativeTarget;
buildConfigurationList = 912C5D35210BC5E1007DC364 /* Build configuration list for PBXNativeTarget "StateConceptual" */;
buildPhases = (
912C5D2C210BC5E1007DC364 /* Sources */,
912C5D2D210BC5E1007DC364 /* Frameworks */,
912C5D2E210BC5E1007DC364 /* Resources */,
);
buildRules = (
);
dependencies = (
);
name = StateConceptual;
productName = StateConceptual;
productReference = 912C5D30210BC5E1007DC364 /* StateConceptual.xctest */;
productType = "com.apple.product-type.bundle.unit-test";
};
912C5D3C210BC62D007DC364 /* StateRealWorld */ = {
isa = PBXNativeTarget;
buildConfigurationList = 912C5D42210BC62D007DC364 /* Build configuration list for PBXNativeTarget "StateRealWorld" */;
buildPhases = (
912C5D39210BC62D007DC364 /* Sources */,
912C5D3A210BC62D007DC364 /* Frameworks */,
912C5D3B210BC62D007DC364 /* Resources */,
);
buildRules = (
);
dependencies = (
);
name = StateRealWorld;
productName = StateRealWorld;
productReference = 912C5D3D210BC62D007DC364 /* StateRealWorld.xctest */;
productType = "com.apple.product-type.bundle.unit-test";
};
912C5D49210BC6A8007DC364 /* StrategyConceptual */ = {
isa = PBXNativeTarget;
buildConfigurationList = 912C5D4F210BC6A8007DC364 /* Build configuration list for PBXNativeTarget "StrategyConceptual" */;
buildPhases = (
912C5D46210BC6A8007DC364 /* Sources */,
912C5D47210BC6A8007DC364 /* Frameworks */,
912C5D48210BC6A8007DC364 /* Resources */,
);
buildRules = (
);
dependencies = (
);
name = StrategyConceptual;
productName = StrategyConceptual;
productReference = 912C5D4A210BC6A8007DC364 /* StrategyConceptual.xctest */;
productType = "com.apple.product-type.bundle.unit-test";
};
912C5D55210BC6F0007DC364 /* StrategyRealWorld */ = {
isa = PBXNativeTarget;
buildConfigurationList = 912C5D5B210BC6F1007DC364 /* Build configuration list for PBXNativeTarget "StrategyRealWorld" */;
buildPhases = (
912C5D52210BC6F0007DC364 /* Sources */,
912C5D53210BC6F0007DC364 /* Frameworks */,
912C5D54210BC6F0007DC364 /* Resources */,
);
buildRules = (
);
dependencies = (
);
name = StrategyRealWorld;
productName = StrategyRealWorld;
productReference = 912C5D56210BC6F0007DC364 /* StrategyRealWorld.xctest */;
productType = "com.apple.product-type.bundle.unit-test";
};
912C5D61210BC749007DC364 /* TemplateMethodConceptual */ = {
isa = PBXNativeTarget;
buildConfigurationList = 912C5D67210BC749007DC364 /* Build configuration list for PBXNativeTarget "TemplateMethodConceptual" */;
buildPhases = (
912C5D5E210BC749007DC364 /* Sources */,
912C5D5F210BC749007DC364 /* Frameworks */,
912C5D60210BC749007DC364 /* Resources */,
);
buildRules = (
);
dependencies = (
);
name = TemplateMethodConceptual;
productName = TemplateMethodConceptual;
productReference = 912C5D62210BC749007DC364 /* TemplateMethodConceptual.xctest */;
productType = "com.apple.product-type.bundle.unit-test";
};
912C5D6E210BC7B1007DC364 /* TemplateMethodRealWorld */ = {
isa = PBXNativeTarget;
buildConfigurationList = 912C5D74210BC7B1007DC364 /* Build configuration list for PBXNativeTarget "TemplateMethodRealWorld" */;
buildPhases = (
912C5D6B210BC7B1007DC364 /* Sources */,
912C5D6C210BC7B1007DC364 /* Frameworks */,
912C5D6D210BC7B1007DC364 /* Resources */,
);
buildRules = (
);
dependencies = (
);
name = TemplateMethodRealWorld;
productName = TemplateMethodRealWorld;
productReference = 912C5D6F210BC7B1007DC364 /* TemplateMethodRealWorld.xctest */;
productType = "com.apple.product-type.bundle.unit-test";
};
912C5D7B210BC81E007DC364 /* VisitorConceptual */ = {
isa = PBXNativeTarget;
buildConfigurationList = 912C5D81210BC81E007DC364 /* Build configuration list for PBXNativeTarget "VisitorConceptual" */;
buildPhases = (
912C5D78210BC81E007DC364 /* Sources */,
912C5D79210BC81E007DC364 /* Frameworks */,
912C5D7A210BC81E007DC364 /* Resources */,
);
buildRules = (
);
dependencies = (
);
name = VisitorConceptual;
productName = VisitorConceptual;
productReference = 912C5D7C210BC81E007DC364 /* VisitorConceptual.xctest */;
productType = "com.apple.product-type.bundle.unit-test";
};
912C5D87210BC865007DC364 /* VisitorRealWorld */ = {
isa = PBXNativeTarget;
buildConfigurationList = 912C5D8D210BC865007DC364 /* Build configuration list for PBXNativeTarget "VisitorRealWorld" */;
buildPhases = (
912C5D84210BC865007DC364 /* Sources */,
912C5D85210BC865007DC364 /* Frameworks */,
912C5D86210BC865007DC364 /* Resources */,
);
buildRules = (
);
dependencies = (
);
name = VisitorRealWorld;
productName = VisitorRealWorld;
productReference = 912C5D88210BC865007DC364 /* VisitorRealWorld.xctest */;
productType = "com.apple.product-type.bundle.unit-test";
};
91301AD120F55C25003B4FC0 /* FlyweightConceptual */ = {
isa = PBXNativeTarget;
buildConfigurationList = 91301AD720F55C25003B4FC0 /* Build configuration list for PBXNativeTarget "FlyweightConceptual" */;
buildPhases = (
91301ACE20F55C25003B4FC0 /* Sources */,
91301ACF20F55C25003B4FC0 /* Frameworks */,
91301AD020F55C25003B4FC0 /* Resources */,
);
buildRules = (
);
dependencies = (
);
name = FlyweightConceptual;
productName = FlyweightConceptual;
productReference = 91301AD220F55C25003B4FC0 /* FlyweightConceptual.xctest */;
productType = "com.apple.product-type.bundle.unit-test";
};
91301ADE20F55CAA003B4FC0 /* FlyweightRealWorld */ = {
isa = PBXNativeTarget;
buildConfigurationList = 91301AE420F55CAA003B4FC0 /* Build configuration list for PBXNativeTarget "FlyweightRealWorld" */;
buildPhases = (
91301ADB20F55CAA003B4FC0 /* Sources */,
91301ADC20F55CAA003B4FC0 /* Frameworks */,
91301ADD20F55CAA003B4FC0 /* Resources */,
);
buildRules = (
);
dependencies = (
);
name = FlyweightRealWorld;
productName = FlyweightRealWorld;
productReference = 91301ADF20F55CAA003B4FC0 /* FlyweightRealWorld.xctest */;
productType = "com.apple.product-type.bundle.unit-test";
};
919C89F020DD7EE4006EE57D /* AbstractFactoryRealWorld */ = {
isa = PBXNativeTarget;
buildConfigurationList = 919C89F820DD7EE4006EE57D /* Build configuration list for PBXNativeTarget "AbstractFactoryRealWorld" */;
buildPhases = (
919C89ED20DD7EE4006EE57D /* Sources */,
919C89EE20DD7EE4006EE57D /* Frameworks */,
919C89EF20DD7EE4006EE57D /* Resources */,
);
buildRules = (
);
dependencies = (
);
name = AbstractFactoryRealWorld;
productName = AbstractFactoryRealWorld;
productReference = 919C89F120DD7EE4006EE57D /* AbstractFactoryRealWorld.xctest */;
productType = "com.apple.product-type.bundle.unit-test";
};
919C8A0420DD7F3C006EE57D /* AbstractFactoryConceptual */ = {
isa = PBXNativeTarget;
buildConfigurationList = 919C8A0A20DD7F3C006EE57D /* Build configuration list for PBXNativeTarget "AbstractFactoryConceptual" */;
buildPhases = (
919C8A0120DD7F3C006EE57D /* Sources */,
919C8A0220DD7F3C006EE57D /* Frameworks */,
919C8A0320DD7F3C006EE57D /* Resources */,
);
buildRules = (
);
dependencies = (
);
name = AbstractFactoryConceptual;
productName = AbstractFactoryConceptual;
productReference = 919C8A0520DD7F3C006EE57D /* AbstractFactoryConceptual.xctest */;
productType = "com.apple.product-type.bundle.unit-test";
};
919C8A1220DD81D0006EE57D /* FacadeConceptual */ = {
isa = PBXNativeTarget;
buildConfigurationList = 919C8A1820DD81D0006EE57D /* Build configuration list for PBXNativeTarget "FacadeConceptual" */;
buildPhases = (
919C8A0F20DD81D0006EE57D /* Sources */,
919C8A1020DD81D0006EE57D /* Frameworks */,
919C8A1120DD81D0006EE57D /* Resources */,
);
buildRules = (
);
dependencies = (
);
name = FacadeConceptual;
productName = FacadeConceptual;
productReference = 919C8A1320DD81D0006EE57D /* FacadeConceptual.xctest */;
productType = "com.apple.product-type.bundle.unit-test";
};
919C8A1F20DD8261006EE57D /* FacadeRealWorld */ = {
isa = PBXNativeTarget;
buildConfigurationList = 919C8A2520DD8261006EE57D /* Build configuration list for PBXNativeTarget "FacadeRealWorld" */;
buildPhases = (
919C8A1C20DD8261006EE57D /* Sources */,
919C8A1D20DD8261006EE57D /* Frameworks */,
919C8A1E20DD8261006EE57D /* Resources */,
);
buildRules = (
);
dependencies = (
);
name = FacadeRealWorld;
productName = FacadeRealWorld;
productReference = 919C8A2020DD8261006EE57D /* FacadeRealWorld.xctest */;
productType = "com.apple.product-type.bundle.unit-test";
};
919C8A3820DD82F0006EE57D /* BridgeConceptual */ = {
isa = PBXNativeTarget;
buildConfigurationList = 919C8A3E20DD82F0006EE57D /* Build configuration list for PBXNativeTarget "BridgeConceptual" */;
buildPhases = (
919C8A3520DD82F0006EE57D /* Sources */,
919C8A3620DD82F0006EE57D /* Frameworks */,
919C8A3720DD82F0006EE57D /* Resources */,
);
buildRules = (
);
dependencies = (
);
name = BridgeConceptual;
productName = BridgeConceptual;
productReference = 919C8A3920DD82F0006EE57D /* BridgeConceptual.xctest */;
productType = "com.apple.product-type.bundle.unit-test";
};
919C8A4520DD8393006EE57D /* BridgeRealWorld */ = {
isa = PBXNativeTarget;
buildConfigurationList = 919C8A4B20DD8393006EE57D /* Build configuration list for PBXNativeTarget "BridgeRealWorld" */;
buildPhases = (
919C8A4220DD8393006EE57D /* Sources */,
919C8A4320DD8393006EE57D /* Frameworks */,
919C8A4420DD8393006EE57D /* Resources */,
);
buildRules = (
);
dependencies = (
);
name = BridgeRealWorld;
productName = BridgeRealWorld;
productReference = 919C8A4620DD8393006EE57D /* BridgeRealWorld.xctest */;
productType = "com.apple.product-type.bundle.unit-test";
};
919C8A5E20DD849A006EE57D /* AdapterConceptual */ = {
isa = PBXNativeTarget;
buildConfigurationList = 919C8A6420DD849B006EE57D /* Build configuration list for PBXNativeTarget "AdapterConceptual" */;
buildPhases = (
919C8A5B20DD849A006EE57D /* Sources */,
919C8A5C20DD849A006EE57D /* Frameworks */,
919C8A5D20DD849A006EE57D /* Resources */,
);
buildRules = (
);
dependencies = (
);
name = AdapterConceptual;
productName = AdapterConceptual;
productReference = 919C8A5F20DD849A006EE57D /* AdapterConceptual.xctest */;
productType = "com.apple.product-type.bundle.unit-test";
};
919C8A6B20DD858C006EE57D /* AdapterRealWorld */ = {
isa = PBXNativeTarget;
buildConfigurationList = 919C8A7120DD858C006EE57D /* Build configuration list for PBXNativeTarget "AdapterRealWorld" */;
buildPhases = (
919C8A6820DD858C006EE57D /* Sources */,
919C8A6920DD858C006EE57D /* Frameworks */,
919C8A6A20DD858C006EE57D /* Resources */,
);
buildRules = (
);
dependencies = (
);
name = AdapterRealWorld;
productName = AdapterRealWorld;
productReference = 919C8A6C20DD858C006EE57D /* AdapterRealWorld.xctest */;
productType = "com.apple.product-type.bundle.unit-test";
};
919C8A7920DD8688006EE57D /* BuilderConceptual */ = {
isa = PBXNativeTarget;
buildConfigurationList = 919C8A7F20DD8688006EE57D /* Build configuration list for PBXNativeTarget "BuilderConceptual" */;
buildPhases = (
919C8A7620DD8688006EE57D /* Sources */,
919C8A7720DD8688006EE57D /* Frameworks */,
919C8A7820DD8688006EE57D /* Resources */,
);
buildRules = (
);
dependencies = (
);
name = BuilderConceptual;
productName = BuilderConceptual;
productReference = 919C8A7A20DD8688006EE57D /* BuilderConceptual.xctest */;
productType = "com.apple.product-type.bundle.unit-test";
};
919C8A8620DD86DC006EE57D /* BuilderRealWorld */ = {
isa = PBXNativeTarget;
buildConfigurationList = 919C8A8C20DD86DC006EE57D /* Build configuration list for PBXNativeTarget "BuilderRealWorld" */;
buildPhases = (
919C8A8320DD86DC006EE57D /* Sources */,
919C8A8420DD86DC006EE57D /* Frameworks */,
919C8A8520DD86DC006EE57D /* Resources */,
);
buildRules = (
);
dependencies = (
);
name = BuilderRealWorld;
productName = BuilderRealWorld;
productReference = 919C8A8720DD86DC006EE57D /* BuilderRealWorld.xctest */;
productType = "com.apple.product-type.bundle.unit-test";
};
919C8AA120DD878D006EE57D /* CompositeConceptual */ = {
isa = PBXNativeTarget;
buildConfigurationList = 919C8AA720DD878E006EE57D /* Build configuration list for PBXNativeTarget "CompositeConceptual" */;
buildPhases = (
919C8A9E20DD878D006EE57D /* Sources */,
919C8A9F20DD878D006EE57D /* Frameworks */,
919C8AA020DD878D006EE57D /* Resources */,
);
buildRules = (
);
dependencies = (
);
name = CompositeConceptual;
productName = CompositeConceptual;
productReference = 919C8AA220DD878D006EE57D /* CompositeConceptual.xctest */;
productType = "com.apple.product-type.bundle.unit-test";
};
919C8AAE20DD87F2006EE57D /* CompositeRealWorld */ = {
isa = PBXNativeTarget;
buildConfigurationList = 919C8AB420DD87F2006EE57D /* Build configuration list for PBXNativeTarget "CompositeRealWorld" */;
buildPhases = (
919C8AAB20DD87F2006EE57D /* Sources */,
919C8AAC20DD87F2006EE57D /* Frameworks */,
919C8AAD20DD87F2006EE57D /* Resources */,
);
buildRules = (
);
dependencies = (
);
name = CompositeRealWorld;
productName = CompositeRealWorld;
productReference = 919C8AAF20DD87F2006EE57D /* CompositeRealWorld.xctest */;
productType = "com.apple.product-type.bundle.unit-test";
};
919C8AC620DD8873006EE57D /* DecoratorConceptual */ = {
isa = PBXNativeTarget;
buildConfigurationList = 919C8ACC20DD8873006EE57D /* Build configuration list for PBXNativeTarget "DecoratorConceptual" */;
buildPhases = (
919C8AC320DD8873006EE57D /* Sources */,
919C8AC420DD8873006EE57D /* Frameworks */,
919C8AC520DD8873006EE57D /* Resources */,
);
buildRules = (
);
dependencies = (
);
name = DecoratorConceptual;
productName = DecoratorConceptual;
productReference = 919C8AC720DD8873006EE57D /* DecoratorConceptual.xctest */;
productType = "com.apple.product-type.bundle.unit-test";
};
919C8AD320DD88C6006EE57D /* DecoratorRealWorld */ = {
isa = PBXNativeTarget;
buildConfigurationList = 919C8AD920DD88C6006EE57D /* Build configuration list for PBXNativeTarget "DecoratorRealWorld" */;
buildPhases = (
919C8AD020DD88C6006EE57D /* Sources */,
919C8AD120DD88C6006EE57D /* Frameworks */,
919C8AD220DD88C6006EE57D /* Resources */,
);
buildRules = (
);
dependencies = (
);
name = DecoratorRealWorld;
productName = DecoratorRealWorld;
productReference = 919C8AD420DD88C6006EE57D /* DecoratorRealWorld.xctest */;
productType = "com.apple.product-type.bundle.unit-test";
};
919C8ADF20DD893E006EE57D /* FactoryMethodRealWorld */ = {
isa = PBXNativeTarget;
buildConfigurationList = 919C8AE520DD893E006EE57D /* Build configuration list for PBXNativeTarget "FactoryMethodRealWorld" */;
buildPhases = (
919C8ADC20DD893E006EE57D /* Sources */,
919C8ADD20DD893E006EE57D /* Frameworks */,
919C8ADE20DD893E006EE57D /* Resources */,
);
buildRules = (
);
dependencies = (
);
name = FactoryMethodRealWorld;
productName = FactoryMethodRealWorld;
productReference = 919C8AE020DD893E006EE57D /* FactoryMethodRealWorld.xctest */;
productType = "com.apple.product-type.bundle.unit-test";
};
919C8AEC20DD897E006EE57D /* FactoryMethodConceptual */ = {
isa = PBXNativeTarget;
buildConfigurationList = 919C8AF220DD897E006EE57D /* Build configuration list for PBXNativeTarget "FactoryMethodConceptual" */;
buildPhases = (
919C8AE920DD897E006EE57D /* Sources */,
919C8AEA20DD897E006EE57D /* Frameworks */,
919C8AEB20DD897E006EE57D /* Resources */,
);
buildRules = (
);
dependencies = (
);
name = FactoryMethodConceptual;
productName = FactoryConceptual;
productReference = 919C8AED20DD897E006EE57D /* FactoryMethodConceptual.xctest */;
productType = "com.apple.product-type.bundle.unit-test";
};
919C8AF920DD8A98006EE57D /* PrototypeConceptual */ = {
isa = PBXNativeTarget;
buildConfigurationList = 919C8AFF20DD8A98006EE57D /* Build configuration list for PBXNativeTarget "PrototypeConceptual" */;
buildPhases = (
919C8AF620DD8A98006EE57D /* Sources */,
919C8AF720DD8A98006EE57D /* Frameworks */,
919C8AF820DD8A98006EE57D /* Resources */,
);
buildRules = (
);
dependencies = (
);
name = PrototypeConceptual;
productName = PrototypeConceptual;
productReference = 919C8AFA20DD8A98006EE57D /* PrototypeConceptual.xctest */;
productType = "com.apple.product-type.bundle.unit-test";
};
919C8B0620DD8AF0006EE57D /* PrototypeRealWorld */ = {
isa = PBXNativeTarget;
buildConfigurationList = 919C8B0C20DD8AF0006EE57D /* Build configuration list for PBXNativeTarget "PrototypeRealWorld" */;
buildPhases = (
919C8B0320DD8AF0006EE57D /* Sources */,
919C8B0420DD8AF0006EE57D /* Frameworks */,
919C8B0520DD8AF0006EE57D /* Resources */,
);
buildRules = (
);
dependencies = (
);
name = PrototypeRealWorld;
productName = PrototypeRealWorld;
productReference = 919C8B0720DD8AF0006EE57D /* PrototypeRealWorld.xctest */;
productType = "com.apple.product-type.bundle.unit-test";
};
919C8B1320DD8B59006EE57D /* SingletonConceptual */ = {
isa = PBXNativeTarget;
buildConfigurationList = 919C8B1920DD8B59006EE57D /* Build configuration list for PBXNativeTarget "SingletonConceptual" */;
buildPhases = (
919C8B1020DD8B59006EE57D /* Sources */,
919C8B1120DD8B59006EE57D /* Frameworks */,
919C8B1220DD8B59006EE57D /* Resources */,
);
buildRules = (
);
dependencies = (
);
name = SingletonConceptual;
productName = SingletonConceptual;
productReference = 919C8B1420DD8B59006EE57D /* SingletonConceptual.xctest */;
productType = "com.apple.product-type.bundle.unit-test";
};
919C8B2020DD8BA9006EE57D /* SingletonRealWorld */ = {
isa = PBXNativeTarget;
buildConfigurationList = 919C8B2620DD8BA9006EE57D /* Build configuration list for PBXNativeTarget "SingletonRealWorld" */;
buildPhases = (
919C8B1D20DD8BA9006EE57D /* Sources */,
919C8B1E20DD8BA9006EE57D /* Frameworks */,
919C8B1F20DD8BA9006EE57D /* Resources */,
);
buildRules = (
);
dependencies = (
);
name = SingletonRealWorld;
productName = SingletonRealWorld;
productReference = 919C8B2120DD8BA9006EE57D /* SingletonRealWorld.xctest */;
productType = "com.apple.product-type.bundle.unit-test";
};
91B1206A20F610E400730C37 /* ChainOfResponsibilityConceptual */ = {
isa = PBXNativeTarget;
buildConfigurationList = 91B1207020F610E400730C37 /* Build configuration list for PBXNativeTarget "ChainOfResponsibilityConceptual" */;
buildPhases = (
91B1206720F610E400730C37 /* Sources */,
91B1206820F610E400730C37 /* Frameworks */,
91B1206920F610E400730C37 /* Resources */,
);
buildRules = (
);
dependencies = (
);
name = ChainOfResponsibilityConceptual;
productName = ChainOfResponsibilityConceptual;
productReference = 91B1206B20F610E400730C37 /* ChainOfResponsibilityConceptual.xctest */;
productType = "com.apple.product-type.bundle.unit-test";
};
91B1207620F6114A00730C37 /* ChainOfResponsibilityRealWorld */ = {
isa = PBXNativeTarget;
buildConfigurationList = 91B1207C20F6114A00730C37 /* Build configuration list for PBXNativeTarget "ChainOfResponsibilityRealWorld" */;
buildPhases = (
91B1207320F6114A00730C37 /* Sources */,
91B1207420F6114A00730C37 /* Frameworks */,
91B1207520F6114A00730C37 /* Resources */,
);
buildRules = (
);
dependencies = (
);
name = ChainOfResponsibilityRealWorld;
productName = ChainOfResponsibilityRealWorld;
productReference = 91B1207720F6114A00730C37 /* ChainOfResponsibilityRealWorld.xctest */;
productType = "com.apple.product-type.bundle.unit-test";
};
91B1208220F611DA00730C37 /* CommandConceptual */ = {
isa = PBXNativeTarget;
buildConfigurationList = 91B1208820F611DA00730C37 /* Build configuration list for PBXNativeTarget "CommandConceptual" */;
buildPhases = (
91B1207F20F611DA00730C37 /* Sources */,
91B1208020F611DA00730C37 /* Frameworks */,
91B1208120F611DA00730C37 /* Resources */,
);
buildRules = (
);
dependencies = (
);
name = CommandConceptual;
productName = CommandConceptual;
productReference = 91B1208320F611DA00730C37 /* CommandConceptual.xctest */;
productType = "com.apple.product-type.bundle.unit-test";
};
91B1208F20F6120C00730C37 /* CommandRealWorld */ = {
isa = PBXNativeTarget;
buildConfigurationList = 91B1209520F6120C00730C37 /* Build configuration list for PBXNativeTarget "CommandRealWorld" */;
buildPhases = (
91B1208C20F6120C00730C37 /* Sources */,
91B1208D20F6120C00730C37 /* Frameworks */,
91B1208E20F6120C00730C37 /* Resources */,
);
buildRules = (
);
dependencies = (
);
name = CommandRealWorld;
productName = CommandRealWorld;
productReference = 91B1209020F6120C00730C37 /* CommandRealWorld.xctest */;
productType = "com.apple.product-type.bundle.unit-test";
};
91B1209C20F6125500730C37 /* IteratorConceptual */ = {
isa = PBXNativeTarget;
buildConfigurationList = 91B120A220F6125500730C37 /* Build configuration list for PBXNativeTarget "IteratorConceptual" */;
buildPhases = (
91B1209920F6125500730C37 /* Sources */,
91B1209A20F6125500730C37 /* Frameworks */,
91B1209B20F6125500730C37 /* Resources */,
);
buildRules = (
);
dependencies = (
);
name = IteratorConceptual;
productName = IteratorConceptual;
productReference = 91B1209D20F6125500730C37 /* IteratorConceptual.xctest */;
productType = "com.apple.product-type.bundle.unit-test";
};
91B120A820F6127400730C37 /* IteratorRealWorld */ = {
isa = PBXNativeTarget;
buildConfigurationList = 91B120AE20F6127400730C37 /* Build configuration list for PBXNativeTarget "IteratorRealWorld" */;
buildPhases = (
91B120A520F6127400730C37 /* Sources */,
91B120A620F6127400730C37 /* Frameworks */,
91B120A720F6127400730C37 /* Resources */,
);
buildRules = (
);
dependencies = (
);
name = IteratorRealWorld;
productName = IteratorRealWorld;
productReference = 91B120A920F6127400730C37 /* IteratorRealWorld.xctest */;
productType = "com.apple.product-type.bundle.unit-test";
};
91B120B520F6130900730C37 /* ProxyConceptual */ = {
isa = PBXNativeTarget;
buildConfigurationList = 91B120BB20F6130A00730C37 /* Build configuration list for PBXNativeTarget "ProxyConceptual" */;
buildPhases = (
91B120B220F6130900730C37 /* Sources */,
91B120B320F6130900730C37 /* Frameworks */,
91B120B420F6130900730C37 /* Resources */,
);
buildRules = (
);
dependencies = (
);
name = ProxyConceptual;
productName = ProxyConceptual;
productReference = 91B120B620F6130900730C37 /* ProxyConceptual.xctest */;
productType = "com.apple.product-type.bundle.unit-test";
};
91B120C120F6132E00730C37 /* ProxyRealWorld */ = {
isa = PBXNativeTarget;
buildConfigurationList = 91B120C720F6132E00730C37 /* Build configuration list for PBXNativeTarget "ProxyRealWorld" */;
buildPhases = (
91B120BE20F6132E00730C37 /* Sources */,
91B120BF20F6132E00730C37 /* Frameworks */,
91B120C020F6132E00730C37 /* Resources */,
);
buildRules = (
);
dependencies = (
);
name = ProxyRealWorld;
productName = ProxyRealWorld;
productReference = 91B120C220F6132E00730C37 /* ProxyRealWorld.xctest */;
productType = "com.apple.product-type.bundle.unit-test";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
9139FA702088D85C00229150 /* Project object */ = {
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0930;
LastUpgradeCheck = 0930;
ORGANIZATIONNAME = "Eremenko Maxim";
TargetAttributes = {
912C5CDE210BC33D007DC364 = {
CreatedOnToolsVersion = 9.3;
LastSwiftMigration = 1140;
ProvisioningStyle = Automatic;
};
912C5CEB210BC3A4007DC364 = {
CreatedOnToolsVersion = 9.3;
LastSwiftMigration = 1140;
ProvisioningStyle = Automatic;
};
912C5CF7210BC3F5007DC364 = {
CreatedOnToolsVersion = 9.3;
LastSwiftMigration = 1140;
ProvisioningStyle = Automatic;
};
912C5D0A210BC4D8007DC364 = {
CreatedOnToolsVersion = 9.3;
LastSwiftMigration = 1140;
ProvisioningStyle = Automatic;
};
912C5D17210BC553007DC364 = {
CreatedOnToolsVersion = 9.3;
LastSwiftMigration = 1140;
ProvisioningStyle = Automatic;
};
912C5D23210BC594007DC364 = {
CreatedOnToolsVersion = 9.3;
LastSwiftMigration = 1140;
ProvisioningStyle = Automatic;
};
912C5D2F210BC5E1007DC364 = {
CreatedOnToolsVersion = 9.3;
LastSwiftMigration = 1140;
ProvisioningStyle = Automatic;
};
912C5D3C210BC62D007DC364 = {
CreatedOnToolsVersion = 9.3;
LastSwiftMigration = 1140;
ProvisioningStyle = Automatic;
};
912C5D49210BC6A8007DC364 = {
CreatedOnToolsVersion = 9.3;
LastSwiftMigration = 1140;
ProvisioningStyle = Automatic;
};
912C5D55210BC6F0007DC364 = {
CreatedOnToolsVersion = 9.3;
LastSwiftMigration = 1140;
ProvisioningStyle = Automatic;
};
912C5D61210BC749007DC364 = {
CreatedOnToolsVersion = 9.3;
LastSwiftMigration = 1140;
ProvisioningStyle = Automatic;
};
912C5D6E210BC7B1007DC364 = {
CreatedOnToolsVersion = 9.3;
LastSwiftMigration = 1140;
ProvisioningStyle = Automatic;
};
912C5D7B210BC81E007DC364 = {
CreatedOnToolsVersion = 9.3;
LastSwiftMigration = 1140;
ProvisioningStyle = Automatic;
};
912C5D87210BC865007DC364 = {
CreatedOnToolsVersion = 9.3;
LastSwiftMigration = 1140;
ProvisioningStyle = Automatic;
};
91301AD120F55C25003B4FC0 = {
CreatedOnToolsVersion = 9.3;
LastSwiftMigration = 1140;
ProvisioningStyle = Automatic;
};
91301ADE20F55CAA003B4FC0 = {
CreatedOnToolsVersion = 9.3;
LastSwiftMigration = 1140;
ProvisioningStyle = Automatic;
};
919C89F020DD7EE4006EE57D = {
CreatedOnToolsVersion = 9.3;
LastSwiftMigration = 1140;
ProvisioningStyle = Automatic;
};
919C8A0420DD7F3C006EE57D = {
CreatedOnToolsVersion = 9.3;
LastSwiftMigration = 1140;
ProvisioningStyle = Automatic;
};
919C8A1220DD81D0006EE57D = {
CreatedOnToolsVersion = 9.3;
LastSwiftMigration = 1140;
ProvisioningStyle = Automatic;
};
919C8A1F20DD8261006EE57D = {
CreatedOnToolsVersion = 9.3;
LastSwiftMigration = 1140;
ProvisioningStyle = Automatic;
};
919C8A3820DD82F0006EE57D = {
CreatedOnToolsVersion = 9.3;
LastSwiftMigration = 1140;
ProvisioningStyle = Automatic;
};
919C8A4520DD8393006EE57D = {
CreatedOnToolsVersion = 9.3;
LastSwiftMigration = 1140;
ProvisioningStyle = Automatic;
};
919C8A5E20DD849A006EE57D = {
CreatedOnToolsVersion = 9.3;
LastSwiftMigration = 1140;
ProvisioningStyle = Automatic;
};
919C8A6B20DD858C006EE57D = {
CreatedOnToolsVersion = 9.3;
LastSwiftMigration = 1140;
ProvisioningStyle = Automatic;
};
919C8A7920DD8688006EE57D = {
CreatedOnToolsVersion = 9.3;
LastSwiftMigration = 1140;
ProvisioningStyle = Automatic;
};
919C8A8620DD86DC006EE57D = {
CreatedOnToolsVersion = 9.3;
LastSwiftMigration = 1140;
ProvisioningStyle = Automatic;
};
919C8AA120DD878D006EE57D = {
CreatedOnToolsVersion = 9.3;
LastSwiftMigration = 1140;
ProvisioningStyle = Automatic;
};
919C8AAE20DD87F2006EE57D = {
CreatedOnToolsVersion = 9.3;
LastSwiftMigration = 1140;
ProvisioningStyle = Automatic;
};
919C8AC620DD8873006EE57D = {
CreatedOnToolsVersion = 9.3;
LastSwiftMigration = 1140;
ProvisioningStyle = Automatic;
};
919C8AD320DD88C6006EE57D = {
CreatedOnToolsVersion = 9.3;
LastSwiftMigration = 1140;
ProvisioningStyle = Automatic;
};
919C8ADF20DD893E006EE57D = {
CreatedOnToolsVersion = 9.3;
LastSwiftMigration = 1140;
ProvisioningStyle = Automatic;
};
919C8AEC20DD897E006EE57D = {
CreatedOnToolsVersion = 9.3;
LastSwiftMigration = 1140;
ProvisioningStyle = Automatic;
};
919C8AF920DD8A98006EE57D = {
CreatedOnToolsVersion = 9.3;
LastSwiftMigration = 1140;
ProvisioningStyle = Automatic;
};
919C8B0620DD8AF0006EE57D = {
CreatedOnToolsVersion = 9.3;
LastSwiftMigration = 1140;
ProvisioningStyle = Automatic;
};
919C8B1320DD8B59006EE57D = {
CreatedOnToolsVersion = 9.3;
LastSwiftMigration = 1140;
ProvisioningStyle = Automatic;
};
919C8B2020DD8BA9006EE57D = {
CreatedOnToolsVersion = 9.3;
LastSwiftMigration = 1140;
ProvisioningStyle = Automatic;
};
91B1206A20F610E400730C37 = {
CreatedOnToolsVersion = 9.3;
LastSwiftMigration = 1140;
ProvisioningStyle = Automatic;
};
91B1207620F6114A00730C37 = {
CreatedOnToolsVersion = 9.3;
LastSwiftMigration = 1140;
ProvisioningStyle = Automatic;
};
91B1208220F611DA00730C37 = {
CreatedOnToolsVersion = 9.3;
LastSwiftMigration = 1140;
ProvisioningStyle = Automatic;
};
91B1208F20F6120C00730C37 = {
CreatedOnToolsVersion = 9.3;
LastSwiftMigration = 1140;
ProvisioningStyle = Automatic;
};
91B1209C20F6125500730C37 = {
CreatedOnToolsVersion = 9.3;
LastSwiftMigration = 1140;
ProvisioningStyle = Automatic;
};
91B120A820F6127400730C37 = {
CreatedOnToolsVersion = 9.3;
LastSwiftMigration = 1140;
ProvisioningStyle = Automatic;
};
91B120B520F6130900730C37 = {
CreatedOnToolsVersion = 9.3;
LastSwiftMigration = 1140;
ProvisioningStyle = Automatic;
};
91B120C120F6132E00730C37 = {
CreatedOnToolsVersion = 9.3;
LastSwiftMigration = 1140;
ProvisioningStyle = Automatic;
};
};
};
buildConfigurationList = 9139FA732088D85C00229150 /* Build configuration list for PBXProject "RefactoringGuru.Patterns" */;
compatibilityVersion = "Xcode 8.0";
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
en,
Base,
);
mainGroup = 9139FA6F2088D85C00229150;
productRefGroup = 9139FA792088D85C00229150 /* Products */;
projectDirPath = "";
projectRoot = "";
targets = (
919C8A0420DD7F3C006EE57D /* AbstractFactoryConceptual */,
919C89F020DD7EE4006EE57D /* AbstractFactoryRealWorld */,
919C8A5E20DD849A006EE57D /* AdapterConceptual */,
919C8A6B20DD858C006EE57D /* AdapterRealWorld */,
919C8A3820DD82F0006EE57D /* BridgeConceptual */,
919C8A4520DD8393006EE57D /* BridgeRealWorld */,
919C8A7920DD8688006EE57D /* BuilderConceptual */,
919C8A8620DD86DC006EE57D /* BuilderRealWorld */,
919C8A1220DD81D0006EE57D /* FacadeConceptual */,
919C8A1F20DD8261006EE57D /* FacadeRealWorld */,
919C8AA120DD878D006EE57D /* CompositeConceptual */,
919C8AAE20DD87F2006EE57D /* CompositeRealWorld */,
919C8AC620DD8873006EE57D /* DecoratorConceptual */,
919C8AD320DD88C6006EE57D /* DecoratorRealWorld */,
919C8AEC20DD897E006EE57D /* FactoryMethodConceptual */,
919C8ADF20DD893E006EE57D /* FactoryMethodRealWorld */,
919C8AF920DD8A98006EE57D /* PrototypeConceptual */,
919C8B0620DD8AF0006EE57D /* PrototypeRealWorld */,
919C8B1320DD8B59006EE57D /* SingletonConceptual */,
919C8B2020DD8BA9006EE57D /* SingletonRealWorld */,
91301AD120F55C25003B4FC0 /* FlyweightConceptual */,
91301ADE20F55CAA003B4FC0 /* FlyweightRealWorld */,
91B1206A20F610E400730C37 /* ChainOfResponsibilityConceptual */,
91B1207620F6114A00730C37 /* ChainOfResponsibilityRealWorld */,
91B1208220F611DA00730C37 /* CommandConceptual */,
91B1208F20F6120C00730C37 /* CommandRealWorld */,
91B1209C20F6125500730C37 /* IteratorConceptual */,
91B120A820F6127400730C37 /* IteratorRealWorld */,
91B120B520F6130900730C37 /* ProxyConceptual */,
91B120C120F6132E00730C37 /* ProxyRealWorld */,
912C5CDE210BC33D007DC364 /* MediatorConceptual */,
912C5CEB210BC3A4007DC364 /* MediatorRealWorld */,
912C5CF7210BC3F5007DC364 /* MementoConceptual */,
912C5D0A210BC4D8007DC364 /* MementoRealWorld */,
912C5D17210BC553007DC364 /* ObserverConceptual */,
912C5D23210BC594007DC364 /* ObserverRealWorld */,
912C5D2F210BC5E1007DC364 /* StateConceptual */,
912C5D3C210BC62D007DC364 /* StateRealWorld */,
912C5D49210BC6A8007DC364 /* StrategyConceptual */,
912C5D55210BC6F0007DC364 /* StrategyRealWorld */,
912C5D61210BC749007DC364 /* TemplateMethodConceptual */,
912C5D6E210BC7B1007DC364 /* TemplateMethodRealWorld */,
912C5D7B210BC81E007DC364 /* VisitorConceptual */,
912C5D87210BC865007DC364 /* VisitorRealWorld */,
);
};
/* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */
912C5CDD210BC33D007DC364 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
912C5CEA210BC3A4007DC364 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
912C5CF6210BC3F5007DC364 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
912C5D09210BC4D8007DC364 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
912C5D16210BC553007DC364 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
912C5D22210BC594007DC364 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
912C5D2E210BC5E1007DC364 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
912C5D3B210BC62D007DC364 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
912C5D48210BC6A8007DC364 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
912C5D54210BC6F0007DC364 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
912C5D60210BC749007DC364 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
912C5D6D210BC7B1007DC364 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
912C5D7A210BC81E007DC364 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
912C5D86210BC865007DC364 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
91301AD020F55C25003B4FC0 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
91301ADD20F55CAA003B4FC0 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
919C89EF20DD7EE4006EE57D /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
919C8A0320DD7F3C006EE57D /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
919C8A1120DD81D0006EE57D /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
919C8A1E20DD8261006EE57D /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
919C8A3720DD82F0006EE57D /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
919C8A4420DD8393006EE57D /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
919C8A5D20DD849A006EE57D /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
919C8A6A20DD858C006EE57D /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
919C8A7820DD8688006EE57D /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
919C8A8520DD86DC006EE57D /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
919C8AA020DD878D006EE57D /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
919C8AAD20DD87F2006EE57D /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
919C8AC520DD8873006EE57D /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
919C8AD220DD88C6006EE57D /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
919C8ADE20DD893E006EE57D /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
919C8AEB20DD897E006EE57D /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
919C8AF820DD8A98006EE57D /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
919C8B0520DD8AF0006EE57D /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
919C8B1220DD8B59006EE57D /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
919C8B1F20DD8BA9006EE57D /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
91B1206920F610E400730C37 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
91B1207520F6114A00730C37 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
91B1208120F611DA00730C37 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
91B1208E20F6120C00730C37 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
91B1209B20F6125500730C37 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
91B120A720F6127400730C37 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
91B120B420F6130900730C37 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
91B120C020F6132E00730C37 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
912C5CDB210BC33D007DC364 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
912C5CE2210BC33E007DC364 /* Example.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
912C5CE8210BC3A4007DC364 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
912C5CEF210BC3A4007DC364 /* Example.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
912C5CF4210BC3F5007DC364 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
912C5D05210BC4A5007DC364 /* Example.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
912C5D07210BC4D8007DC364 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
912C5D0E210BC4D9007DC364 /* Example.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
912C5D14210BC553007DC364 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
912C5D1B210BC553007DC364 /* Example.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
912C5D20210BC594007DC364 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
912C5D27210BC594007DC364 /* Example.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
912C5D2C210BC5E1007DC364 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
912C5D33210BC5E1007DC364 /* Example.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
912C5D39210BC62D007DC364 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
912C5D40210BC62D007DC364 /* Example.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
912C5D46210BC6A8007DC364 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
912C5D4D210BC6A8007DC364 /* Example.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
912C5D52210BC6F0007DC364 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
912C5D59210BC6F1007DC364 /* Example.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
912C5D5E210BC749007DC364 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
912C5D65210BC749007DC364 /* Example.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
912C5D6B210BC7B1007DC364 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
912C5D72210BC7B1007DC364 /* Example.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
912C5D78210BC81E007DC364 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
912C5D7F210BC81E007DC364 /* Example.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
912C5D84210BC865007DC364 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
912C5D8B210BC865007DC364 /* Example.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
91301ACE20F55C25003B4FC0 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
91301AD520F55C25003B4FC0 /* Example.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
91301ADB20F55CAA003B4FC0 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
91301AE220F55CAA003B4FC0 /* Example.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
919C89ED20DD7EE4006EE57D /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
919C89FA20DD7F03006EE57D /* Example.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
919C8A0120DD7F3C006EE57D /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
919C8A0D20DD7F58006EE57D /* Example.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
919C8A0F20DD81D0006EE57D /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
919C8A1B20DD81E7006EE57D /* Example.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
919C8A1C20DD8261006EE57D /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
919C8A2820DD829C006EE57D /* Example.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
919C8A3520DD82F0006EE57D /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
919C8A4120DD832C006EE57D /* Example.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
919C8A4220DD8393006EE57D /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
919C8A4E20DD83AA006EE57D /* Example.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
919C8A5B20DD849A006EE57D /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
919C8A6720DD84DB006EE57D /* Example.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
919C8A6820DD858C006EE57D /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
919C8A7520DD85A3006EE57D /* Example.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
919C8A7620DD8688006EE57D /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
919C8A8220DD8698006EE57D /* Example.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
919C8A8320DD86DC006EE57D /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
919C8A8F20DD86EB006EE57D /* Example.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
919C8A9E20DD878D006EE57D /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
919C8AAA20DD879C006EE57D /* Example.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
919C8AAB20DD87F2006EE57D /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
919C8AB220DD87F2006EE57D /* Example.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
919C8AC320DD8873006EE57D /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
919C8ACF20DD887F006EE57D /* Example.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
919C8AD020DD88C6006EE57D /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
919C8AD720DD88C6006EE57D /* Example.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
919C8ADC20DD893E006EE57D /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
919C8AE820DD894F006EE57D /* Example.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
919C8AE920DD897E006EE57D /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
919C8AF520DD89CE006EE57D /* Example.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
919C8AF620DD8A98006EE57D /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
919C8B0220DD8AB3006EE57D /* Example.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
919C8B0320DD8AF0006EE57D /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
919C8B0F20DD8B12006EE57D /* Example.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
919C8B1020DD8B59006EE57D /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
919C8B1C20DD8B70006EE57D /* Example.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
919C8B1D20DD8BA9006EE57D /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
919C8B2920DD8BC3006EE57D /* Example.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
91B1206720F610E400730C37 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
91B1206E20F610E400730C37 /* Example.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
91B1207320F6114A00730C37 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
91B1207A20F6114A00730C37 /* Example.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
91B1207F20F611DA00730C37 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
91B1208620F611DA00730C37 /* Example.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
91B1208C20F6120C00730C37 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
91B1209320F6120C00730C37 /* Example.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
91B1209920F6125500730C37 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
91B120A020F6125500730C37 /* Example.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
91B120A520F6127400730C37 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
91B120AC20F6127400730C37 /* Example.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
91B120B220F6130900730C37 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
91B120B920F6130A00730C37 /* Example.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
91B120BE20F6132E00730C37 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
91B120C520F6132E00730C37 /* Example.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin XCBuildConfiguration section */
912C5CE5210BC33E007DC364 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
INFOPLIST_FILE = Sources/Mediator/Conceptual/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.maxim.eremenko.MediatorConceptual;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
};
912C5CE6210BC33E007DC364 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
INFOPLIST_FILE = Sources/Mediator/Conceptual/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.maxim.eremenko.MediatorConceptual;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Release;
};
912C5CF2210BC3A4007DC364 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
INFOPLIST_FILE = Sources/Mediator/RealWorld/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.maxim.eremenko.MediatorRealWorld;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
};
912C5CF3210BC3A4007DC364 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
INFOPLIST_FILE = Sources/Mediator/RealWorld/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.maxim.eremenko.MediatorRealWorld;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Release;
};
912C5CFE210BC3F5007DC364 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
INFOPLIST_FILE = Sources/Memento/Conceptual/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.maxim.eremenko.MementoConceptual;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
};
912C5CFF210BC3F5007DC364 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
INFOPLIST_FILE = Sources/Memento/Conceptual/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.maxim.eremenko.MementoConceptual;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Release;
};
912C5D11210BC4D9007DC364 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
INFOPLIST_FILE = Sources/Memento/RealWorld/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.maxim.eremenko.MementoRealWorld;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
};
912C5D12210BC4D9007DC364 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
INFOPLIST_FILE = Sources/Memento/RealWorld/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.maxim.eremenko.MementoRealWorld;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Release;
};
912C5D1E210BC553007DC364 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
INFOPLIST_FILE = Sources/Observer/Conceptual/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.maxim.eremenko.ObserverConceptual;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
};
912C5D1F210BC553007DC364 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
INFOPLIST_FILE = Sources/Observer/Conceptual/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.maxim.eremenko.ObserverConceptual;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Release;
};
912C5D2A210BC594007DC364 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
INFOPLIST_FILE = Sources/Observer/RealWorld/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.maxim.eremenko.ObserverRealWorld;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
};
912C5D2B210BC594007DC364 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
INFOPLIST_FILE = Sources/Observer/RealWorld/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.maxim.eremenko.ObserverRealWorld;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Release;
};
912C5D36210BC5E1007DC364 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
INFOPLIST_FILE = Sources/State/Conceptual/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.maxim.eremenko.StateConceptual;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
};
912C5D37210BC5E1007DC364 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
INFOPLIST_FILE = Sources/State/Conceptual/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.maxim.eremenko.StateConceptual;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Release;
};
912C5D43210BC62D007DC364 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
INFOPLIST_FILE = Sources/State/RealWorld/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.maxim.eremenko.StateRealWorld;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
};
912C5D44210BC62D007DC364 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
INFOPLIST_FILE = Sources/State/RealWorld/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.maxim.eremenko.StateRealWorld;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Release;
};
912C5D50210BC6A8007DC364 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
INFOPLIST_FILE = Sources/Strategy/Conceptual/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.maxim.eremenko.StrategyConceptual;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
};
912C5D51210BC6A8007DC364 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
INFOPLIST_FILE = Sources/Strategy/Conceptual/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.maxim.eremenko.StrategyConceptual;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Release;
};
912C5D5C210BC6F1007DC364 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
INFOPLIST_FILE = Sources/Strategy/RealWorld/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.maxim.eremenko.StrategyRealWorld;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
};
912C5D5D210BC6F1007DC364 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
INFOPLIST_FILE = Sources/Strategy/RealWorld/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.maxim.eremenko.StrategyRealWorld;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Release;
};
912C5D68210BC749007DC364 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
INFOPLIST_FILE = Sources/TemplateMethod/Conceptual/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.maxim.eremenko.TemplateMethodConceptual;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
};
912C5D69210BC749007DC364 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
INFOPLIST_FILE = Sources/TemplateMethod/Conceptual/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.maxim.eremenko.TemplateMethodConceptual;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Release;
};
912C5D75210BC7B1007DC364 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
INFOPLIST_FILE = Sources/TemplateMethod/RealWorld/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.maxim.eremenko.TemplateMethodRealWorld;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
};
912C5D76210BC7B1007DC364 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
INFOPLIST_FILE = Sources/TemplateMethod/RealWorld/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.maxim.eremenko.TemplateMethodRealWorld;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Release;
};
912C5D82210BC81E007DC364 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
INFOPLIST_FILE = Sources/Visitor/Conceptual/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.maxim.eremenko.VisitorConceptual;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
};
912C5D83210BC81E007DC364 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
INFOPLIST_FILE = Sources/Visitor/Conceptual/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.maxim.eremenko.VisitorConceptual;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Release;
};
912C5D8E210BC865007DC364 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
INFOPLIST_FILE = Sources/Visitor/RealWorld/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.maxim.eremenko.VisitorRealWorld;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
};
912C5D8F210BC865007DC364 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
INFOPLIST_FILE = Sources/Visitor/RealWorld/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.maxim.eremenko.VisitorRealWorld;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Release;
};
91301AD820F55C25003B4FC0 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
INFOPLIST_FILE = Sources/Flyweight/Conceptual/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.maxim.eremenko.FlyweightConceptual;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
};
91301AD920F55C25003B4FC0 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
INFOPLIST_FILE = Sources/Flyweight/Conceptual/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.maxim.eremenko.FlyweightConceptual;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Release;
};
91301AE520F55CAA003B4FC0 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
INFOPLIST_FILE = Sources/Flyweight/RealWorld/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.maxim.eremenko.FlyweightRealWorld;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
};
91301AE620F55CAA003B4FC0 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
INFOPLIST_FILE = Sources/Flyweight/RealWorld/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.maxim.eremenko.FlyweightRealWorld;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Release;
};
9139FA932088D85F00229150 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_ENABLE_OBJC_WEAK = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_IDENTITY = "iPhone Developer";
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = dwarf;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 11.3;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
};
name = Debug;
};
9139FA942088D85F00229150 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_ENABLE_OBJC_WEAK = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_IDENTITY = "iPhone Developer";
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 11.3;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
VALIDATE_PRODUCT = YES;
};
name = Release;
};
919C89F620DD7EE4006EE57D /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
INFOPLIST_FILE = Sources/AbstractFactory/RealWorld/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.maxim.eremenko.AbstractFactoryRealWorld;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
};
919C89F720DD7EE4006EE57D /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
INFOPLIST_FILE = Sources/AbstractFactory/RealWorld/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.maxim.eremenko.AbstractFactoryRealWorld;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Release;
};
919C8A0B20DD7F3C006EE57D /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
INFOPLIST_FILE = Sources/AbstractFactory/Conceptual/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.maxim.eremenko.AbstractFactoryConceptual;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
};
919C8A0C20DD7F3C006EE57D /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
INFOPLIST_FILE = Sources/AbstractFactory/Conceptual/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.maxim.eremenko.AbstractFactoryConceptual;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Release;
};
919C8A1920DD81D0006EE57D /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
INFOPLIST_FILE = Sources/Facade/Conceptual/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.maxim.eremenko.FacadeConceptual;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
};
919C8A1A20DD81D0006EE57D /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
INFOPLIST_FILE = Sources/Facade/Conceptual/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.maxim.eremenko.FacadeConceptual;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Release;
};
919C8A2620DD8261006EE57D /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
INFOPLIST_FILE = Sources/Facade/RealWorld/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.maxim.eremenko.FacadeRealWorld;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
};
919C8A2720DD8261006EE57D /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
INFOPLIST_FILE = Sources/Facade/RealWorld/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.maxim.eremenko.FacadeRealWorld;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Release;
};
919C8A3F20DD82F0006EE57D /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
INFOPLIST_FILE = Sources/Bridge/Conceptual/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.maxim.eremenko.BridgeConceptual;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
};
919C8A4020DD82F0006EE57D /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
INFOPLIST_FILE = Sources/Bridge/Conceptual/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.maxim.eremenko.BridgeConceptual;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Release;
};
919C8A4C20DD8393006EE57D /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
INFOPLIST_FILE = Sources/Bridge/RealWorld/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.maxim.eremenko.BridgeRealWorld;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
};
919C8A4D20DD8393006EE57D /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
INFOPLIST_FILE = Sources/Bridge/RealWorld/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.maxim.eremenko.BridgeRealWorld;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Release;
};
919C8A6520DD849B006EE57D /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
INFOPLIST_FILE = Sources/Adapter/Conceptual/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.maxim.eremenko.AdapterConceptual;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
};
919C8A6620DD849B006EE57D /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
INFOPLIST_FILE = Sources/Adapter/Conceptual/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.maxim.eremenko.AdapterConceptual;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Release;
};
919C8A7220DD858C006EE57D /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
INFOPLIST_FILE = Sources/Adapter/RealWorld/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.maxim.eremenko.AdapterRealWorld;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
};
919C8A7320DD858C006EE57D /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
INFOPLIST_FILE = Sources/Adapter/RealWorld/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.maxim.eremenko.AdapterRealWorld;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Release;
};
919C8A8020DD8688006EE57D /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
INFOPLIST_FILE = Sources/Builder/Conceptual/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.maxim.eremenko.BuilderConceptual;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
};
919C8A8120DD8688006EE57D /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
INFOPLIST_FILE = Sources/Builder/Conceptual/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.maxim.eremenko.BuilderConceptual;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Release;
};
919C8A8D20DD86DC006EE57D /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
INFOPLIST_FILE = Sources/Builder/RealWorld/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.maxim.eremenko.BuilderRealWorld;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
};
919C8A8E20DD86DC006EE57D /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
INFOPLIST_FILE = Sources/Builder/RealWorld/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.maxim.eremenko.BuilderRealWorld;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Release;
};
919C8AA820DD878E006EE57D /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
INFOPLIST_FILE = Sources/Composite/Conceptual/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.maxim.eremenko.CompositeConceptual;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
};
919C8AA920DD878E006EE57D /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
INFOPLIST_FILE = Sources/Composite/Conceptual/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.maxim.eremenko.CompositeConceptual;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Release;
};
919C8AB520DD87F2006EE57D /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
INFOPLIST_FILE = Sources/Composite/RealWorld/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.maxim.eremenko.CompositeRealWorld;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
};
919C8AB620DD87F2006EE57D /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
INFOPLIST_FILE = Sources/Composite/RealWorld/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.maxim.eremenko.CompositeRealWorld;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Release;
};
919C8ACD20DD8873006EE57D /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
INFOPLIST_FILE = Sources/Decorator/Conceptual/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.maxim.eremenko.DecoratorConceptual;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
};
919C8ACE20DD8873006EE57D /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
INFOPLIST_FILE = Sources/Decorator/Conceptual/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.maxim.eremenko.DecoratorConceptual;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Release;
};
919C8ADA20DD88C6006EE57D /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
INFOPLIST_FILE = Sources/Decorator/RealWorld/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.maxim.eremenko.DecoratorRealWorld;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
};
919C8ADB20DD88C6006EE57D /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
INFOPLIST_FILE = Sources/Decorator/RealWorld/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.maxim.eremenko.DecoratorRealWorld;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Release;
};
919C8AE620DD893E006EE57D /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
INFOPLIST_FILE = Sources/FactoryMethod/RealWorld/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.maxim.eremenko.FactoryMethodRealWorld;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
};
919C8AE720DD893E006EE57D /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
INFOPLIST_FILE = Sources/FactoryMethod/RealWorld/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.maxim.eremenko.FactoryMethodRealWorld;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Release;
};
919C8AF320DD897E006EE57D /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
INFOPLIST_FILE = Sources/FactoryMethod/Conceptual/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.maxim.eremenko.FactoryConceptual;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
};
919C8AF420DD897E006EE57D /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
INFOPLIST_FILE = Sources/FactoryMethod/Conceptual/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.maxim.eremenko.FactoryConceptual;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Release;
};
919C8B0020DD8A98006EE57D /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
INFOPLIST_FILE = Sources/Prototype/Conceptual/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.maxim.eremenko.PrototypeConceptual;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
};
919C8B0120DD8A98006EE57D /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
INFOPLIST_FILE = Sources/Prototype/Conceptual/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.maxim.eremenko.PrototypeConceptual;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Release;
};
919C8B0D20DD8AF0006EE57D /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
INFOPLIST_FILE = Sources/Prototype/RealWorld/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.maxim.eremenko.PrototypeRealWorld;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
};
919C8B0E20DD8AF0006EE57D /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
INFOPLIST_FILE = Sources/Prototype/RealWorld/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.maxim.eremenko.PrototypeRealWorld;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Release;
};
919C8B1A20DD8B59006EE57D /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
INFOPLIST_FILE = Sources/Singleton/Conceptual/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.maxim.eremenko.SingletonConceptual;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
};
919C8B1B20DD8B59006EE57D /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
INFOPLIST_FILE = Sources/Singleton/Conceptual/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.maxim.eremenko.SingletonConceptual;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Release;
};
919C8B2720DD8BA9006EE57D /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
INFOPLIST_FILE = Sources/Singleton/RealWorld/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.maxim.eremenko.SingletonRealWorld;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
};
919C8B2820DD8BA9006EE57D /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
INFOPLIST_FILE = Sources/Singleton/RealWorld/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.maxim.eremenko.SingletonRealWorld;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Release;
};
91B1207120F610E400730C37 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
INFOPLIST_FILE = Sources/ChainOfResponsibility/Conceptual/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.maxim.eremenko.ChainOfResponsibilityConceptual;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
};
91B1207220F610E400730C37 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
INFOPLIST_FILE = Sources/ChainOfResponsibility/Conceptual/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.maxim.eremenko.ChainOfResponsibilityConceptual;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Release;
};
91B1207D20F6114A00730C37 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
INFOPLIST_FILE = Sources/ChainOfResponsibility/RealWorld/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.maxim.eremenko.ChainOfResponsibilityRealWorld;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
};
91B1207E20F6114A00730C37 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
INFOPLIST_FILE = Sources/ChainOfResponsibility/RealWorld/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.maxim.eremenko.ChainOfResponsibilityRealWorld;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Release;
};
91B1208920F611DA00730C37 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
INFOPLIST_FILE = Sources/Command/Conceptual/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.maxim.eremenko.CommandConceptual;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
};
91B1208A20F611DA00730C37 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
INFOPLIST_FILE = Sources/Command/Conceptual/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.maxim.eremenko.CommandConceptual;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Release;
};
91B1209620F6120C00730C37 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
INFOPLIST_FILE = Sources/Command/RealWorld/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.maxim.eremenko.CommandRealWorld;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
};
91B1209720F6120C00730C37 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
INFOPLIST_FILE = Sources/Command/RealWorld/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.maxim.eremenko.CommandRealWorld;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Release;
};
91B120A320F6125500730C37 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
INFOPLIST_FILE = Sources/Iterator/Conceptual/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.maxim.eremenko.IteratorConceptual;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
};
91B120A420F6125500730C37 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
INFOPLIST_FILE = Sources/Iterator/Conceptual/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.maxim.eremenko.IteratorConceptual;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Release;
};
91B120AF20F6127400730C37 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
INFOPLIST_FILE = Sources/Iterator/RealWorld/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.maxim.eremenko.IteratorRealWorld;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
};
91B120B020F6127400730C37 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
INFOPLIST_FILE = Sources/Iterator/RealWorld/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.maxim.eremenko.IteratorRealWorld;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Release;
};
91B120BC20F6130A00730C37 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
INFOPLIST_FILE = Sources/Proxy/Conceptual/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.maxim.eremenko.ProxyConceptual;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
};
91B120BD20F6130A00730C37 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
INFOPLIST_FILE = Sources/Proxy/Conceptual/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.maxim.eremenko.ProxyConceptual;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Release;
};
91B120C820F6132E00730C37 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
INFOPLIST_FILE = Sources/Proxy/RealWorld/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.maxim.eremenko.ProxyRealWorld;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
};
91B120C920F6132E00730C37 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
INFOPLIST_FILE = Sources/Proxy/RealWorld/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.maxim.eremenko.ProxyRealWorld;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
912C5CE4210BC33E007DC364 /* Build configuration list for PBXNativeTarget "MediatorConceptual" */ = {
isa = XCConfigurationList;
buildConfigurations = (
912C5CE5210BC33E007DC364 /* Debug */,
912C5CE6210BC33E007DC364 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
912C5CF1210BC3A4007DC364 /* Build configuration list for PBXNativeTarget "MediatorRealWorld" */ = {
isa = XCConfigurationList;
buildConfigurations = (
912C5CF2210BC3A4007DC364 /* Debug */,
912C5CF3210BC3A4007DC364 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
912C5CFD210BC3F5007DC364 /* Build configuration list for PBXNativeTarget "MementoConceptual" */ = {
isa = XCConfigurationList;
buildConfigurations = (
912C5CFE210BC3F5007DC364 /* Debug */,
912C5CFF210BC3F5007DC364 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
912C5D10210BC4D9007DC364 /* Build configuration list for PBXNativeTarget "MementoRealWorld" */ = {
isa = XCConfigurationList;
buildConfigurations = (
912C5D11210BC4D9007DC364 /* Debug */,
912C5D12210BC4D9007DC364 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
912C5D1D210BC553007DC364 /* Build configuration list for PBXNativeTarget "ObserverConceptual" */ = {
isa = XCConfigurationList;
buildConfigurations = (
912C5D1E210BC553007DC364 /* Debug */,
912C5D1F210BC553007DC364 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
912C5D29210BC594007DC364 /* Build configuration list for PBXNativeTarget "ObserverRealWorld" */ = {
isa = XCConfigurationList;
buildConfigurations = (
912C5D2A210BC594007DC364 /* Debug */,
912C5D2B210BC594007DC364 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
912C5D35210BC5E1007DC364 /* Build configuration list for PBXNativeTarget "StateConceptual" */ = {
isa = XCConfigurationList;
buildConfigurations = (
912C5D36210BC5E1007DC364 /* Debug */,
912C5D37210BC5E1007DC364 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
912C5D42210BC62D007DC364 /* Build configuration list for PBXNativeTarget "StateRealWorld" */ = {
isa = XCConfigurationList;
buildConfigurations = (
912C5D43210BC62D007DC364 /* Debug */,
912C5D44210BC62D007DC364 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
912C5D4F210BC6A8007DC364 /* Build configuration list for PBXNativeTarget "StrategyConceptual" */ = {
isa = XCConfigurationList;
buildConfigurations = (
912C5D50210BC6A8007DC364 /* Debug */,
912C5D51210BC6A8007DC364 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
912C5D5B210BC6F1007DC364 /* Build configuration list for PBXNativeTarget "StrategyRealWorld" */ = {
isa = XCConfigurationList;
buildConfigurations = (
912C5D5C210BC6F1007DC364 /* Debug */,
912C5D5D210BC6F1007DC364 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
912C5D67210BC749007DC364 /* Build configuration list for PBXNativeTarget "TemplateMethodConceptual" */ = {
isa = XCConfigurationList;
buildConfigurations = (
912C5D68210BC749007DC364 /* Debug */,
912C5D69210BC749007DC364 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
912C5D74210BC7B1007DC364 /* Build configuration list for PBXNativeTarget "TemplateMethodRealWorld" */ = {
isa = XCConfigurationList;
buildConfigurations = (
912C5D75210BC7B1007DC364 /* Debug */,
912C5D76210BC7B1007DC364 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
912C5D81210BC81E007DC364 /* Build configuration list for PBXNativeTarget "VisitorConceptual" */ = {
isa = XCConfigurationList;
buildConfigurations = (
912C5D82210BC81E007DC364 /* Debug */,
912C5D83210BC81E007DC364 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
912C5D8D210BC865007DC364 /* Build configuration list for PBXNativeTarget "VisitorRealWorld" */ = {
isa = XCConfigurationList;
buildConfigurations = (
912C5D8E210BC865007DC364 /* Debug */,
912C5D8F210BC865007DC364 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
91301AD720F55C25003B4FC0 /* Build configuration list for PBXNativeTarget "FlyweightConceptual" */ = {
isa = XCConfigurationList;
buildConfigurations = (
91301AD820F55C25003B4FC0 /* Debug */,
91301AD920F55C25003B4FC0 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
91301AE420F55CAA003B4FC0 /* Build configuration list for PBXNativeTarget "FlyweightRealWorld" */ = {
isa = XCConfigurationList;
buildConfigurations = (
91301AE520F55CAA003B4FC0 /* Debug */,
91301AE620F55CAA003B4FC0 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
9139FA732088D85C00229150 /* Build configuration list for PBXProject "RefactoringGuru.Patterns" */ = {
isa = XCConfigurationList;
buildConfigurations = (
9139FA932088D85F00229150 /* Debug */,
9139FA942088D85F00229150 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
919C89F820DD7EE4006EE57D /* Build configuration list for PBXNativeTarget "AbstractFactoryRealWorld" */ = {
isa = XCConfigurationList;
buildConfigurations = (
919C89F620DD7EE4006EE57D /* Debug */,
919C89F720DD7EE4006EE57D /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
919C8A0A20DD7F3C006EE57D /* Build configuration list for PBXNativeTarget "AbstractFactoryConceptual" */ = {
isa = XCConfigurationList;
buildConfigurations = (
919C8A0B20DD7F3C006EE57D /* Debug */,
919C8A0C20DD7F3C006EE57D /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
919C8A1820DD81D0006EE57D /* Build configuration list for PBXNativeTarget "FacadeConceptual" */ = {
isa = XCConfigurationList;
buildConfigurations = (
919C8A1920DD81D0006EE57D /* Debug */,
919C8A1A20DD81D0006EE57D /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
919C8A2520DD8261006EE57D /* Build configuration list for PBXNativeTarget "FacadeRealWorld" */ = {
isa = XCConfigurationList;
buildConfigurations = (
919C8A2620DD8261006EE57D /* Debug */,
919C8A2720DD8261006EE57D /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
919C8A3E20DD82F0006EE57D /* Build configuration list for PBXNativeTarget "BridgeConceptual" */ = {
isa = XCConfigurationList;
buildConfigurations = (
919C8A3F20DD82F0006EE57D /* Debug */,
919C8A4020DD82F0006EE57D /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
919C8A4B20DD8393006EE57D /* Build configuration list for PBXNativeTarget "BridgeRealWorld" */ = {
isa = XCConfigurationList;
buildConfigurations = (
919C8A4C20DD8393006EE57D /* Debug */,
919C8A4D20DD8393006EE57D /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
919C8A6420DD849B006EE57D /* Build configuration list for PBXNativeTarget "AdapterConceptual" */ = {
isa = XCConfigurationList;
buildConfigurations = (
919C8A6520DD849B006EE57D /* Debug */,
919C8A6620DD849B006EE57D /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
919C8A7120DD858C006EE57D /* Build configuration list for PBXNativeTarget "AdapterRealWorld" */ = {
isa = XCConfigurationList;
buildConfigurations = (
919C8A7220DD858C006EE57D /* Debug */,
919C8A7320DD858C006EE57D /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
919C8A7F20DD8688006EE57D /* Build configuration list for PBXNativeTarget "BuilderConceptual" */ = {
isa = XCConfigurationList;
buildConfigurations = (
919C8A8020DD8688006EE57D /* Debug */,
919C8A8120DD8688006EE57D /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
919C8A8C20DD86DC006EE57D /* Build configuration list for PBXNativeTarget "BuilderRealWorld" */ = {
isa = XCConfigurationList;
buildConfigurations = (
919C8A8D20DD86DC006EE57D /* Debug */,
919C8A8E20DD86DC006EE57D /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
919C8AA720DD878E006EE57D /* Build configuration list for PBXNativeTarget "CompositeConceptual" */ = {
isa = XCConfigurationList;
buildConfigurations = (
919C8AA820DD878E006EE57D /* Debug */,
919C8AA920DD878E006EE57D /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
919C8AB420DD87F2006EE57D /* Build configuration list for PBXNativeTarget "CompositeRealWorld" */ = {
isa = XCConfigurationList;
buildConfigurations = (
919C8AB520DD87F2006EE57D /* Debug */,
919C8AB620DD87F2006EE57D /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
919C8ACC20DD8873006EE57D /* Build configuration list for PBXNativeTarget "DecoratorConceptual" */ = {
isa = XCConfigurationList;
buildConfigurations = (
919C8ACD20DD8873006EE57D /* Debug */,
919C8ACE20DD8873006EE57D /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
919C8AD920DD88C6006EE57D /* Build configuration list for PBXNativeTarget "DecoratorRealWorld" */ = {
isa = XCConfigurationList;
buildConfigurations = (
919C8ADA20DD88C6006EE57D /* Debug */,
919C8ADB20DD88C6006EE57D /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
919C8AE520DD893E006EE57D /* Build configuration list for PBXNativeTarget "FactoryMethodRealWorld" */ = {
isa = XCConfigurationList;
buildConfigurations = (
919C8AE620DD893E006EE57D /* Debug */,
919C8AE720DD893E006EE57D /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
919C8AF220DD897E006EE57D /* Build configuration list for PBXNativeTarget "FactoryMethodConceptual" */ = {
isa = XCConfigurationList;
buildConfigurations = (
919C8AF320DD897E006EE57D /* Debug */,
919C8AF420DD897E006EE57D /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
919C8AFF20DD8A98006EE57D /* Build configuration list for PBXNativeTarget "PrototypeConceptual" */ = {
isa = XCConfigurationList;
buildConfigurations = (
919C8B0020DD8A98006EE57D /* Debug */,
919C8B0120DD8A98006EE57D /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
919C8B0C20DD8AF0006EE57D /* Build configuration list for PBXNativeTarget "PrototypeRealWorld" */ = {
isa = XCConfigurationList;
buildConfigurations = (
919C8B0D20DD8AF0006EE57D /* Debug */,
919C8B0E20DD8AF0006EE57D /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
919C8B1920DD8B59006EE57D /* Build configuration list for PBXNativeTarget "SingletonConceptual" */ = {
isa = XCConfigurationList;
buildConfigurations = (
919C8B1A20DD8B59006EE57D /* Debug */,
919C8B1B20DD8B59006EE57D /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
919C8B2620DD8BA9006EE57D /* Build configuration list for PBXNativeTarget "SingletonRealWorld" */ = {
isa = XCConfigurationList;
buildConfigurations = (
919C8B2720DD8BA9006EE57D /* Debug */,
919C8B2820DD8BA9006EE57D /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
91B1207020F610E400730C37 /* Build configuration list for PBXNativeTarget "ChainOfResponsibilityConceptual" */ = {
isa = XCConfigurationList;
buildConfigurations = (
91B1207120F610E400730C37 /* Debug */,
91B1207220F610E400730C37 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
91B1207C20F6114A00730C37 /* Build configuration list for PBXNativeTarget "ChainOfResponsibilityRealWorld" */ = {
isa = XCConfigurationList;
buildConfigurations = (
91B1207D20F6114A00730C37 /* Debug */,
91B1207E20F6114A00730C37 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
91B1208820F611DA00730C37 /* Build configuration list for PBXNativeTarget "CommandConceptual" */ = {
isa = XCConfigurationList;
buildConfigurations = (
91B1208920F611DA00730C37 /* Debug */,
91B1208A20F611DA00730C37 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
91B1209520F6120C00730C37 /* Build configuration list for PBXNativeTarget "CommandRealWorld" */ = {
isa = XCConfigurationList;
buildConfigurations = (
91B1209620F6120C00730C37 /* Debug */,
91B1209720F6120C00730C37 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
91B120A220F6125500730C37 /* Build configuration list for PBXNativeTarget "IteratorConceptual" */ = {
isa = XCConfigurationList;
buildConfigurations = (
91B120A320F6125500730C37 /* Debug */,
91B120A420F6125500730C37 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
91B120AE20F6127400730C37 /* Build configuration list for PBXNativeTarget "IteratorRealWorld" */ = {
isa = XCConfigurationList;
buildConfigurations = (
91B120AF20F6127400730C37 /* Debug */,
91B120B020F6127400730C37 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
91B120BB20F6130A00730C37 /* Build configuration list for PBXNativeTarget "ProxyConceptual" */ = {
isa = XCConfigurationList;
buildConfigurations = (
91B120BC20F6130A00730C37 /* Debug */,
91B120BD20F6130A00730C37 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
91B120C720F6132E00730C37 /* Build configuration list for PBXNativeTarget "ProxyRealWorld" */ = {
isa = XCConfigurationList;
buildConfigurations = (
91B120C820F6132E00730C37 /* Debug */,
91B120C920F6132E00730C37 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = 9139FA702088D85C00229150 /* Project object */;
}
================================================
FILE: RefactoringGuru.Patterns.xcodeproj/project.xcworkspace/contents.xcworkspacedata
================================================
================================================
FILE: RefactoringGuru.Patterns.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
================================================
IDEDidComputeMac32BitWarning
================================================
FILE: RefactoringGuru.Patterns.xcodeproj/xcshareddata/xcschemes/AbstractFactoryConceptual.xcscheme
================================================
================================================
FILE: RefactoringGuru.Patterns.xcodeproj/xcshareddata/xcschemes/AbstractFactoryRealWorld.xcscheme
================================================
================================================
FILE: RefactoringGuru.Patterns.xcodeproj/xcshareddata/xcschemes/AdapterConceptual.xcscheme
================================================
================================================
FILE: RefactoringGuru.Patterns.xcodeproj/xcshareddata/xcschemes/AdapterRealWorld.xcscheme
================================================
================================================
FILE: RefactoringGuru.Patterns.xcodeproj/xcshareddata/xcschemes/BridgeConceptual.xcscheme
================================================
================================================
FILE: RefactoringGuru.Patterns.xcodeproj/xcshareddata/xcschemes/BridgeRealWorld.xcscheme
================================================
================================================
FILE: RefactoringGuru.Patterns.xcodeproj/xcshareddata/xcschemes/BuilderConceptual.xcscheme
================================================
================================================
FILE: RefactoringGuru.Patterns.xcodeproj/xcshareddata/xcschemes/BuilderRealWorld.xcscheme
================================================
================================================
FILE: RefactoringGuru.Patterns.xcodeproj/xcshareddata/xcschemes/ChainOfResponsibilityConceptual.xcscheme
================================================
================================================
FILE: RefactoringGuru.Patterns.xcodeproj/xcshareddata/xcschemes/ChainOfResponsibilityRealWorld.xcscheme
================================================
================================================
FILE: RefactoringGuru.Patterns.xcodeproj/xcshareddata/xcschemes/CommandConceptual.xcscheme
================================================
================================================
FILE: RefactoringGuru.Patterns.xcodeproj/xcshareddata/xcschemes/CommandRealWorld.xcscheme
================================================
================================================
FILE: RefactoringGuru.Patterns.xcodeproj/xcshareddata/xcschemes/CompositeConceptual.xcscheme
================================================
================================================
FILE: RefactoringGuru.Patterns.xcodeproj/xcshareddata/xcschemes/CompositeRealWorld.xcscheme
================================================
================================================
FILE: RefactoringGuru.Patterns.xcodeproj/xcshareddata/xcschemes/DecoratorConceptual.xcscheme
================================================
================================================
FILE: RefactoringGuru.Patterns.xcodeproj/xcshareddata/xcschemes/DecoratorRealWorld.xcscheme
================================================
================================================
FILE: RefactoringGuru.Patterns.xcodeproj/xcshareddata/xcschemes/FacadeConceptual.xcscheme
================================================
================================================
FILE: RefactoringGuru.Patterns.xcodeproj/xcshareddata/xcschemes/FacadeRealWorld.xcscheme
================================================
================================================
FILE: RefactoringGuru.Patterns.xcodeproj/xcshareddata/xcschemes/FactoryMethodConceptual.xcscheme
================================================
================================================
FILE: RefactoringGuru.Patterns.xcodeproj/xcshareddata/xcschemes/FactoryMethodRealWorld.xcscheme
================================================
================================================
FILE: RefactoringGuru.Patterns.xcodeproj/xcshareddata/xcschemes/FlyweightConceptual.xcscheme
================================================
================================================
FILE: RefactoringGuru.Patterns.xcodeproj/xcshareddata/xcschemes/FlyweightRealWorld.xcscheme
================================================
================================================
FILE: RefactoringGuru.Patterns.xcodeproj/xcshareddata/xcschemes/IteratorConceptual.xcscheme
================================================
================================================
FILE: RefactoringGuru.Patterns.xcodeproj/xcshareddata/xcschemes/IteratorRealWorld.xcscheme
================================================
================================================
FILE: RefactoringGuru.Patterns.xcodeproj/xcshareddata/xcschemes/MediatorConceptual.xcscheme
================================================
================================================
FILE: RefactoringGuru.Patterns.xcodeproj/xcshareddata/xcschemes/MediatorRealWorld.xcscheme
================================================
================================================
FILE: RefactoringGuru.Patterns.xcodeproj/xcshareddata/xcschemes/MementoConceptual.xcscheme
================================================
================================================
FILE: RefactoringGuru.Patterns.xcodeproj/xcshareddata/xcschemes/MementoRealWorld.xcscheme
================================================
================================================
FILE: RefactoringGuru.Patterns.xcodeproj/xcshareddata/xcschemes/ObserverConceptual.xcscheme
================================================
================================================
FILE: RefactoringGuru.Patterns.xcodeproj/xcshareddata/xcschemes/ObserverRealWorld.xcscheme
================================================
================================================
FILE: RefactoringGuru.Patterns.xcodeproj/xcshareddata/xcschemes/PrototypeConceptual.xcscheme
================================================
================================================
FILE: RefactoringGuru.Patterns.xcodeproj/xcshareddata/xcschemes/PrototypeRealWorld.xcscheme
================================================
================================================
FILE: RefactoringGuru.Patterns.xcodeproj/xcshareddata/xcschemes/ProxyConceptual.xcscheme
================================================
================================================
FILE: RefactoringGuru.Patterns.xcodeproj/xcshareddata/xcschemes/ProxyRealWorld.xcscheme
================================================
================================================
FILE: RefactoringGuru.Patterns.xcodeproj/xcshareddata/xcschemes/SingletonConceptual.xcscheme
================================================
================================================
FILE: RefactoringGuru.Patterns.xcodeproj/xcshareddata/xcschemes/SingletonRealWorld.xcscheme
================================================
================================================
FILE: RefactoringGuru.Patterns.xcodeproj/xcshareddata/xcschemes/StateConceptual.xcscheme
================================================
================================================
FILE: RefactoringGuru.Patterns.xcodeproj/xcshareddata/xcschemes/StateRealWorld.xcscheme
================================================
================================================
FILE: RefactoringGuru.Patterns.xcodeproj/xcshareddata/xcschemes/StrategyConceptual.xcscheme
================================================
================================================
FILE: RefactoringGuru.Patterns.xcodeproj/xcshareddata/xcschemes/StrategyRealWorld.xcscheme
================================================
================================================
FILE: RefactoringGuru.Patterns.xcodeproj/xcshareddata/xcschemes/TemplateMethodConceptual.xcscheme
================================================
================================================
FILE: RefactoringGuru.Patterns.xcodeproj/xcshareddata/xcschemes/TemplateMethodRealWorld.xcscheme
================================================
================================================
FILE: RefactoringGuru.Patterns.xcodeproj/xcshareddata/xcschemes/VisitorConceptual.xcscheme
================================================
================================================
FILE: RefactoringGuru.Patterns.xcodeproj/xcshareddata/xcschemes/VisitorRealWorld.xcscheme
================================================
================================================
FILE: Sources/AbstractFactory/Conceptual/Example.swift
================================================
/// EN: Abstract Factory Design Pattern
///
/// Intent: Lets you produce families of related objects without specifying
/// their concrete classes.
///
/// RU: Паттерн Абстрактная Фабрика
///
/// Назначение: Предоставляет интерфейс для создания семейств связанных или
/// зависимых объектов без привязки к их конкретным классам.
import XCTest
/// EN: The Abstract Factory protocol declares a set of methods that return
/// different abstract products. These products are called a family and are
/// related by a high-level theme or concept. Products of one family are usually
/// able to collaborate among themselves. A family of products may have several
/// variants, but the products of one variant are incompatible with products
/// of another.
///
/// RU: Интерфейс Абстрактной Фабрики объявляет набор методов, которые
/// возвращают различные абстрактные продукты. Эти продукты называются
/// семейством и связаны темой или концепцией высокого уровня. Продукты одного
/// семейства обычно могут взаимодействовать между собой. Семейство продуктов
/// может иметь несколько вариаций, но продукты одной вариации несовместимы с
/// продуктами другой.
protocol AbstractFactory {
func createProductA() -> AbstractProductA
func createProductB() -> AbstractProductB
}
/// EN: Concrete Factories produce a family of products that belong to a single
/// variant. The factory guarantees that resulting products are compatible.
/// Note that signatures of the Concrete Factory's methods return an abstract
/// product, while inside the method a concrete product is instantiated.
///
/// RU: Конкретная Фабрика производит семейство продуктов одной вариации.
/// Фабрика гарантирует совместимость полученных продуктов. Обратите внимание,
/// что сигнатуры методов Конкретной Фабрики возвращают абстрактный продукт, в
/// то время как внутри метода создается экземпляр конкретного продукта.
class ConcreteFactory1: AbstractFactory {
func createProductA() -> AbstractProductA {
return ConcreteProductA1()
}
func createProductB() -> AbstractProductB {
return ConcreteProductB1()
}
}
/// EN: Each Concrete Factory has a corresponding product variant.
///
/// RU: Каждая Конкретная Фабрика имеет соответствующую вариацию продукта.
class ConcreteFactory2: AbstractFactory {
func createProductA() -> AbstractProductA {
return ConcreteProductA2()
}
func createProductB() -> AbstractProductB {
return ConcreteProductB2()
}
}
/// EN: Each distinct product of a product family should have a base protocol.
/// All variants of the product must implement this protocol.
///
/// RU: Каждый отдельный продукт семейства продуктов должен иметь базовый
/// интерфейс. Все вариации продукта должны реализовывать этот интерфейс.
protocol AbstractProductA {
func usefulFunctionA() -> String
}
/// EN: Concrete Products are created by corresponding Concrete Factories.
///
/// RU: Конкретные продукты создаются соответствующими Конкретными Фабриками.
class ConcreteProductA1: AbstractProductA {
func usefulFunctionA() -> String {
return "The result of the product A1."
}
}
class ConcreteProductA2: AbstractProductA {
func usefulFunctionA() -> String {
return "The result of the product A2."
}
}
/// EN: The base protocol of another product. All products can interact with
/// each other, but proper interaction is possible only between products of the
/// same concrete variant.
///
/// RU: Базовый интерфейс другого продукта. Все продукты могут взаимодействовать
/// друг с другом, но правильное взаимодействие возможно только между продуктами
/// одной и той же конкретной вариации.
protocol AbstractProductB {
/// EN: Product B is able to do its own thing...
///
/// RU: Продукт B способен работать самостоятельно...
func usefulFunctionB() -> String
/// EN: ...but it also can collaborate with the ProductA.
///
/// The Abstract Factory makes sure that all products it creates are of the
/// same variant and thus, compatible.
///
/// RU: ...а также взаимодействовать с Продуктами A той же вариации.
///
/// Абстрактная Фабрика гарантирует, что все продукты, которые она создает,
/// имеют одинаковую вариацию и, следовательно, совместимы.
func anotherUsefulFunctionB(collaborator: AbstractProductA) -> String
}
/// EN: Concrete Products are created by corresponding Concrete Factories.
///
/// RU: Конкретные Продукты создаются соответствующими Конкретными Фабриками.
class ConcreteProductB1: AbstractProductB {
func usefulFunctionB() -> String {
return "The result of the product B1."
}
/// EN: This variant, Product B1, is only able to work correctly with the
/// variant, Product A1. Nevertheless, it accepts any instance of
/// AbstractProductA as an argument.
///
/// RU: Продукт B1 может корректно работать только с Продуктом A1. Тем не
/// менее, он принимает любой экземпляр Абстрактного Продукта А в качестве
/// аргумента.
func anotherUsefulFunctionB(collaborator: AbstractProductA) -> String {
let result = collaborator.usefulFunctionA()
return "The result of the B1 collaborating with the (\(result))"
}
}
class ConcreteProductB2: AbstractProductB {
func usefulFunctionB() -> String {
return "The result of the product B2."
}
/// EN: This variant, Product B2, is only able to work correctly with the
/// variant, Product A2. Nevertheless, it accepts any instance of
/// AbstractProductA as an argument.
///
/// RU: Продукт B2 может корректно работать только с Продуктом A2. Тем не
/// менее, он принимает любой экземпляр Абстрактного Продукта А в качестве
/// аргумента.
func anotherUsefulFunctionB(collaborator: AbstractProductA) -> String {
let result = collaborator.usefulFunctionA()
return "The result of the B2 collaborating with the (\(result))"
}
}
/// EN: The client code works with factories and products only through abstract
/// types: AbstractFactory and AbstractProduct. This lets you pass any factory
/// or product subclass to the client code without breaking it.
///
/// RU: Клиентский код работает с фабриками и продуктами только через
/// абстрактные типы: Абстрактная Фабрика и Абстрактный Продукт. Это позволяет
/// передавать любой подкласс фабрики или продукта клиентскому коду, не нарушая
/// его.
class Client {
// ...
static func someClientCode(factory: AbstractFactory) {
let productA = factory.createProductA()
let productB = factory.createProductB()
print(productB.usefulFunctionB())
print(productB.anotherUsefulFunctionB(collaborator: productA))
}
// ...
}
/// EN: Let's see how it all works together.
///
/// RU: Давайте посмотрим как всё это будет работать.
class AbstractFactoryConceptual: XCTestCase {
func testAbstractFactoryConceptual() {
/// EN: The client code can work with any concrete factory class.
///
/// RU: Клиентский код может работать с любым конкретным классом
/// фабрики.
print("Client: Testing client code with the first factory type:")
Client.someClientCode(factory: ConcreteFactory1())
print("Client: Testing the same client code with the second factory type:")
Client.someClientCode(factory: ConcreteFactory2())
}
}
================================================
FILE: Sources/AbstractFactory/Conceptual/Info.plist
================================================
CFBundleDevelopmentRegion
$(DEVELOPMENT_LANGUAGE)
CFBundleExecutable
$(EXECUTABLE_NAME)
CFBundleIdentifier
$(PRODUCT_BUNDLE_IDENTIFIER)
CFBundleInfoDictionaryVersion
6.0
CFBundleName
$(PRODUCT_NAME)
CFBundlePackageType
BNDL
CFBundleShortVersionString
1.0
CFBundleVersion
1
================================================
FILE: Sources/AbstractFactory/Conceptual/Output.txt
================================================
Client: Testing client code with the first factory type:
The result of the product B1.
The result of the B1 collaborating with the (The result of the product A1.)
Client: Testing the same client code with the second factory type:
The result of the product B2.
The result of the B2 collaborating with the (The result of the product A2.)
================================================
FILE: Sources/AbstractFactory/RealWorld/Example.swift
================================================
import Foundation
import UIKit
import XCTest
enum AuthType {
case login
case signUp
}
protocol AuthViewFactory {
static func authView(for type: AuthType) -> AuthView
static func authController(for type: AuthType) -> AuthViewController
}
class StudentAuthViewFactory: AuthViewFactory {
static func authView(for type: AuthType) -> AuthView {
print("Student View has been created")
switch type {
case .login: return StudentLoginView()
case .signUp: return StudentSignUpView()
}
}
static func authController(for type: AuthType) -> AuthViewController {
let controller = StudentAuthViewController(contentView: authView(for: type))
print("Student View Controller has been created")
return controller
}
}
class TeacherAuthViewFactory: AuthViewFactory {
static func authView(for type: AuthType) -> AuthView {
print("Teacher View has been created")
switch type {
case .login: return TeacherLoginView()
case .signUp: return TeacherSignUpView()
}
}
static func authController(for type: AuthType) -> AuthViewController {
let controller = TeacherAuthViewController(contentView: authView(for: type))
print("Teacher View Controller has been created")
return controller
}
}
protocol AuthView {
typealias AuthAction = (AuthType) -> ()
var contentView: UIView { get }
var authHandler: AuthAction? { get set }
var description: String { get }
}
class StudentSignUpView: UIView, AuthView {
private class StudentSignUpContentView: UIView {
/// This view contains a number of features available only during a
/// STUDENT authorization.
}
var contentView: UIView = StudentSignUpContentView()
/// The handler will be connected for actions of buttons of this view.
var authHandler: AuthView.AuthAction?
override var description: String {
return "Student-SignUp-View"
}
}
class StudentLoginView: UIView, AuthView {
private let emailField = UITextField()
private let passwordField = UITextField()
private let signUpButton = UIButton()
var contentView: UIView {
return self
}
/// The handler will be connected for actions of buttons of this view.
var authHandler: AuthView.AuthAction?
override var description: String {
return "Student-Login-View"
}
}
class TeacherSignUpView: UIView, AuthView {
class TeacherSignUpContentView: UIView {
/// This view contains a number of features available only during a
/// TEACHER authorization.
}
var contentView: UIView = TeacherSignUpContentView()
/// The handler will be connected for actions of buttons of this view.
var authHandler: AuthView.AuthAction?
override var description: String {
return "Teacher-SignUp-View"
}
}
class TeacherLoginView: UIView, AuthView {
private let emailField = UITextField()
private let passwordField = UITextField()
private let loginButton = UIButton()
private let forgotPasswordButton = UIButton()
var contentView: UIView {
return self
}
/// The handler will be connected for actions of buttons of this view.
var authHandler: AuthView.AuthAction?
override var description: String {
return "Teacher-Login-View"
}
}
class AuthViewController: UIViewController {
fileprivate var contentView: AuthView
init(contentView: AuthView) {
self.contentView = contentView
super.init(nibName: nil, bundle: nil)
}
required convenience init?(coder aDecoder: NSCoder) {
return nil
}
}
class StudentAuthViewController: AuthViewController {
/// Student-oriented features
}
class TeacherAuthViewController: AuthViewController {
/// Teacher-oriented features
}
private class ClientCode {
private var currentController: AuthViewController?
private lazy var navigationController: UINavigationController = {
guard let vc = currentController else { return UINavigationController() }
return UINavigationController(rootViewController: vc)
}()
private let factoryType: AuthViewFactory.Type
init(factoryType: AuthViewFactory.Type) {
self.factoryType = factoryType
}
/// MARK: - Presentation
func presentLogin() {
let controller = factoryType.authController(for: .login)
navigationController.pushViewController(controller, animated: true)
}
func presentSignUp() {
let controller = factoryType.authController(for: .signUp)
navigationController.pushViewController(controller, animated: true)
}
/// Other methods...
}
class AbstractFactoryRealWorld: XCTestCase {
func testFactoryMethodRealWorld() {
#if teacherMode
let clientCode = ClientCode(factoryType: TeacherAuthViewFactory.self)
#else
let clientCode = ClientCode(factoryType: StudentAuthViewFactory.self)
#endif
/// Present LogIn flow
clientCode.presentLogin()
print("Login screen has been presented")
/// Present SignUp flow
clientCode.presentSignUp()
print("Sign up screen has been presented")
}
}
================================================
FILE: Sources/AbstractFactory/RealWorld/Info.plist
================================================
CFBundleDevelopmentRegion
$(DEVELOPMENT_LANGUAGE)
CFBundleExecutable
$(EXECUTABLE_NAME)
CFBundleIdentifier
$(PRODUCT_BUNDLE_IDENTIFIER)
CFBundleInfoDictionaryVersion
6.0
CFBundleName
$(PRODUCT_NAME)
CFBundlePackageType
BNDL
CFBundleShortVersionString
1.0
CFBundleVersion
1
================================================
FILE: Sources/AbstractFactory/RealWorld/Output.txt
================================================
Teacher View has been created
Teacher View Controller has been created
Login screen has been presented
Teacher View has been created
Teacher View Controller has been created
Sign up screen has been presented
================================================
FILE: Sources/Adapter/Conceptual/Example.swift
================================================
/// EN: Adapter Design Pattern
///
/// Intent: Provides a unified interface that allows objects with incompatible
/// interfaces to collaborate.
///
/// RU: Паттерн Адаптер
///
/// Назначение: Позволяет объектам с несовместимыми интерфейсами работать
/// вместе.
import XCTest
/// EN: The Target defines the domain-specific interface used by the client
/// code.
///
/// RU: Целевой класс объявляет интерфейс, с которым может работать клиентский
/// код.
class Target {
func request() -> String {
return "Target: The default target's behavior."
}
}
/// EN: The Adaptee contains some useful behavior, but its interface is
/// incompatible with the existing client code. The Adaptee needs some
/// adaptation before the client code can use it.
///
/// RU: Адаптируемый класс содержит некоторое полезное поведение, но его
/// интерфейс несовместим с существующим клиентским кодом. Адаптируемый класс
/// нуждается в некоторой доработке, прежде чем клиентский код сможет его
/// использовать.
class Adaptee {
public func specificRequest() -> String {
return ".eetpadA eht fo roivaheb laicepS"
}
}
/// EN: The Adapter makes the Adaptee's interface compatible with the Target's
/// interface.
///
/// RU: Адаптер делает интерфейс Адаптируемого класса совместимым с целевым
/// интерфейсом.
class Adapter: Target {
private var adaptee: Adaptee
init(_ adaptee: Adaptee) {
self.adaptee = adaptee
}
override func request() -> String {
return "Adapter: (TRANSLATED) " + adaptee.specificRequest().reversed()
}
}
/// EN: The client code supports all classes that follow the Target interface.
///
/// RU: Клиентский код поддерживает все классы, использующие целевой интерфейс.
class Client {
// ...
static func someClientCode(target: Target) {
print(target.request())
}
// ...
}
/// EN: Let's see how it all works together.
///
/// RU: Давайте посмотрим как всё это будет работать.
class AdapterConceptual: XCTestCase {
func testAdapterConceptual() {
print("Client: I can work just fine with the Target objects:")
Client.someClientCode(target: Target())
let adaptee = Adaptee()
print("Client: The Adaptee class has a weird interface. See, I don't understand it:")
print("Adaptee: " + adaptee.specificRequest())
print("Client: But I can work with it via the Adapter:")
Client.someClientCode(target: Adapter(adaptee))
}
}
================================================
FILE: Sources/Adapter/Conceptual/Info.plist
================================================
CFBundleDevelopmentRegion
$(DEVELOPMENT_LANGUAGE)
CFBundleExecutable
$(EXECUTABLE_NAME)
CFBundleIdentifier
$(PRODUCT_BUNDLE_IDENTIFIER)
CFBundleInfoDictionaryVersion
6.0
CFBundleName
$(PRODUCT_NAME)
CFBundlePackageType
BNDL
CFBundleShortVersionString
1.0
CFBundleVersion
1
================================================
FILE: Sources/Adapter/Conceptual/Output.txt
================================================
Client: I can work just fine with the Target objects:
Target: The default target's behavior.
Client: The Adaptee class has a weird interface. See, I don't understand it:
Adaptee: .eetpadA eht fo roivaheb laicepS
Client: But I can work with it via the Adapter:
Adapter: (TRANSLATED) Special behavior of the Adaptee.
================================================
FILE: Sources/Adapter/RealWorld/Example.swift
================================================
import XCTest
import UIKit
/// Adapter Design Pattern
///
/// Intent: Convert the interface of a class into the interface clients expect.
/// Adapter lets classes work together that couldn't work otherwise because of
/// incompatible interfaces.
class AdapterRealWorld: XCTestCase {
/// Example. Let's assume that our app perfectly works with Facebook
/// authorization. However, users ask you to add sign in via Twitter.
///
/// Unfortunately, Twitter SDK has a different authorization method.
///
/// Firstly, you have to create the new protocol 'AuthService' and insert
/// the authorization method of Facebook SDK.
///
/// Secondly, write an extension for Twitter SDK and implement methods of
/// AuthService protocol, just a simple redirect.
///
/// Thirdly, write an extension for Facebook SDK. You should not write any
/// code at this point as methods already implemented by Facebook SDK.
///
/// It just tells a compiler that both SDKs have the same interface.
func testAdapterRealWorld() {
print("Starting an authorization via Facebook")
startAuthorization(with: FacebookAuthSDK())
print("Starting an authorization via Twitter.")
startAuthorization(with: TwitterAuthSDK())
}
func startAuthorization(with service: AuthService) {
/// The current top view controller of the app
let topViewController = UIViewController()
service.presentAuthFlow(from: topViewController)
}
}
protocol AuthService {
func presentAuthFlow(from viewController: UIViewController)
}
class FacebookAuthSDK {
func presentAuthFlow(from viewController: UIViewController) {
/// Call SDK methods and pass a view controller
print("Facebook WebView has been shown.")
}
}
class TwitterAuthSDK {
func startAuthorization(with viewController: UIViewController) {
/// Call SDK methods and pass a view controller
print("Twitter WebView has been shown. Users will be happy :)")
}
}
extension TwitterAuthSDK: AuthService {
/// This is an adapter
///
/// Yeah, we are able to not create another class and just extend an
/// existing one
func presentAuthFlow(from viewController: UIViewController) {
print("The Adapter is called! Redirecting to the original method...")
self.startAuthorization(with: viewController)
}
}
extension FacebookAuthSDK: AuthService {
/// This extension just tells a compiler that both SDKs have the same
/// interface.
}
================================================
FILE: Sources/Adapter/RealWorld/Info.plist
================================================
CFBundleDevelopmentRegion
$(DEVELOPMENT_LANGUAGE)
CFBundleExecutable
$(EXECUTABLE_NAME)
CFBundleIdentifier
$(PRODUCT_BUNDLE_IDENTIFIER)
CFBundleInfoDictionaryVersion
6.0
CFBundleName
$(PRODUCT_NAME)
CFBundlePackageType
BNDL
CFBundleShortVersionString
1.0
CFBundleVersion
1
================================================
FILE: Sources/Adapter/RealWorld/Output.txt
================================================
Starting an authorization via Facebook
Facebook WebView has been shown
///
Starting an authorization via Twitter
The Adapter is called! Redirecting to the original method...
Twitter WebView has been shown. Users will be happy :)
================================================
FILE: Sources/Bridge/Conceptual/Example.swift
================================================
/// EN: Bridge Design Pattern
///
/// Intent: Lets you split a large class or a set of closely related classes
/// into two separate hierarchies—abstraction and implementation—which can be
/// developed independently of each other.
///
/// A
/// / \ A N
/// Aa Ab ===> / \ / \
/// / \ / \ Aa(N) Ab(N) 1 2
/// Aa1 Aa2 Ab1 Ab2
///
/// RU: Паттерн Мост
///
/// Назначение: Разделяет один или несколько классов на две отдельные иерархии —
/// абстракцию и реализацию, позволяя изменять их независимо друг от друга.
///
/// A
/// / \ A N
/// Aa Ab ===> / \ / \
/// / \ / \ Aa(N) Ab(N) 1 2
/// Aa1 Aa2 Ab1 Ab2
import XCTest
/// EN: The Abstraction defines the interface for the "control" part of the two
/// class hierarchies. It holds a reference to an object from the
/// Implementation hierarchy and delegates all of the real work to this object.
///
/// RU: Абстракция устанавливает интерфейс для «управляющей» части двух иерархий
/// классов. Она содержит ссылку на объект из иерархии Реализации и делегирует
/// ему всю настоящую работу.
class Abstraction {
fileprivate var implementation: Implementation
init(_ implementation: Implementation) {
self.implementation = implementation
}
func operation() -> String {
let operation = implementation.operationImplementation()
return "Abstraction: Base operation with:\n" + operation
}
}
/// EN: You can extend the Abstraction without changing the Implementation
/// classes.
///
/// RU: Можно расширить Абстракцию без изменения классов Реализации.
class ExtendedAbstraction: Abstraction {
override func operation() -> String {
let operation = implementation.operationImplementation()
return "ExtendedAbstraction: Extended operation with:\n" + operation
}
}
/// EN: The Implementation defines the interface for all implementation classes.
/// It doesn't have to match the Abstraction's interface. In fact, the two
/// interfaces can be entirely different. Typically the Implementation interface
/// provides only primitive operations, while the Abstraction defines higher-
/// level operations based on those primitives.
///
/// RU: Реализация устанавливает интерфейс для всех классов реализации. Он не
/// должен соответствовать интерфейсу Абстракции. На практике оба интерфейса
/// могут быть совершенно разными. Как правило, интерфейс Реализации
/// предоставляет только примитивные операции, в то время как Абстракция
/// определяет операции более высокого уровня, основанные на этих примитивах.
protocol Implementation {
func operationImplementation() -> String
}
/// EN: Each Concrete Implementation corresponds to a specific platform and
/// implements the Implementation interface using that platform's API.
///
/// RU: Каждая Конкретная Реализация соответствует определённой платформе и
/// реализует интерфейс Реализации с использованием API этой платформы.
class ConcreteImplementationA: Implementation {
func operationImplementation() -> String {
return "ConcreteImplementationA: Here's the result on the platform A.\n"
}
}
class ConcreteImplementationB: Implementation {
func operationImplementation() -> String {
return "ConcreteImplementationB: Here's the result on the platform B\n"
}
}
/// EN: Except for the initialization phase, where an Abstraction object gets
/// linked with a specific Implementation object, the client code should only
/// depend on the Abstraction class. This way the client code can support any
/// abstraction-implementation combination.
///
/// RU: За исключением этапа инициализации, когда объект Абстракции связывается
/// с определённым объектом Реализации, клиентский код должен зависеть только от
/// класса Абстракции. Таким образом, клиентский код может поддерживать любую
/// комбинацию абстракции и реализации.
class Client {
// ...
static func someClientCode(abstraction: Abstraction) {
print(abstraction.operation())
}
// ...
}
/// EN: Let's see how it all works together.
///
/// RU: Давайте посмотрим как всё это будет работать.
class BridgeConceptual: XCTestCase {
func testBridgeConceptual() {
// EN: The client code should be able to work with any pre-configured
// abstraction-implementation combination.
//
// RU: Клиентский код должен работать с любой предварительно
// сконфигурированной комбинацией абстракции и реализации.
let implementation = ConcreteImplementationA()
Client.someClientCode(abstraction: Abstraction(implementation))
let concreteImplementation = ConcreteImplementationB()
Client.someClientCode(abstraction: ExtendedAbstraction(concreteImplementation))
}
}
================================================
FILE: Sources/Bridge/Conceptual/Info.plist
================================================
CFBundleDevelopmentRegion
$(DEVELOPMENT_LANGUAGE)
CFBundleExecutable
$(EXECUTABLE_NAME)
CFBundleIdentifier
$(PRODUCT_BUNDLE_IDENTIFIER)
CFBundleInfoDictionaryVersion
6.0
CFBundleName
$(PRODUCT_NAME)
CFBundlePackageType
BNDL
CFBundleShortVersionString
1.0
CFBundleVersion
1
================================================
FILE: Sources/Bridge/Conceptual/Output.txt
================================================
Abstraction: Base operation with:
ConcreteImplementationA: Here's the result on the platform A
ExtendedAbstraction: Extended operation with:
ConcreteImplementationB: Here's the result on the platform B
================================================
FILE: Sources/Bridge/RealWorld/Example.swift
================================================
import XCTest
private class BridgeRealWorld: XCTestCase {
func testBridgeRealWorld() {
print("Client: Pushing Photo View Controller...")
push(PhotoViewController())
print()
print("Client: Pushing Feed View Controller...")
push(FeedViewController())
}
func push(_ container: SharingSupportable) {
let instagram = InstagramSharingService()
let facebook = FaceBookSharingService()
container.accept(service: instagram)
container.update(content: foodModel)
container.accept(service: facebook)
container.update(content: foodModel)
}
var foodModel: Content {
return FoodDomainModel(title: "This food is so various and delicious!",
images: [UIImage(), UIImage()],
calories: 47)
}
}
private protocol SharingSupportable {
/// Abstraction
func accept(service: SharingService)
func update(content: Content)
}
class BaseViewController: UIViewController, SharingSupportable {
fileprivate var shareService: SharingService?
func update(content: Content) {
/// ...updating UI and showing a content...
/// ...
/// ... then, a user will choose a content and trigger an event
print("\(description): User selected a \(content) to share")
/// ...
shareService?.share(content: content)
}
func accept(service: SharingService) {
shareService = service
}
}
class PhotoViewController: BaseViewController {
/// Custom UI and features
override var description: String {
return "PhotoViewController"
}
}
class FeedViewController: BaseViewController {
/// Custom UI and features
override var description: String {
return "FeedViewController"
}
}
protocol SharingService {
/// Implementation
func share(content: Content)
}
class FaceBookSharingService: SharingService {
func share(content: Content) {
/// Use FaceBook API to share a content
print("Service: \(content) was posted to the Facebook")
}
}
class InstagramSharingService: SharingService {
func share(content: Content) {
/// Use Instagram API to share a content
print("Service: \(content) was posted to the Instagram", terminator: "\n\n")
}
}
protocol Content: CustomStringConvertible {
var title: String { get }
var images: [UIImage] { get }
}
struct FoodDomainModel: Content {
var title: String
var images: [UIImage]
var calories: Int
var description: String {
return "Food Model"
}
}
================================================
FILE: Sources/Bridge/RealWorld/Info.plist
================================================
CFBundleDevelopmentRegion
$(DEVELOPMENT_LANGUAGE)
CFBundleExecutable
$(EXECUTABLE_NAME)
CFBundleIdentifier
$(PRODUCT_BUNDLE_IDENTIFIER)
CFBundleInfoDictionaryVersion
6.0
CFBundleName
$(PRODUCT_NAME)
CFBundlePackageType
BNDL
CFBundleShortVersionString
1.0
CFBundleVersion
1
================================================
FILE: Sources/Bridge/RealWorld/Output.txt
================================================
Client: Pushing Photo View Controller...
PhotoViewController: User selected a Food Model to share
Service: Food Model was posted to the Instagram
PhotoViewController: User selected a Food Model to share
Service: Food Model was posted to the Facebook
Client: Pushing Feed View Controller...
FeedViewController: User selected a Food Model to share
Service: Food Model was posted to the Instagram
FeedViewController: User selected a Food Model to share
Service: Food Model was posted to the Facebook
================================================
FILE: Sources/Builder/Conceptual/Example.swift
================================================
/// EN: Builder Design Pattern
///
/// Intent: Lets you construct complex objects step by step. The pattern allows
/// you to produce different types and representations of an object using the
/// same construction code.
///
/// RU: Паттерн Строитель
///
/// Назначение: Позволяет создавать сложные объекты пошагово. Строитель даёт
/// возможность использовать один и тот же код строительства для получения
/// разных представлений объектов.
import XCTest
/// EN: The Builder interface specifies methods for creating the different parts
/// of the Product objects.
///
/// RU: Интерфейс Строителя объявляет создающие методы для различных частей
/// объектов Продуктов.
protocol Builder {
func producePartA()
func producePartB()
func producePartC()
}
/// EN: The Concrete Builder classes follow the Builder interface and provide
/// specific implementations of the building steps. Your program may have
/// several variations of Builders, implemented differently.
///
/// RU: Классы Конкретного Строителя следуют интерфейсу Строителя и
/// предоставляют конкретные реализации шагов построения. Ваша программа может
/// иметь несколько вариантов Строителей, реализованных по-разному.
class ConcreteBuilder1: Builder {
/// EN: A fresh builder instance should contain a blank product object,
/// which is used in further assembly.
///
/// RU: Новый экземпляр строителя должен содержать пустой объект продукта,
/// который используется в дальнейшей сборке.
private var product = Product1()
func reset() {
product = Product1()
}
/// EN: All production steps work with the same product instance.
///
/// RU: Все этапы производства работают с одним и тем же экземпляром
/// продукта.
func producePartA() {
product.add(part: "PartA1")
}
func producePartB() {
product.add(part: "PartB1")
}
func producePartC() {
product.add(part: "PartC1")
}
/// EN: Concrete Builders are supposed to provide their own methods for
/// retrieving results. That's because various types of builders may create
/// entirely different products that don't follow the same interface.
/// Therefore, such methods cannot be declared in the base Builder interface
/// (at least in a statically typed programming language).
///
/// Usually, after returning the end result to the client, a builder
/// instance is expected to be ready to start producing another product.
/// That's why it's a usual practice to call the reset method at the end of
/// the `getProduct` method body. However, this behavior is not mandatory,
/// and you can make your builders wait for an explicit reset call from the
/// client code before disposing of the previous result.
///
/// RU: Конкретные Строители должны предоставить свои собственные методы
/// получения результатов. Это связано с тем, что различные типы строителей
/// могут создавать совершенно разные продукты с разными интерфейсами.
/// Поэтому такие методы не могут быть объявлены в базовом интерфейсе
/// Строителя (по крайней мере, в статически типизированном языке
/// программирования).
///
/// Как правило, после возвращения конечного результата клиенту, экземпляр
/// строителя должен быть готов к началу производства следующего продукта.
/// Поэтому обычной практикой является вызов метода сброса в конце тела
/// метода getProduct. Однако такое поведение не является обязательным, вы
/// можете заставить своих строителей ждать явного запроса на сброс из кода
/// клиента, прежде чем избавиться от предыдущего результата.
func retrieveProduct() -> Product1 {
let result = self.product
reset()
return result
}
}
/// EN: The Director is only responsible for executing the building steps in a
/// particular sequence. It is helpful when producing products according to a
/// specific order or configuration. Strictly speaking, the Director class is
/// optional, since the client can control builders directly.
///
/// RU: Директор отвечает только за выполнение шагов построения в определённой
/// последовательности. Это полезно при производстве продуктов в определённом
/// порядке или особой конфигурации. Строго говоря, класс Директор необязателен,
/// так как клиент может напрямую управлять строителями.
class Director {
private var builder: Builder?
/// EN: The Director works with any builder instance that the client code
/// passes to it. This way, the client code may alter the final type of the
/// newly assembled product.
///
/// RU: Директор работает с любым экземпляром строителя, который передаётся
/// ему клиентским кодом. Таким образом, клиентский код может изменить
/// конечный тип вновь собираемого продукта.
func update(builder: Builder) {
self.builder = builder
}
/// EN: The Director can construct several product variations using the same
/// building steps.
///
/// RU: Директор может строить несколько вариаций продукта, используя
/// одинаковые шаги построения.
func buildMinimalViableProduct() {
builder?.producePartA()
}
func buildFullFeaturedProduct() {
builder?.producePartA()
builder?.producePartB()
builder?.producePartC()
}
}
/// EN: It makes sense to use the Builder pattern only when your products are
/// quite complex and require extensive configuration.
///
/// Unlike in other creational patterns, different concrete builders can produce
/// unrelated products. In other words, results of various builders may not
/// always follow the same interface.
///
/// RU: Имеет смысл использовать паттерн Строитель только тогда, когда ваши
/// продукты достаточно сложны и требуют обширной конфигурации.
///
/// В отличие от других порождающих паттернов, различные конкретные строители
/// могут производить несвязанные продукты. Другими словами, результаты
/// различных строителей могут не всегда следовать одному и тому же интерфейсу.
class Product1 {
private var parts = [String]()
func add(part: String) {
self.parts.append(part)
}
func listParts() -> String {
return "Product parts: " + parts.joined(separator: ", ") + "\n"
}
}
/// EN: The client code creates a builder object, passes it to the director and
/// then initiates the construction process. The end result is retrieved from
/// the builder object.
///
/// RU: Клиентский код создаёт объект-строитель, передаёт его директору, а затем
/// инициирует процесс построения. Конечный результат извлекается из
/// объекта-строителя.
class Client {
// ...
static func someClientCode(director: Director) {
let builder = ConcreteBuilder1()
director.update(builder: builder)
print("Standard basic product:")
director.buildMinimalViableProduct()
print(builder.retrieveProduct().listParts())
print("Standard full featured product:")
director.buildFullFeaturedProduct()
print(builder.retrieveProduct().listParts())
// EN: Remember, the Builder pattern can be used without a Director
// class.
//
// RU: Помните, что паттерн Строитель можно использовать без класса
// Директор.
print("Custom product:")
builder.producePartA()
builder.producePartC()
print(builder.retrieveProduct().listParts())
}
// ...
}
/// EN: Let's see how it all comes together.
///
/// RU: Давайте посмотрим как всё это будет работать.
class BuilderConceptual: XCTestCase {
func testBuilderConceptual() {
let director = Director()
Client.someClientCode(director: director)
}
}
================================================
FILE: Sources/Builder/Conceptual/Info.plist
================================================
CFBundleDevelopmentRegion
$(DEVELOPMENT_LANGUAGE)
CFBundleExecutable
$(EXECUTABLE_NAME)
CFBundleIdentifier
$(PRODUCT_BUNDLE_IDENTIFIER)
CFBundleInfoDictionaryVersion
6.0
CFBundleName
$(PRODUCT_NAME)
CFBundlePackageType
BNDL
CFBundleShortVersionString
1.0
CFBundleVersion
1
================================================
FILE: Sources/Builder/Conceptual/Output.txt
================================================
Standard basic product:
Product parts: PartA1
Standard full featured product:
Product parts: PartA1, PartB1, PartC1
Custom product:
Product parts: PartA1, PartC1
================================================
FILE: Sources/Builder/RealWorld/Example.swift
================================================
import Foundation
import XCTest
class BaseQueryBuilder {
typealias Predicate = (Model) -> (Bool)
func limit(_ limit: Int) -> BaseQueryBuilder {
return self
}
func filter(_ predicate: @escaping Predicate) -> BaseQueryBuilder {
return self
}
func fetch() -> [Model] {
preconditionFailure("Should be overridden in subclasses.")
}
}
class RealmQueryBuilder: BaseQueryBuilder {
enum Query {
case filter(Predicate)
case limit(Int)
/// ...
}
fileprivate var operations = [Query]()
@discardableResult
override func limit(_ limit: Int) -> RealmQueryBuilder {
operations.append(Query.limit(limit))
return self
}
@discardableResult
override func filter(_ predicate: @escaping Predicate) -> RealmQueryBuilder {
operations.append(Query.filter(predicate))
return self
}
override func fetch() -> [Model] {
print("RealmQueryBuilder: Initializing RealmDataProvider with \(operations.count) operations:")
return RealmProvider().fetch(operations)
}
}
class CoreDataQueryBuilder: BaseQueryBuilder {
enum Query {
case filter(Predicate)
case limit(Int)
case includesPropertyValues(Bool)
/// ...
}
fileprivate var operations = [Query]()
override func limit(_ limit: Int) -> CoreDataQueryBuilder {
operations.append(Query.limit(limit))
return self
}
override func filter(_ predicate: @escaping Predicate) -> CoreDataQueryBuilder {
operations.append(Query.filter(predicate))
return self
}
func includesPropertyValues(_ toggle: Bool) -> CoreDataQueryBuilder {
operations.append(Query.includesPropertyValues(toggle))
return self
}
override func fetch() -> [Model] {
print("CoreDataQueryBuilder: Initializing CoreDataProvider with \(operations.count) operations.")
return CoreDataProvider().fetch(operations)
}
}
/// Data Providers contain a logic how to fetch models. Builders accumulate
/// operations and then update providers to fetch the data.
class RealmProvider {
func fetch(_ operations: [RealmQueryBuilder.Query]) -> [Model] {
print("RealmProvider: Retrieving data from Realm...")
for item in operations {
switch item {
case .filter(_):
print("RealmProvider: executing the 'filter' operation.")
/// Use Realm instance to filter results.
break
case .limit(_):
print("RealmProvider: executing the 'limit' operation.")
/// Use Realm instance to limit results.
break
}
}
/// Return results from Realm
return []
}
}
class CoreDataProvider {
func fetch(_ operations: [CoreDataQueryBuilder.Query]) -> [Model] {
/// Create a NSFetchRequest
print("CoreDataProvider: Retrieving data from CoreData...")
for item in operations {
switch item {
case .filter(_):
print("CoreDataProvider: executing the 'filter' operation.")
/// Set a 'predicate' for a NSFetchRequest.
break
case .limit(_):
print("CoreDataProvider: executing the 'limit' operation.")
/// Set a 'fetchLimit' for a NSFetchRequest.
break
case .includesPropertyValues(_):
print("CoreDataProvider: executing the 'includesPropertyValues' operation.")
/// Set an 'includesPropertyValues' for a NSFetchRequest.
break
}
}
/// Execute a NSFetchRequest and return results.
return []
}
}
protocol DomainModel {
/// The protocol groups domain models to the common interface
}
private struct User: DomainModel {
let id: Int
let age: Int
let email: String
}
class BuilderRealWorld: XCTestCase {
func testBuilderRealWorld() {
print("Client: Start fetching data from Realm")
clientCode(builder: RealmQueryBuilder())
print()
print("Client: Start fetching data from CoreData")
clientCode(builder: CoreDataQueryBuilder())
}
fileprivate func clientCode(builder: BaseQueryBuilder) {
let results = builder.filter({ $0.age < 20 })
.limit(1)
.fetch()
print("Client: I have fetched: " + String(results.count) + " records.")
}
}
================================================
FILE: Sources/Builder/RealWorld/Info.plist
================================================
CFBundleDevelopmentRegion
$(DEVELOPMENT_LANGUAGE)
CFBundleExecutable
$(EXECUTABLE_NAME)
CFBundleIdentifier
$(PRODUCT_BUNDLE_IDENTIFIER)
CFBundleInfoDictionaryVersion
6.0
CFBundleName
$(PRODUCT_NAME)
CFBundlePackageType
BNDL
CFBundleShortVersionString
1.0
CFBundleVersion
1
================================================
FILE: Sources/Builder/RealWorld/Output.txt
================================================
Client: Start fetching data from Realm
RealmQueryBuilder: Initializing RealmDataProvider with 2 operations:
RealmProvider: Retrieving data from Realm...
RealmProvider: executing the 'filter' operation.
RealmProvider: executing the 'limit' operation.
Client: I have fetched: 0 records.
Client: Start fetching data from CoreData
CoreDataQueryBuilder: Initializing CoreDataProvider with 2 operations.
CoreDataProvider: Retrieving data from CoreData...
CoreDataProvider: executing the 'filter' operation.
CoreDataProvider: executing the 'limit' operation.
Client: I have fetched: 0 records.
================================================
FILE: Sources/ChainOfResponsibility/Conceptual/Example.swift
================================================
/// EN: Chain of Responsibility Design Pattern
///
/// Intent: Lets you pass requests along a chain of handlers. Upon receiving a
/// request, each handler decides either to process the request or to pass it to
/// the next handler in the chain.
///
/// RU: Паттерн Цепочка обязанностей
///
/// Назначение: Позволяет передавать запросы последовательно по цепочке
/// обработчиков. Каждый последующий обработчик решает, может ли он обработать
/// запрос сам и стоит ли передавать запрос дальше по цепи.
import XCTest
/// EN: The Handler interface declares a method for building the chain of
/// handlers. It also declares a method for executing a request.
///
/// RU: Интерфейс Обработчика объявляет метод построения цепочки обработчиков.
/// Он также объявляет метод для выполнения запроса.
protocol Handler: AnyObject {
@discardableResult
func setNext(handler: Handler) -> Handler
func handle(request: String) -> String?
var nextHandler: Handler? { get set }
}
extension Handler {
func setNext(handler: Handler) -> Handler {
self.nextHandler = handler
/// EN: Returning a handler from here will let us link handlers in a
/// convenient way like this:
/// monkey.setNext(handler: squirrel).setNext(handler: dog)
///
/// RU: Возврат обработчика отсюда позволит связать обработчики простым
/// способом, вот так:
/// monkey.setNext(handler: squirrel).setNext(handler: dog)
return handler
}
func handle(request: String) -> String? {
return nextHandler?.handle(request: request)
}
}
/// EN: All Concrete Handlers either handle a request or pass it to the next
/// handler in the chain.
///
/// RU: Все Конкретные Обработчики либо обрабатывают запрос, либо передают его
/// следующему обработчику в цепочке.
class MonkeyHandler: Handler {
var nextHandler: Handler?
func handle(request: String) -> String? {
if (request == "Banana") {
return "Monkey: I'll eat the " + request + ".\n"
} else {
return nextHandler?.handle(request: request)
}
}
}
class SquirrelHandler: Handler {
var nextHandler: Handler?
func handle(request: String) -> String? {
if (request == "Nut") {
return "Squirrel: I'll eat the " + request + ".\n"
} else {
return nextHandler?.handle(request: request)
}
}
}
class DogHandler: Handler {
var nextHandler: Handler?
func handle(request: String) -> String? {
if (request == "MeatBall") {
return "Dog: I'll eat the " + request + ".\n"
} else {
return nextHandler?.handle(request: request)
}
}
}
/// EN: The client code is usually suited to work with a single handler. In most
/// cases, it is not even aware that the handler is part of a chain.
///
/// RU: Обычно клиентский код приспособлен для работы с единственным
/// обработчиком. В большинстве случаев клиенту даже неизвестно, что этот
/// обработчик является частью цепочки.
class Client {
// ...
static func someClientCode(handler: Handler) {
let food = ["Nut", "Banana", "Cup of coffee"]
for item in food {
print("Client: Who wants a " + item + "?\n")
guard let result = handler.handle(request: item) else {
print(" " + item + " was left untouched.\n")
return
}
print(" " + result)
}
}
// ...
}
/// EN: Let's see how it all works together.
///
/// RU: Давайте посмотрим как всё это будет работать.
class ChainOfResponsibilityConceptual: XCTestCase {
func test() {
/// EN: The other part of the client code constructs the actual chain.
///
/// RU: Другая часть клиентского кода создает саму цепочку.
let monkey = MonkeyHandler()
let squirrel = SquirrelHandler()
let dog = DogHandler()
monkey.setNext(handler: squirrel).setNext(handler: dog)
/// EN: The client should be able to send a request to any handler, not
/// just the first one in the chain.
///
/// RU: Клиент должен иметь возможность отправлять запрос любому
/// обработчику, а не только первому в цепочке.
print("Chain: Monkey > Squirrel > Dog\n\n")
Client.someClientCode(handler: monkey)
print()
print("Subchain: Squirrel > Dog\n\n")
Client.someClientCode(handler: squirrel)
}
}
================================================
FILE: Sources/ChainOfResponsibility/Conceptual/Info.plist
================================================
CFBundleDevelopmentRegion
$(DEVELOPMENT_LANGUAGE)
CFBundleExecutable
$(EXECUTABLE_NAME)
CFBundleIdentifier
$(PRODUCT_BUNDLE_IDENTIFIER)
CFBundleInfoDictionaryVersion
6.0
CFBundleName
$(PRODUCT_NAME)
CFBundlePackageType
BNDL
CFBundleShortVersionString
1.0
CFBundleVersion
1
================================================
FILE: Sources/ChainOfResponsibility/Conceptual/Output.txt
================================================
Chain: Monkey > Squirrel > Dog
Client: Who wants a Nut?
Squirrel: I'll eat the Nut.
Client: Who wants a Banana?
Monkey: I'll eat the Banana.
Client: Who wants a Cup of coffee?
Cup of coffee was left untouched.
Subchain: Squirrel > Dog
Client: Who wants a Nut?
Squirrel: I'll eat the Nut.
Client: Who wants a Banana?
Banana was left untouched.
================================================
FILE: Sources/ChainOfResponsibility/RealWorld/Example.swift
================================================
import Foundation
import UIKit
import XCTest
protocol Handler {
var next: Handler? { get }
func handle(_ request: Request) -> LocalizedError?
}
class BaseHandler: Handler {
var next: Handler?
init(with handler: Handler? = nil) {
self.next = handler
}
func handle(_ request: Request) -> LocalizedError? {
return next?.handle(request)
}
}
class LoginHandler: BaseHandler {
override func handle(_ request: Request) -> LocalizedError? {
guard request.email?.isEmpty == false else {
return AuthError.emptyEmail
}
guard request.password?.isEmpty == false else {
return AuthError.emptyPassword
}
return next?.handle(request)
}
}
class SignUpHandler: BaseHandler {
private struct Limit {
static let passwordLength = 8
}
override func handle(_ request: Request) -> LocalizedError? {
guard request.email?.contains("@") == true else {
return AuthError.invalidEmail
}
guard (request.password?.count ?? 0) >= Limit.passwordLength else {
return AuthError.invalidPassword
}
guard request.password == request.repeatedPassword else {
return AuthError.differentPasswords
}
return next?.handle(request)
}
}
class LocationHandler: BaseHandler {
override func handle(_ request: Request) -> LocalizedError? {
guard isLocationEnabled() else {
return AuthError.locationDisabled
}
return next?.handle(request)
}
func isLocationEnabled() -> Bool {
return true /// Calls special method
}
}
class NotificationHandler: BaseHandler {
override func handle(_ request: Request) -> LocalizedError? {
guard isNotificationsEnabled() else {
return AuthError.notificationsDisabled
}
return next?.handle(request)
}
func isNotificationsEnabled() -> Bool {
return false /// Calls special method
}
}
enum AuthError: LocalizedError {
case emptyFirstName
case emptyLastName
case emptyEmail
case emptyPassword
case invalidEmail
case invalidPassword
case differentPasswords
case locationDisabled
case notificationsDisabled
var errorDescription: String? {
switch self {
case .emptyFirstName:
return "First name is empty"
case .emptyLastName:
return "Last name is empty"
case .emptyEmail:
return "Email is empty"
case .emptyPassword:
return "Password is empty"
case .invalidEmail:
return "Email is invalid"
case .invalidPassword:
return "Password is invalid"
case .differentPasswords:
return "Password and repeated password should be equal"
case .locationDisabled:
return "Please turn location services on"
case .notificationsDisabled:
return "Please turn notifications on"
}
}
}
protocol Request {
var firstName: String? { get }
var lastName: String? { get }
var email: String? { get }
var password: String? { get }
var repeatedPassword: String? { get }
}
extension Request {
/// Default implementations
var firstName: String? { return nil }
var lastName: String? { return nil }
var email: String? { return nil }
var password: String? { return nil }
var repeatedPassword: String? { return nil }
}
struct SignUpRequest: Request {
var firstName: String?
var lastName: String?
var email: String?
var password: String?
var repeatedPassword: String?
}
struct LoginRequest: Request {
var email: String?
var password: String?
}
protocol AuthHandlerSupportable: AnyObject {
var handler: Handler? { get set }
}
class BaseAuthViewController: UIViewController, AuthHandlerSupportable {
/// Base class or extensions can be used to implement a base behavior
var handler: Handler?
init(handler: Handler) {
self.handler = handler
super.init(nibName: nil, bundle: nil)
}
required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
}
}
class LoginViewController: BaseAuthViewController {
func loginButtonSelected() {
print("Login View Controller: User selected Login button")
let request = LoginRequest(email: "smth@gmail.com", password: "123HardPass")
if let error = handler?.handle(request) {
print("Login View Controller: something went wrong")
print("Login View Controller: Error -> " + (error.errorDescription ?? ""))
} else {
print("Login View Controller: Preconditions are successfully validated")
}
}
}
class SignUpViewController: BaseAuthViewController {
func signUpButtonSelected() {
print("SignUp View Controller: User selected SignUp button")
let request = SignUpRequest(firstName: "Vasya",
lastName: "Pupkin",
email: "vasya.pupkin@gmail.com",
password: "123HardPass",
repeatedPassword: "123HardPass")
if let error = handler?.handle(request) {
print("SignUp View Controller: something went wrong")
print("SignUp View Controller: Error -> " + (error.errorDescription ?? ""))
} else {
print("SignUp View Controller: Preconditions are successfully validated")
}
}
}
class ChainOfResponsibilityRealWorld: XCTestCase {
func testChainOfResponsibilityRealWorld() {
print("Client: Let's test Login flow!")
let loginHandler = LoginHandler(with: LocationHandler())
let loginController = LoginViewController(handler: loginHandler)
loginController.loginButtonSelected()
print("\nClient: Let's test SignUp flow!")
let signUpHandler = SignUpHandler(with: LocationHandler(with: NotificationHandler()))
let signUpController = SignUpViewController(handler: signUpHandler)
signUpController.signUpButtonSelected()
}
}
================================================
FILE: Sources/ChainOfResponsibility/RealWorld/Info.plist
================================================
CFBundleDevelopmentRegion
$(DEVELOPMENT_LANGUAGE)
CFBundleExecutable
$(EXECUTABLE_NAME)
CFBundleIdentifier
$(PRODUCT_BUNDLE_IDENTIFIER)
CFBundleInfoDictionaryVersion
6.0
CFBundleName
$(PRODUCT_NAME)
CFBundlePackageType
BNDL
CFBundleShortVersionString
1.0
CFBundleVersion
1
================================================
FILE: Sources/ChainOfResponsibility/RealWorld/Output.txt
================================================
Client: Let's test Login flow!
Login View Controller: User selected Login button
Login View Controller: Preconditions are successfully validated
Client: Let's test SignUp flow!
SignUp View Controller: User selected SignUp button
SignUp View Controller: something went wrong
SignUp View Controller: Error -> Please turn notifications on
================================================
FILE: Sources/Command/Conceptual/Example.swift
================================================
/// EN: Command Design Pattern
///
/// Intent: Turns a request into a stand-alone object that contains all
/// information about the request. This transformation lets you parameterize
/// methods with different requests, delay or queue a request's execution, and
/// support undoable operations.
///
/// RU: Паттерн Команда
///
/// Назначение: Превращает запросы в объекты, позволяя передавать их как
/// аргументы при вызове методов, ставить запросы в очередь, логировать их, а
/// также поддерживать отмену операций.
import XCTest
/// EN: The Command interface declares a method for executing a command.
///
/// RU: Интерфейс Команды объявляет метод для выполнения команд.
protocol Command {
func execute()
}
/// EN: Some commands can implement simple operations on their own.
///
/// RU: Некоторые команды способны выполнять простые операции самостоятельно.
class SimpleCommand: Command {
private var payload: String
init(_ payload: String) {
self.payload = payload
}
func execute() {
print("SimpleCommand: See, I can do simple things like printing (" + payload + ")")
}
}
/// EN: However, some commands can delegate more complex operations to other
/// objects, called "receivers."
///
/// RU: Но есть и команды, которые делегируют более сложные операции другим
/// объектам, называемым «получателями».
class ComplexCommand: Command {
private var receiver: Receiver
/// EN: Context data, required for launching the receiver's methods.
///
/// RU: Данные о контексте, необходимые для запуска методов получателя.
private var a: String
private var b: String
/// EN: Complex commands can accept one or several receiver objects along
/// with any context data via the constructor.
///
/// RU: Сложные команды могут принимать один или несколько
/// объектов-получателей вместе с любыми данными о контексте через
/// конструктор.
init(_ receiver: Receiver, _ a: String, _ b: String) {
self.receiver = receiver
self.a = a
self.b = b
}
/// EN: Commands can delegate to any methods of a receiver.
///
/// RU: Команды могут делегировать выполнение любым методам получателя.
func execute() {
print("ComplexCommand: Complex stuff should be done by a receiver object.\n")
receiver.doSomething(a)
receiver.doSomethingElse(b)
}
}
/// EN: The Receiver classes contain some important business logic. They know
/// how to perform all kinds of operations, associated with carrying out a
/// request. In fact, any class may serve as a Receiver.
///
/// RU: Классы Получателей содержат некую важную бизнес-логику. Они умеют
/// выполнять все виды операций, связанных с выполнением запроса. Фактически,
/// любой класс может выступать Получателем.
class Receiver {
func doSomething(_ a: String) {
print("Receiver: Working on (" + a + ")\n")
}
func doSomethingElse(_ b: String) {
print("Receiver: Also working on (" + b + ")\n")
}
}
/// EN: The Invoker is associated with one or several commands. It sends a
/// request to the command.
///
/// RU: Отпрвитель связан с одной или несколькими командами. Он отправляет
/// запрос команде.
class Invoker {
private var onStart: Command?
private var onFinish: Command?
/// EN: Initialize commands.
///
/// RU: Инициализация команд.
func setOnStart(_ command: Command) {
onStart = command
}
func setOnFinish(_ command: Command) {
onFinish = command
}
/// EN: The Invoker does not depend on concrete command or receiver classes.
/// The Invoker passes a request to a receiver indirectly, by executing a
/// command.
///
/// RU: Отправитель не зависит от классов конкретных команд и получателей.
/// Отправитель передаёт запрос получателю косвенно, выполняя команду.
func doSomethingImportant() {
print("Invoker: Does anybody want something done before I begin?")
onStart?.execute()
print("Invoker: ...doing something really important...")
print("Invoker: Does anybody want something done after I finish?")
onFinish?.execute()
}
}
/// EN: Let's see how it all comes together.
///
/// RU: Давайте посмотрим как всё это будет работать.
class CommandConceptual: XCTestCase {
func test() {
/// EN: The client code can parameterize an invoker with any commands.
///
/// RU: Клиентский код может параметризовать отправителя любыми
/// командами.
let invoker = Invoker()
invoker.setOnStart(SimpleCommand("Say Hi!"))
let receiver = Receiver()
invoker.setOnFinish(ComplexCommand(receiver, "Send email", "Save report"))
invoker.doSomethingImportant()
}
}
================================================
FILE: Sources/Command/Conceptual/Info.plist
================================================
CFBundleDevelopmentRegion
$(DEVELOPMENT_LANGUAGE)
CFBundleExecutable
$(EXECUTABLE_NAME)
CFBundleIdentifier
$(PRODUCT_BUNDLE_IDENTIFIER)
CFBundleInfoDictionaryVersion
6.0
CFBundleName
$(PRODUCT_NAME)
CFBundlePackageType
BNDL
CFBundleShortVersionString
1.0
CFBundleVersion
1
================================================
FILE: Sources/Command/Conceptual/Output.txt
================================================
Invoker: Does anybody want something done before I begin?
SimpleCommand: See, I can do simple things like printing (Say Hi!)
Invoker: ...doing something really important...
Invoker: Does anybody want something done after I finish?
ComplexCommand: Complex stuff should be done by a receiver object.
Receiver: Working on (Send email)
Receiver: Also working on (Save report)
================================================
FILE: Sources/Command/RealWorld/Example.swift
================================================
import Foundation
import XCTest
class DelayedOperation: Operation, @unchecked Sendable {
private var delay: TimeInterval
init(_ delay: TimeInterval = 0) {
self.delay = delay
}
override var isExecuting : Bool {
get { return _executing }
set {
willChangeValue(forKey: "isExecuting")
_executing = newValue
didChangeValue(forKey: "isExecuting")
}
}
private var _executing : Bool = false
override var isFinished : Bool {
get { return _finished }
set {
willChangeValue(forKey: "isFinished")
_finished = newValue
didChangeValue(forKey: "isFinished")
}
}
private var _finished : Bool = false
override func start() {
guard delay > 0 else {
_start()
return
}
let deadline = DispatchTime.now() + delay
DispatchQueue(label: "").asyncAfter(deadline: deadline) {
self._start()
}
}
private func _start() {
guard !self.isCancelled else {
print("\(self): operation is canceled")
self.isFinished = true
return
}
self.isExecuting = true
self.main()
self.isExecuting = false
self.isFinished = true
}
}
class WindowOperation: DelayedOperation, @unchecked Sendable {
override func main() {
print("\(self): Windows are closed via HomeKit.")
}
override var description: String { return "WindowOperation" }
}
class DoorOperation: DelayedOperation, @unchecked Sendable {
override func main() {
print("\(self): Doors are closed via HomeKit.")
}
override var description: String { return "DoorOperation" }
}
class TaxiOperation: DelayedOperation, @unchecked Sendable {
override func main() {
print("\(self): Taxi is ordered via Uber")
}
override var description: String { return "TaxiOperation" }
}
class CommandRealWorld: XCTestCase {
func testCommandRealWorld() {
prepareTestEnvironment {
let siri = SiriShortcuts.shared
print("User: Hey Siri, I am leaving my home")
siri.perform(.leaveHome)
print("User: Hey Siri, I am leaving my work in 3 minutes")
siri.perform(.leaveWork, delay: 3) /// for simplicity, we use seconds
print("User: Hey Siri, I am still working")
siri.cancel(.leaveWork)
}
}
}
extension CommandRealWorld {
struct ExecutionTime {
static let max: TimeInterval = 5
static let waiting: TimeInterval = 4
}
func prepareTestEnvironment(_ execution: () -> ()) {
/// This method tells Xcode to wait for async operations. Otherwise the
/// main test is done immediately.
let expectation = self.expectation(description: "Expectation for async operations")
let deadline = DispatchTime.now() + ExecutionTime.waiting
DispatchQueue.main.asyncAfter(deadline: deadline) { expectation.fulfill() }
execution()
wait(for: [expectation], timeout: ExecutionTime.max)
}
}
class SiriShortcuts {
static let shared = SiriShortcuts()
private lazy var queue = OperationQueue()
private init() {}
enum Action: String {
case leaveHome
case leaveWork
}
func perform(_ action: Action, delay: TimeInterval = 0) {
print("Siri: performing \(action)-action\n")
switch action {
case .leaveHome:
add(operation: WindowOperation(delay))
add(operation: DoorOperation(delay))
case .leaveWork:
add(operation: TaxiOperation(delay))
}
}
func cancel(_ action: Action) {
print("Siri: canceling \(action)-action\n")
switch action {
case .leaveHome:
cancelOperation(with: WindowOperation.self)
cancelOperation(with: DoorOperation.self)
case .leaveWork:
cancelOperation(with: TaxiOperation.self)
}
}
private func cancelOperation(with operationType: Operation.Type) {
queue.operations.filter { operation in
return type(of: operation) == operationType
}.forEach({ $0.cancel() })
}
private func add(operation: Operation) {
queue.addOperation(operation)
}
}
================================================
FILE: Sources/Command/RealWorld/Info.plist
================================================
CFBundleDevelopmentRegion
$(DEVELOPMENT_LANGUAGE)
CFBundleExecutable
$(EXECUTABLE_NAME)
CFBundleIdentifier
$(PRODUCT_BUNDLE_IDENTIFIER)
CFBundleInfoDictionaryVersion
6.0
CFBundleName
$(PRODUCT_NAME)
CFBundlePackageType
BNDL
CFBundleShortVersionString
1.0
CFBundleVersion
1
================================================
FILE: Sources/Command/RealWorld/Output.txt
================================================
User: Hey Siri, I am leaving my home
Siri: performing leaveHome-action
User: Hey Siri, I am leaving my work in 3 minutes
Siri: performing leaveWork-action
User: Hey Siri, I am still working
Siri: canceling leaveWork-action
DoorOperation: Doors are closed via HomeKit.
WindowOperation: Windows are closed via HomeKit.
TaxiOperation: operation is canceled
================================================
FILE: Sources/Composite/Conceptual/Example.swift
================================================
/// EN: Composite Design Pattern
///
/// Intent: Lets you compose objects into tree structures and then work with
/// these structures as if they were individual objects.
///
/// RU: Паттерн Компоновщик
///
/// Назначение: Позволяет сгруппировать объекты в древовидную структуру, а затем
/// работать с ними так, как будто это единичный объект.
import XCTest
/// EN: The base Component class declares common operations for both simple and
/// complex objects of a composition.
///
/// RU: Базовый класс Компонент объявляет общие операции как для простых, так и
/// для сложных объектов структуры.
protocol Component {
/// EN: The base Component may optionally declare methods for setting and
/// accessing a parent of the component in a tree structure. It can also
/// provide some default implementation for these methods.
///
/// RU: При необходимости базовый Компонент может объявить интерфейс для
/// установки и получения родителя компонента в древовидной структуре. Он
/// также может предоставить некоторую реализацию по умолчанию для этих
/// методов.
var parent: Component? { get set }
/// EN: In some cases, it would be beneficial to define the child-management
/// operations right in the base Component class. This way, you won't need
/// to expose any concrete component classes to the client code, even during
/// the object tree assembly. The downside is that these methods will be
/// empty for the leaf-level components.
///
/// RU: В некоторых случаях целесообразно определить операции управления
/// потомками прямо в базовом классе Компонент. Таким образом, вам не нужно
/// будет предоставлять конкретные классы компонентов клиентскому коду,
/// даже во время сборки дерева объектов. Недостаток такого подхода в том,
/// что эти методы будут пустыми для компонентов уровня листа.
func add(component: Component)
func remove(component: Component)
/// EN: You can provide a method that lets the client code figure out
/// whether a component can bear children.
///
/// RU: Вы можете предоставить метод, который позволит клиентскому коду
/// понять, может ли компонент иметь вложенные объекты.
func isComposite() -> Bool
/// EN: The base Component may implement some default behavior or leave it
/// to concrete classes.
///
/// RU: Базовый Компонент может сам реализовать некоторое поведение по
/// умолчанию или поручить это конкретным классам.
func operation() -> String
}
extension Component {
func add(component: Component) {}
func remove(component: Component) {}
func isComposite() -> Bool {
return false
}
}
/// EN: The Leaf class represents the end objects of a composition. A leaf can't
/// have any children.
///
/// Usually, it's the Leaf objects that do the actual work, whereas Composite
/// objects only delegate to their sub-components.
///
/// RU: Класс Лист представляет собой конечные объекты структуры. Лист не может
/// иметь вложенных компонентов.
///
/// Обычно объекты Листьев выполняют фактическую работу, тогда как объекты
/// Контейнера лишь делегируют работу своим подкомпонентам.
class Leaf: Component {
var parent: Component?
func operation() -> String {
return "Leaf"
}
}
/// EN: The Composite class represents the complex components that may have
/// children. Usually, the Composite objects delegate the actual work to their
/// children and then "sum-up" the result.
///
/// RU: Класс Контейнер содержит сложные компоненты, которые могут иметь
/// вложенные компоненты. Обычно объекты Контейнеры делегируют фактическую
/// работу своим детям, а затем «суммируют» результат.
class Composite: Component {
var parent: Component?
/// EN: This fields contains the conponent subtree.
///
/// RU: Это поле содержит поддерево компонентов.
private var children = [Component]()
/// EN: A composite object can add or remove other components (both simple
/// or complex) to or from its child list.
///
/// RU: Объект контейнера может как добавлять компоненты в свой список
/// вложенных компонентов, так и удалять их, как простые, так и сложные.
func add(component: Component) {
var item = component
item.parent = self
children.append(item)
}
func remove(component: Component) {
// ...
}
func isComposite() -> Bool {
return true
}
/// EN: The Composite executes its primary logic in a particular way. It
/// traverses recursively through all its children, collecting and summing
/// their results. Since the composite's children pass these calls to their
/// children and so forth, the whole object tree is traversed as a result.
///
/// RU: Контейнер выполняет свою основную логику особым образом. Он проходит
/// рекурсивно через всех своих детей, собирая и суммируя их результаты.
/// Поскольку потомки контейнера передают эти вызовы своим потомкам и так
/// далее, в результате обходится всё дерево объектов.
func operation() -> String {
let result = children.map({ $0.operation() })
return "Branch(" + result.joined(separator: " ") + ")"
}
}
class Client {
/// EN: The client code works with all of the components via the base
/// interface.
///
/// RU: Клиентский код работает со всеми компонентами через базовый
/// интерфейс.
static func someClientCode(component: Component) {
print("Result: " + component.operation())
}
/// EN: Thanks to the fact that the child-management operations are also
/// declared in the base Component class, the client code can work with both
/// simple or complex components.
///
/// RU: Благодаря тому, что операции управления потомками объявлены в
/// базовом классе Компонента, клиентский код может работать как с простыми,
/// так и со сложными компонентами.
static func moreComplexClientCode(leftComponent: Component, rightComponent: Component) {
if leftComponent.isComposite() {
leftComponent.add(component: rightComponent)
}
print("Result: " + leftComponent.operation())
}
}
/// EN: Let's see how it all comes together.
///
/// RU: Давайте посмотрим как всё это будет работать.
class CompositeConceptual: XCTestCase {
func testCompositeConceptual() {
/// EN: This way the client code can support the simple leaf
/// components...
///
/// RU: Таким образом, клиентский код может поддерживать простые
/// компоненты-листья...
print("Client: I've got a simple component:")
Client.someClientCode(component: Leaf())
/// EN: ...as well as the complex composites.
///
/// RU: ...а также сложные контейнеры.
let tree = Composite()
let branch1 = Composite()
branch1.add(component: Leaf())
branch1.add(component: Leaf())
let branch2 = Composite()
branch2.add(component: Leaf())
branch2.add(component: Leaf())
tree.add(component: branch1)
tree.add(component: branch2)
print("\nClient: Now I've got a composite tree:")
Client.someClientCode(component: tree)
print("\nClient: I don't need to check the components classes even when managing the tree:")
Client.moreComplexClientCode(leftComponent: tree, rightComponent: Leaf())
}
}
================================================
FILE: Sources/Composite/Conceptual/Info.plist
================================================
CFBundleDevelopmentRegion
$(DEVELOPMENT_LANGUAGE)
CFBundleExecutable
$(EXECUTABLE_NAME)
CFBundleIdentifier
$(PRODUCT_BUNDLE_IDENTIFIER)
CFBundleInfoDictionaryVersion
6.0
CFBundleName
$(PRODUCT_NAME)
CFBundlePackageType
BNDL
CFBundleShortVersionString
1.0
CFBundleVersion
1
================================================
FILE: Sources/Composite/Conceptual/Output.txt
================================================
Client: I've got a simple component:
Result: Leaf
Client: Now I've got a composite tree:
Result: Branch(Branch(Leaf Leaf) Branch(Leaf Leaf))
Client: I don't need to check the components classes even when managing the tree:
Result: Branch(Branch(Leaf Leaf) Branch(Leaf Leaf) Leaf)
================================================
FILE: Sources/Composite/RealWorld/Example.swift
================================================
import UIKit
import XCTest
protocol Component {
func accept(theme: T)
}
extension Component where Self: UIViewController {
func accept(theme: T) {
view.accept(theme: theme)
view.subviews.forEach({ $0.accept(theme: theme) })
}
}
extension UIView: Component {}
extension UIViewController: Component {}
extension Component where Self: UIView {
func accept(theme: T) {
print("\t\(description): has applied \(theme.description)")
backgroundColor = theme.backgroundColor
}
}
extension Component where Self: UILabel {
func accept(theme: T) {
print("\t\(description): has applied \(theme.description)")
backgroundColor = theme.backgroundColor
textColor = theme.textColor
}
}
extension Component where Self: UIButton {
func accept(theme: T) {
print("\t\(description): has applied \(theme.description)")
backgroundColor = theme.backgroundColor
setTitleColor(theme.textColor, for: .normal)
setTitleColor(theme.highlightedColor, for: .highlighted)
}
}
protocol Theme: CustomStringConvertible {
var backgroundColor: UIColor { get }
}
protocol ButtonTheme: Theme {
var textColor: UIColor { get }
var highlightedColor: UIColor { get }
/// other properties
}
protocol LabelTheme: Theme {
var textColor: UIColor { get }
/// other properties
}
/// Button Themes
struct DefaultButtonTheme: ButtonTheme {
var textColor = UIColor.red
var highlightedColor = UIColor.white
var backgroundColor = UIColor.orange
var description: String { return "Default Buttom Theme" }
}
struct NightButtonTheme: ButtonTheme {
var textColor = UIColor.white
var highlightedColor = UIColor.red
var backgroundColor = UIColor.black
var description: String { return "Night Buttom Theme" }
}
/// Label Themes
struct DefaultLabelTheme: LabelTheme {
var textColor = UIColor.red
var backgroundColor = UIColor.black
var description: String { return "Default Label Theme" }
}
struct NightLabelTheme: LabelTheme {
var textColor = UIColor.white
var backgroundColor = UIColor.black
var description: String { return "Night Label Theme" }
}
class CompositeRealWorld: XCTestCase {
func testCompositeRealWorld() {
print("\nClient: Applying 'default' theme for 'UIButton'")
apply(theme: DefaultButtonTheme(), for: UIButton())
print("\nClient: Applying 'night' theme for 'UIButton'")
apply(theme: NightButtonTheme(), for: UIButton())
print("\nClient: Let's use View Controller as a composite!")
/// Night theme
print("\nClient: Applying 'night button' theme for 'WelcomeViewController'...")
apply(theme: NightButtonTheme(), for: WelcomeViewController())
print()
print("\nClient: Applying 'night label' theme for 'WelcomeViewController'...")
apply(theme: NightLabelTheme(), for: WelcomeViewController())
print()
/// Default Theme
print("\nClient: Applying 'default button' theme for 'WelcomeViewController'...")
apply(theme: DefaultButtonTheme(), for: WelcomeViewController())
print()
print("\nClient: Applying 'default label' theme for 'WelcomeViewController'...")
apply(theme: DefaultLabelTheme(), for: WelcomeViewController())
print()
}
func apply(theme: T, for component: Component) {
component.accept(theme: theme)
}
}
class WelcomeViewController: UIViewController {
class ContentView: UIView {
var titleLabel = UILabel()
var actionButton = UIButton()
override init(frame: CGRect) {
super.init(frame: frame)
setup()
}
required init?(coder decoder: NSCoder) {
super.init(coder: decoder)
setup()
}
func setup() {
addSubview(titleLabel)
addSubview(actionButton)
}
}
override func loadView() {
view = ContentView()
}
}
/// Let's override a description property for the better output
extension WelcomeViewController {
open override var description: String { return "WelcomeViewController" }
}
extension WelcomeViewController.ContentView {
override var description: String { return "ContentView" }
}
extension UIButton {
open override var description: String { return "UIButton" }
}
extension UILabel {
open override var description: String { return "UILabel" }
}
================================================
FILE: Sources/Composite/RealWorld/Info.plist
================================================
CFBundleDevelopmentRegion
$(DEVELOPMENT_LANGUAGE)
CFBundleExecutable
$(EXECUTABLE_NAME)
CFBundleIdentifier
$(PRODUCT_BUNDLE_IDENTIFIER)
CFBundleInfoDictionaryVersion
6.0
CFBundleName
$(PRODUCT_NAME)
CFBundlePackageType
BNDL
CFBundleShortVersionString
1.0
CFBundleVersion
1
================================================
FILE: Sources/Composite/RealWorld/Output.txt
================================================
Client: Applying 'default' theme for 'UIButton'
UIButton: has applied Default Buttom Theme
Client: Applying 'night' theme for 'UIButton'
UIButton: has applied Night Buttom Theme
Client: Let's use View Controller as a composite!
Client: Applying 'night button' theme for 'WelcomeViewController'...
ContentView: has applied Night Buttom Theme
UILabel: has applied Night Buttom Theme
UIButton: has applied Night Buttom Theme
================================================
FILE: Sources/Decorator/Conceptual/Example.swift
================================================
/// EN: Decorator Design Pattern
///
/// Intent: Lets you attach new behaviors to objects by placing these objects
/// inside special wrapper objects that contain the behaviors.
///
/// RU: Паттерн Декоратор
///
/// Назначение: Позволяет динамически добавлять объектам новую функциональность,
/// оборачивая их в полезные «обёртки».
import XCTest
/// EN: The base Component interface defines operations that can be altered by
/// decorators.
///
/// RU: Базовый интерфейс Компонента определяет поведение, которое изменяется
/// декораторами.
protocol Component {
func operation() -> String
}
/// EN: Concrete Components provide default implementations of the operations.
/// There might be several variations of these classes.
///
/// RU: Конкретные Компоненты предоставляют реализации поведения по умолчанию.
/// Может быть несколько вариаций этих классов.
class ConcreteComponent: Component {
func operation() -> String {
return "ConcreteComponent"
}
}
/// EN: The base Decorator class follows the same interface as the other
/// components. The primary purpose of this class is to define the wrapping
/// interface for all concrete decorators. The default implementation of the
/// wrapping code might include a field for storing a wrapped component and the
/// means to initialize it.
///
/// RU: Базовый класс Декоратора следует тому же интерфейсу, что и другие
/// компоненты. Основная цель этого класса - определить интерфейс обёртки для
/// всех конкретных декораторов. Реализация кода обёртки по умолчанию может
/// включать в себя поле для хранения завёрнутого компонента и средства его
/// инициализации.
class Decorator: Component {
private var component: Component
init(_ component: Component) {
self.component = component
}
/// EN: The Decorator delegates all work to the wrapped component.
///
/// RU: Декоратор делегирует всю работу обёрнутому компоненту.
func operation() -> String {
return component.operation()
}
}
/// EN: Concrete Decorators call the wrapped object and alter its result in some
/// way.
///
/// RU: Конкретные Декораторы вызывают обёрнутый объект и изменяют его результат
/// некоторым образом.
class ConcreteDecoratorA: Decorator {
/// EN: Decorators may call parent implementation of the operation, instead
/// of calling the wrapped object directly. This approach simplifies
/// extension of decorator classes.
///
/// RU: Декораторы могут вызывать родительскую реализацию операции, вместо
/// того, чтобы вызвать обёрнутый объект напрямую. Такой подход упрощает
/// расширение классов декораторов.
override func operation() -> String {
return "ConcreteDecoratorA(" + super.operation() + ")"
}
}
/// EN: Decorators can execute their behavior either before or after the call to
/// a wrapped object.
///
/// RU: Декораторы могут выполнять своё поведение до или после вызова обёрнутого
/// объекта.
class ConcreteDecoratorB: Decorator {
override func operation() -> String {
return "ConcreteDecoratorB(" + super.operation() + ")"
}
}
/// EN: The client code works with all objects using the Component interface.
/// This way it can stay independent of the concrete classes of components it
/// works with.
///
/// RU: Клиентский код работает со всеми объектами, используя интерфейс
/// Компонента. Таким образом, он остаётся независимым от конкретных классов
/// компонентов, с которыми работает.
class Client {
// ...
static func someClientCode(component: Component) {
print("Result: " + component.operation())
}
// ...
}
/// EN: Let's see how it all works together.
///
/// RU: Давайте посмотрим как всё это будет работать.
class DecoratorConceptual: XCTestCase {
func testDecoratorConceptual() {
// EN: This way the client code can support both simple components...
//
// RU: Таким образом, клиентский код может поддерживать как простые
// компоненты...
print("Client: I've got a simple component")
let simple = ConcreteComponent()
Client.someClientCode(component: simple)
// EN: ...as well as decorated ones.
//
// Note how decorators can wrap not only simple components but the other
// decorators as well.
//
// RU: ...так и декорированные.
//
// Обратите внимание, что декораторы могут обёртывать не только простые
// компоненты, но и другие декораторы.
let decorator1 = ConcreteDecoratorA(simple)
let decorator2 = ConcreteDecoratorB(decorator1)
print("\nClient: Now I've got a decorated component")
Client.someClientCode(component: decorator2)
}
}
================================================
FILE: Sources/Decorator/Conceptual/Info.plist
================================================
CFBundleDevelopmentRegion
$(DEVELOPMENT_LANGUAGE)
CFBundleExecutable
$(EXECUTABLE_NAME)
CFBundleIdentifier
$(PRODUCT_BUNDLE_IDENTIFIER)
CFBundleInfoDictionaryVersion
6.0
CFBundleName
$(PRODUCT_NAME)
CFBundlePackageType
BNDL
CFBundleShortVersionString
1.0
CFBundleVersion
1
================================================
FILE: Sources/Decorator/Conceptual/Output.txt
================================================
Client: I've got a simple component
Result: ConcreteComponent
Client: Now I've got a decorated component
Result: ConcreteDecoratorB(ConcreteDecoratorA(ConcreteComponent))
================================================
FILE: Sources/Decorator/RealWorld/Example.swift
================================================
import UIKit
import XCTest
protocol ImageEditor: CustomStringConvertible {
func apply() -> UIImage
}
class ImageDecorator: ImageEditor {
private var editor: ImageEditor
required init(_ editor: ImageEditor) {
self.editor = editor
}
func apply() -> UIImage {
print(editor.description + " applies changes")
return editor.apply()
}
var description: String {
return "ImageDecorator"
}
}
extension UIImage: ImageEditor {
func apply() -> UIImage {
return self
}
open override var description: String {
return "Image"
}
}
class BaseFilter: ImageDecorator {
fileprivate var filter: CIFilter?
init(editor: ImageEditor, filterName: String) {
self.filter = CIFilter(name: filterName)
super.init(editor)
}
required init(_ editor: ImageEditor) {
super.init(editor)
}
override func apply() -> UIImage {
let image = super.apply()
let context = CIContext(options: nil)
filter?.setValue(CIImage(image: image), forKey: kCIInputImageKey)
guard let output = filter?.outputImage else { return image }
guard let coreImage = context.createCGImage(output, from: output.extent) else {
return image
}
return UIImage(cgImage: coreImage)
}
override var description: String {
return "BaseFilter"
}
}
class BlurFilter: BaseFilter {
required init(_ editor: ImageEditor) {
super.init(editor: editor, filterName: "CIGaussianBlur")
}
func update(radius: Double) {
filter?.setValue(radius, forKey: "inputRadius")
}
override var description: String {
return "BlurFilter"
}
}
class ColorFilter: BaseFilter {
required init(_ editor: ImageEditor) {
super.init(editor: editor, filterName: "CIColorControls")
}
func update(saturation: Double) {
filter?.setValue(saturation, forKey: "inputSaturation")
}
func update(brightness: Double) {
filter?.setValue(brightness, forKey: "inputBrightness")
}
func update(contrast: Double) {
filter?.setValue(contrast, forKey: "inputContrast")
}
override var description: String {
return "ColorFilter"
}
}
class Resizer: ImageDecorator {
private var xScale: CGFloat = 0
private var yScale: CGFloat = 0
private var hasAlpha = false
convenience init(_ editor: ImageEditor, xScale: CGFloat = 0, yScale: CGFloat = 0, hasAlpha: Bool = false) {
self.init(editor)
self.xScale = xScale
self.yScale = yScale
self.hasAlpha = hasAlpha
}
required init(_ editor: ImageEditor) {
super.init(editor)
}
override func apply() -> UIImage {
let image = super.apply()
let size = image.size.applying(CGAffineTransform(scaleX: xScale, y: yScale))
UIGraphicsBeginImageContextWithOptions(size, !hasAlpha, UIScreen.main.scale)
image.draw(in: CGRect(origin: .zero, size: size))
let scaledImage = UIGraphicsGetImageFromCurrentImageContext()
UIGraphicsEndImageContext()
return scaledImage ?? image
}
override var description: String {
return "Resizer"
}
}
class DecoratorRealWorld: XCTestCase {
func testDecoratorRealWorld() {
let image = loadImage()
print("Client: set up an editors stack")
let resizer = Resizer(image, xScale: 0.2, yScale: 0.2)
let blurFilter = BlurFilter(resizer)
blurFilter.update(radius: 2)
let colorFilter = ColorFilter(blurFilter)
colorFilter.update(contrast: 0.53)
colorFilter.update(brightness: 0.12)
colorFilter.update(saturation: 4)
clientCode(editor: colorFilter)
}
func clientCode(editor: ImageEditor) {
let image = editor.apply()
/// Note. You can stop an execution in Xcode to see an image preview.
print("Client: all changes have been applied for \(image)")
}
}
private extension DecoratorRealWorld {
func loadImage() -> UIImage {
let urlString = "https://refactoring.guru/images/content-public/logos/logo-new-3x.png"
/// Note:
/// Do not download images the following way in a production code.
guard let url = URL(string: urlString) else {
fatalError("Please enter a valid URL")
}
guard let data = try? Data(contentsOf: url) else {
fatalError("Cannot load an image")
}
guard let image = UIImage(data: data) else {
fatalError("Cannot create an image from data")
}
return image
}
}
================================================
FILE: Sources/Decorator/RealWorld/Info.plist
================================================
CFBundleDevelopmentRegion
$(DEVELOPMENT_LANGUAGE)
CFBundleExecutable
$(EXECUTABLE_NAME)
CFBundleIdentifier
$(PRODUCT_BUNDLE_IDENTIFIER)
CFBundleInfoDictionaryVersion
6.0
CFBundleName
$(PRODUCT_NAME)
CFBundlePackageType
BNDL
CFBundleShortVersionString
1.0
CFBundleVersion
1
================================================
FILE: Sources/Decorator/RealWorld/Output.txt
================================================
Client: set up an editors stack
BlurFilter applies changes
Resizer applies changes
Image applies changes
Client: all changes have been applied for Image
================================================
FILE: Sources/Facade/Conceptual/Example.swift
================================================
/// EN: Facade Design Pattern
///
/// Intent: Provides a simplified interface to a library, a framework, or any
/// other complex set of classes.
///
/// RU: Паттерн Фасад
///
/// Назначение: Предоставляет простой интерфейс к сложной системе классов,
/// библиотеке или фреймворку.
import XCTest
/// EN: The Facade class provides a simple interface to the complex logic of one
/// or several subsystems. The Facade delegates the client requests to the
/// appropriate objects within the subsystem. The Facade is also responsible for
/// managing their lifecycle. All of this shields the client from the undesired
/// complexity of the subsystem.
///
/// RU: Класс Фасада предоставляет простой интерфейс для сложной логики одной
/// или нескольких подсистем. Фасад делегирует запросы клиентов соответствующим
/// объектам внутри подсистемы. Фасад также отвечает за управление их жизненным
/// циклом. Все это защищает клиента от нежелательной сложности подсистемы.
class Facade {
private var subsystem1: Subsystem1
private var subsystem2: Subsystem2
/// EN: Depending on your application's needs, you can provide the Facade
/// with existing subsystem objects or force the Facade to create them on
/// its own.
///
/// RU: В зависимости от потребностей вашего приложения вы можете
/// предоставить Фасаду существующие объекты подсистемы или заставить Фасад
/// создать их самостоятельно.
init(subsystem1: Subsystem1 = Subsystem1(),
subsystem2: Subsystem2 = Subsystem2()) {
self.subsystem1 = subsystem1
self.subsystem2 = subsystem2
}
/// EN: The Facade's methods are convenient shortcuts to the sophisticated
/// functionality of the subsystems. However, clients get only to a fraction
/// of a subsystem's capabilities.
///
/// RU: Методы Фасада удобны для быстрого доступа к сложной функциональности
/// подсистем. Однако клиенты получают только часть возможностей подсистемы.
func operation() -> String {
var result = "Facade initializes subsystems:"
result += " " + subsystem1.operation1()
result += " " + subsystem2.operation1()
result += "\n" + "Facade orders subsystems to perform the action:\n"
result += " " + subsystem1.operationN()
result += " " + subsystem2.operationZ()
return result
}
}
/// EN: The Subsystem can accept requests either from the facade or client
/// directly. In any case, to the Subsystem, the Facade is yet another client,
/// and it's not a part of the Subsystem.
///
/// RU: Подсистема может принимать запросы либо от фасада, либо от клиента
/// напрямую. В любом случае, для Подсистемы Фасад – это еще один клиент, и он
/// не является частью Подсистемы.
class Subsystem1 {
func operation1() -> String {
return "Subsystem1: Ready!\n"
}
// ...
func operationN() -> String {
return "Subsystem1: Go!\n"
}
}
/// EN: Some facades can work with multiple subsystems at the same time.
///
/// RU: Некоторые фасады могут работать с разными подсистемами одновременно.
class Subsystem2 {
func operation1() -> String {
return "Subsystem2: Get ready!\n"
}
// ...
func operationZ() -> String {
return "Subsystem2: Fire!\n"
}
}
/// EN: The client code works with complex subsystems through a simple interface
/// provided by the Facade. When a facade manages the lifecycle of the
/// subsystem, the client might not even know about the existence of the
/// subsystem. This approach lets you keep the complexity under control.
///
/// RU: Клиентский код работает со сложными подсистемами через простой
/// интерфейс, предоставляемый Фасадом. Когда фасад управляет жизненным циклом
/// подсистемы, клиент может даже не знать о существовании подсистемы. Такой
/// подход позволяет держать сложность под контролем.
class Client {
// ...
static func clientCode(facade: Facade) {
print(facade.operation())
}
// ...
}
/// EN: Let's see how it all works together.
///
/// RU: Давайте посмотрим как всё это будет работать.
class FacadeConceptual: XCTestCase {
func testFacadeConceptual() {
/// EN: The client code may have some of the subsystem's objects already
/// created. In this case, it might be worthwhile to initialize the
/// Facade with these objects instead of letting the Facade create new
/// instances.
///
/// RU: В клиентском коде могут быть уже созданы некоторые объекты
/// подсистемы. В этом случае может оказаться целесообразным
/// инициализировать Фасад с этими объектами вместо того, чтобы
/// позволить Фасаду создавать новые экземпляры.
let subsystem1 = Subsystem1()
let subsystem2 = Subsystem2()
let facade = Facade(subsystem1: subsystem1, subsystem2: subsystem2)
Client.clientCode(facade: facade)
}
}
================================================
FILE: Sources/Facade/Conceptual/Info.plist
================================================
CFBundleDevelopmentRegion
$(DEVELOPMENT_LANGUAGE)
CFBundleExecutable
$(EXECUTABLE_NAME)
CFBundleIdentifier
$(PRODUCT_BUNDLE_IDENTIFIER)
CFBundleInfoDictionaryVersion
6.0
CFBundleName
$(PRODUCT_NAME)
CFBundlePackageType
BNDL
CFBundleShortVersionString
1.0
CFBundleVersion
1
================================================
FILE: Sources/Facade/Conceptual/Output.txt
================================================
Facade initializes subsystems: Sybsystem1: Ready!
Sybsystem2: Get ready!
Facade orders subsystems to perform the action:
Sybsystem1: Go!
Sybsystem2: Fire!
================================================
FILE: Sources/Facade/RealWorld/Example.swift
================================================
import XCTest
/// Facade Design Pattern
///
/// Intent: Provides a simplified interface to a library, a framework, or any
/// other complex set of classes.
class FacadeRealWorld: XCTestCase {
/// In the real project, you probably will use third-party libraries. For
/// instance, to download images.
///
/// Therefore, facade and wrapping it is a good way to use a third-party API
/// in the client code. Even if it is your own library that is connected to
/// a project.
///
/// The benefits here are:
///
/// 1) If you need to change a current image downloader it should be done
/// only in the one place of a project. A number of lines of the client code
/// will stay work.
///
/// 2) The facade provides an access to a fraction of a functionality that
/// fits most client needs. Moreover, it can set frequently used or default
/// parameters.
func testFacadeRealWorld() {
let imageView = UIImageView()
print("Let's set an image for the image view")
clientCode(imageView)
print("Image has been set")
XCTAssert(imageView.image != nil)
}
fileprivate func clientCode(_ imageView: UIImageView) {
let url = URL(string: "www.example.com/logo")
imageView.downloadImage(at: url)
}
}
private extension UIImageView {
/// This extension plays a facade role.
func downloadImage(at url: URL?) {
print("Start downloading...")
let placeholder = UIImage(named: "placeholder")
ImageDownloader().loadImage(at: url,
placeholder: placeholder,
completion: { image, error in
print("Handle an image...")
/// Crop, cache, apply filters, whatever...
self.image = image
})
}
}
private class ImageDownloader {
/// Third-party library or your own solution (subsystem)
typealias Completion = (UIImage, Error?) -> ()
typealias Progress = (Int, Int) -> ()
func loadImage(at url: URL?,
placeholder: UIImage? = nil,
progress: Progress? = nil,
completion: Completion) {
/// ... Set up a network stack
/// ... Downloading an image
/// ...
completion(UIImage(), nil)
}
}
================================================
FILE: Sources/Facade/RealWorld/Info.plist
================================================
CFBundleDevelopmentRegion
$(DEVELOPMENT_LANGUAGE)
CFBundleExecutable
$(EXECUTABLE_NAME)
CFBundleIdentifier
$(PRODUCT_BUNDLE_IDENTIFIER)
CFBundleInfoDictionaryVersion
6.0
CFBundleName
$(PRODUCT_NAME)
CFBundlePackageType
BNDL
CFBundleShortVersionString
1.0
CFBundleVersion
1
================================================
FILE: Sources/Facade/RealWorld/Output.txt
================================================
Let's set an image for the image view
Start downloading...
Handle an image...
Image has been set
================================================
FILE: Sources/FactoryMethod/Conceptual/Example.swift
================================================
/// EN: Factory Method Design Pattern
///
/// Intent: Provides an interface for creating objects in a superclass, but
/// allows subclasses to alter the type of objects that will be created.
///
/// RU: Паттерн Фабричный Метод
///
/// Назначение: Определяет общий интерфейс для создания объектов в суперклассе,
/// позволяя подклассам изменять тип создаваемых объектов.
import XCTest
/// EN: The Creator protocol declares the factory method that's supposed to
/// return a new object of a Product class. The Creator's subclasses usually
/// provide the implementation of this method.
///
/// RU: Класс Создатель объявляет фабричный метод, который должен возвращать
/// объект класса Продукт. Подклассы Создателя обычно предоставляют реализацию
/// этого метода.
protocol Creator {
/// EN: Note that the Creator may also provide some default implementation
/// of the factory method.
///
/// RU: Обратите внимание, что Создатель может также обеспечить реализацию
/// фабричного метода по умолчанию.
func factoryMethod() -> Product
/// EN: Also note that, despite its name, the Creator's primary
/// responsibility is not creating products. Usually, it contains some core
/// business logic that relies on Product objects, returned by the factory
/// method. Subclasses can indirectly change that business logic by
/// overriding the factory method and returning a different type of product
/// from it.
///
/// RU: Также заметьте, что, несмотря на название, основная обязанность
/// Создателя не заключается в создании продуктов. Обычно он содержит
/// некоторую базовую бизнес-логику, которая основана на объектах Продуктов,
/// возвращаемых фабричным методом. Подклассы могут косвенно изменять эту
/// бизнес-логику, переопределяя фабричный метод и возвращая из него другой
/// тип продукта.
func someOperation() -> String
}
/// EN: This extension implements the default behavior of the Creator. This
/// behavior can be overridden in subclasses.
///
/// RU: Это расширение реализует базовое поведение Создателя. Оно может быть
/// переопределено в подклассах.
extension Creator {
func someOperation() -> String {
// EN: Call the factory method to create a Product object.
//
// RU: Вызываем фабричный метод, чтобы получить объект-продукт.
let product = factoryMethod()
// EN: Now, use the product.
//
// RU: Далее, работаем с этим продуктом.
return "Creator: The same creator's code has just worked with " + product.operation()
}
}
/// EN: Concrete Creators override the factory method in order to change the
/// resulting product's type.
///
/// RU: Конкретные Создатели переопределяют фабричный метод для того, чтобы
/// изменить тип результирующего продукта.
class ConcreteCreator1: Creator {
/// EN: Note that the signature of the method still uses the abstract
/// product type, even though the concrete product is actually returned from
/// the method. This way the Creator can stay independent of concrete
/// product classes.
///
/// RU: Обратите внимание, что сигнатура метода по-прежнему использует тип
/// абстрактного продукта, хотя фактически из метода возвращается конкретный
/// продукт. Таким образом, Создатель может оставаться независимым от
/// конкретных классов продуктов.
public func factoryMethod() -> Product {
return ConcreteProduct1()
}
}
class ConcreteCreator2: Creator {
public func factoryMethod() -> Product {
return ConcreteProduct2()
}
}
/// EN: The Product protocol declares the operations that all concrete products
/// must implement.
///
/// RU: Протокол Продукта объявляет операции, которые должны выполнять все
/// конкретные продукты.
protocol Product {
func operation() -> String
}
/// EN: Concrete Products provide various implementations of the Product
/// protocol.
///
/// RU: Конкретные Продукты предоставляют различные реализации протокола
/// Продукта.
class ConcreteProduct1: Product {
func operation() -> String {
return "{Result of the ConcreteProduct1}"
}
}
class ConcreteProduct2: Product {
func operation() -> String {
return "{Result of the ConcreteProduct2}"
}
}
/// EN: The client code works with an instance of a concrete creator, albeit
/// through its base protocol. As long as the client keeps working with the
/// creator via the base protocol, you can pass it any creator's subclass.
///
/// RU: Клиентский код работает с экземпляром конкретного создателя, хотя и
/// через его базовый протокол. Пока клиент продолжает работать с создателем
/// через базовый протокол, вы можете передать ему любой подкласс создателя.
class Client {
// ...
static func someClientCode(creator: Creator) {
print("Client: I'm not aware of the creator's class, but it still works.\n"
+ creator.someOperation())
}
// ...
}
/// EN: Let's see how it all works together.
///
/// RU: Давайте посмотрим как всё это будет работать.
class FactoryMethodConceptual: XCTestCase {
func testFactoryMethodConceptual() {
/// EN: The Application picks a creator's type depending on the
/// configuration or environment.
///
/// RU: Приложение выбирает тип создателя в зависимости от конфигурации
/// или среды.
print("App: Launched with the ConcreteCreator1.")
Client.someClientCode(creator: ConcreteCreator1())
print("\nApp: Launched with the ConcreteCreator2.")
Client.someClientCode(creator: ConcreteCreator2())
}
}
================================================
FILE: Sources/FactoryMethod/Conceptual/Info.plist
================================================
CFBundleDevelopmentRegion
$(DEVELOPMENT_LANGUAGE)
CFBundleExecutable
$(EXECUTABLE_NAME)
CFBundleIdentifier
$(PRODUCT_BUNDLE_IDENTIFIER)
CFBundleInfoDictionaryVersion
6.0
CFBundleName
$(PRODUCT_NAME)
CFBundlePackageType
BNDL
CFBundleShortVersionString
1.0
CFBundleVersion
1
================================================
FILE: Sources/FactoryMethod/Conceptual/Output.txt
================================================
App: Launched with the ConcreteCreator1.
Client: I'm not aware of the creator's class, but it still works.
Creator: The same creator's code has just worked with {Result of the ConcreteProduct1}
App: Launched with the ConcreteCreator2.
Client: I'm not aware of the creator's class, but it still works.
Creator: The same creator's code has just worked with {Result of the ConcreteProduct2}
================================================
FILE: Sources/FactoryMethod/RealWorld/Example.swift
================================================
import XCTest
class FactoryMethodRealWorld: XCTestCase {
func testFactoryMethodRealWorld() {
let info = "Very important info of the presentation"
let clientCode = ClientCode()
/// Present info over WiFi
clientCode.present(info: info, with: WifiFactory())
/// Present info over Bluetooth
clientCode.present(info: info, with: BluetoothFactory())
}
}
protocol ProjectorFactory {
func createProjector() -> Projector
func syncedProjector(with projector: Projector) -> Projector
}
extension ProjectorFactory {
/// Base implementation of ProjectorFactory
func syncedProjector(with projector: Projector) -> Projector {
/// Every instance creates an own projector
let newProjector = createProjector()
/// sync projectors
newProjector.sync(with: projector)
return newProjector
}
}
class WifiFactory: ProjectorFactory {
func createProjector() -> Projector {
return WifiProjector()
}
}
class BluetoothFactory: ProjectorFactory {
func createProjector() -> Projector {
return BluetoothProjector()
}
}
protocol Projector {
/// Abstract projector interface
var currentPage: Int { get }
func present(info: String)
func sync(with projector: Projector)
func update(with page: Int)
}
extension Projector {
/// Base implementation of Projector methods
func sync(with projector: Projector) {
projector.update(with: currentPage)
}
}
class WifiProjector: Projector {
var currentPage = 0
func present(info: String) {
print("Info is presented over Wifi: \(info)")
}
func update(with page: Int) {
/// ... scroll page via WiFi connection
/// ...
currentPage = page
}
}
class BluetoothProjector: Projector {
var currentPage = 0
func present(info: String) {
print("Info is presented over Bluetooth: \(info)")
}
func update(with page: Int) {
/// ... scroll page via Bluetooth connection
/// ...
currentPage = page
}
}
private class ClientCode {
private var currentProjector: Projector?
func present(info: String, with factory: ProjectorFactory) {
/// Check whether the client code is already presenting something...
guard let projector = currentProjector else {
/// 'currentProjector' variable is nil. Create a new projector and
/// start presentation.
let projector = factory.createProjector()
projector.present(info: info)
self.currentProjector = projector
return
}
/// Client code already has a projector. Let's sync pages of the old
/// projector with a new one.
self.currentProjector = factory.syncedProjector(with: projector)
self.currentProjector?.present(info: info)
}
}
================================================
FILE: Sources/FactoryMethod/RealWorld/Info.plist
================================================
CFBundleDevelopmentRegion
$(DEVELOPMENT_LANGUAGE)
CFBundleExecutable
$(EXECUTABLE_NAME)
CFBundleIdentifier
$(PRODUCT_BUNDLE_IDENTIFIER)
CFBundleInfoDictionaryVersion
6.0
CFBundleName
$(PRODUCT_NAME)
CFBundlePackageType
BNDL
CFBundleShortVersionString
1.0
CFBundleVersion
1
================================================
FILE: Sources/FactoryMethod/RealWorld/Output.txt
================================================
Info is presented over Wifi: Very important info of the presentation
Info is presented over Bluetooth: Very important info of the presentation
================================================
FILE: Sources/Flyweight/Conceptual/Example.swift
================================================
/// EN: Flyweight Design Pattern
///
/// Intent: Lets you fit more objects into the available amount of RAM by
/// sharing common parts of state between multiple objects, instead of keeping
/// all of the data in each object.
///
/// RU: Паттерн Легковес
///
/// Назначение: Позволяет вместить бóльшее количество объектов в отведённую
/// оперативную память. Легковес экономит память, разделяя общее состояние
/// объектов между собой, вместо хранения одинаковых данных в каждом объекте.
import XCTest
/// EN: The Flyweight stores a common portion of the state (also called
/// intrinsic state) that belongs to multiple real business entities. The
/// Flyweight accepts the rest of the state (extrinsic state, unique for each
/// entity) via its method parameters.
///
/// RU: Легковес хранит общую часть состояния (также называемую внутренним
/// состоянием), которая принадлежит нескольким реальным бизнес-объектам.
/// Легковес принимает оставшуюся часть состояния (внешнее состояние,
/// уникальное для каждого объекта) через его параметры метода.
class Flyweight {
private let sharedState: [String]
init(sharedState: [String]) {
self.sharedState = sharedState
}
func operation(uniqueState: [String]) {
print("Flyweight: Displaying shared (\(sharedState)) and unique (\(uniqueState)) state.\n")
}
}
/// EN: The Flyweight Factory creates and manages the Flyweight objects. It
/// ensures that flyweights are shared correctly. When the client requests a
/// flyweight, the factory either returns an existing instance or creates a new
/// one, if it doesn't exist yet.
///
/// RU: Фабрика Легковесов создает объекты-Легковесы и управляет ими. Она
/// обеспечивает правильное разделение легковесов. Когда клиент запрашивает
/// легковес, фабрика либо возвращает существующий экземпляр, либо создает
/// новый, если он ещё не существует.
class FlyweightFactory {
private var flyweights: [String: Flyweight]
init(states: [[String]]) {
var flyweights = [String: Flyweight]()
for state in states {
flyweights[state.key] = Flyweight(sharedState: state)
}
self.flyweights = flyweights
}
/// EN: Returns an existing Flyweight with a given state or creates a new
/// one.
///
/// RU: Возвращает существующий Легковес с заданным состоянием или создает
/// новый.
func flyweight(for state: [String]) -> Flyweight {
let key = state.key
guard let foundFlyweight = flyweights[key] else {
print("FlyweightFactory: Can't find a flyweight, creating new one.\n")
let flyweight = Flyweight(sharedState: state)
flyweights.updateValue(flyweight, forKey: key)
return flyweight
}
print("FlyweightFactory: Reusing existing flyweight.\n")
return foundFlyweight
}
func printFlyweights() {
print("FlyweightFactory: I have \(flyweights.count) flyweights:\n")
for item in flyweights {
print(item.key)
}
}
}
extension Array where Element == String {
/// EN: Returns a Flyweight's string hash for a given state.
///
/// RU: Возвращает хеш строки Легковеса для данного состояния.
var key: String {
return self.joined()
}
}
class FlyweightConceptual: XCTestCase {
func testFlyweight() {
/// EN: The client code usually creates a bunch of pre-populated
/// flyweights in the initialization stage of the application.
///
/// RU: Клиентский код обычно создает кучу предварительно заполненных
/// легковесов на этапе инициализации приложения.
let factory = FlyweightFactory(states:
[
["Chevrolet", "Camaro2018", "pink"],
["Mercedes Benz", "C300", "black"],
["Mercedes Benz", "C500", "red"],
["BMW", "M5", "red"],
["BMW", "X6", "white"]
])
factory.printFlyweights()
/// ...
addCarToPoliceDatabase(factory,
"CL234IR",
"James Doe",
"BMW",
"M5",
"red")
addCarToPoliceDatabase(factory,
"CL234IR",
"James Doe",
"BMW",
"X1",
"red")
factory.printFlyweights()
}
func addCarToPoliceDatabase(
_ factory: FlyweightFactory,
_ plates: String,
_ owner: String,
_ brand: String,
_ model: String,
_ color: String) {
print("Client: Adding a car to database.\n")
let flyweight = factory.flyweight(for: [brand, model, color])
/// EN: The client code either stores or calculates extrinsic state and
/// passes it to the flyweight's methods.
///
/// RU: Клиентский код либо сохраняет, либо вычисляет внешнее состояние
/// и передает его методам легковеса.
flyweight.operation(uniqueState: [plates, owner])
}
}
================================================
FILE: Sources/Flyweight/Conceptual/Info.plist
================================================
CFBundleDevelopmentRegion
$(DEVELOPMENT_LANGUAGE)
CFBundleExecutable
$(EXECUTABLE_NAME)
CFBundleIdentifier
$(PRODUCT_BUNDLE_IDENTIFIER)
CFBundleInfoDictionaryVersion
6.0
CFBundleName
$(PRODUCT_NAME)
CFBundlePackageType
BNDL
CFBundleShortVersionString
1.0
CFBundleVersion
1
================================================
FILE: Sources/Flyweight/Conceptual/Output.txt
================================================
FlyweightFactory: I have 5 flyweights:
Mercedes BenzC500red
ChevroletCamaro2018pink
Mercedes BenzC300black
BMWX6white
BMWM5red
Client: Adding a car to database.
FlyweightFactory: Reusing existing flyweight.
Flyweight: Displaying shared (["BMW", "M5", "red"]) and unique (["CL234IR", "James Doe"] state.
Client: Adding a car to database.
FlyweightFactory: Can't find a flyweight, creating new one.
Flyweight: Displaying shared (["BMW", "X1", "red"]) and unique (["CL234IR", "James Doe"] state.
FlyweightFactory: I have 6 flyweights:
Mercedes BenzC500red
BMWX1red
ChevroletCamaro2018pink
Mercedes BenzC300black
BMWX6white
BMWM5red
================================================
FILE: Sources/Flyweight/RealWorld/Example.swift
================================================
import XCTest
import UIKit
class FlyweightRealWorld: XCTestCase {
func testFlyweightRealWorld() {
let maineCoon = Animal(name: "Maine Coon",
country: "USA",
type: .cat)
let sphynx = Animal(name: "Sphynx",
country: "Egypt",
type: .cat)
let bulldog = Animal(name: "Bulldog",
country: "England",
type: .dog)
print("Client: I created a number of objects to display")
/// Displaying objects for the 1-st time.
print("Client: Let's show animals for the 1st time\n")
display(animals: [maineCoon, sphynx, bulldog])
/// Displaying objects for the 2-nd time.
///
/// Note: The cached appearance object will be reused this time.
print("\nClient: I have a new dog, let's show it the same way!\n")
let germanShepherd = Animal(name: "German Shepherd",
country: "Germany",
type: .dog)
display(animals: [germanShepherd])
}
}
extension FlyweightRealWorld {
func display(animals: [Animal]) {
let cells = loadCells(count: animals.count)
for index in 0.. [Cell] {
/// Emulates behavior of a table/collection view.
return Array(repeating: Cell(), count: count)
}
}
enum Type: String {
case cat
case dog
}
class Cell {
private var animal: Animal?
func update(with animal: Animal) {
self.animal = animal
let type = animal.type.rawValue
let photos = "photos \(animal.appearance.photos.count)"
print("Cell: Updating an appearance of a \(type)-cell: \(photos)\n")
}
}
struct Animal: Equatable {
/// This is an external context that contains specific values and an object
/// with a common state.
///
/// Note: The object of appearance will be lazily created when it is needed
let name: String
let country: String
let type: Type
var appearance: Appearance {
return AppearanceFactory.appearance(for: type)
}
}
struct Appearance: Equatable {
/// This object contains the predefined appearance for each cell.
let photos: [UIImage]
let backgroundColor: UIColor
}
extension Animal: CustomStringConvertible {
var description: String {
return "\(name), \(country), \(type.rawValue) + \(appearance.description)"
}
}
extension Appearance: CustomStringConvertible {
var description: String {
return "photos: \(photos.count), \(backgroundColor)"
}
}
class AppearanceFactory {
private static var cache = [Type: Appearance]()
static func appearance(for key: Type) -> Appearance {
guard cache[key] == nil else {
print("AppearanceFactory: Reusing an existing \(key.rawValue)-appearance.")
return cache[key]!
}
print("AppearanceFactory: Can't find a cached \(key.rawValue)-object, creating a new one.")
switch key {
case .cat:
cache[key] = catInfo
case .dog:
cache[key] = dogInfo
}
return cache[key]!
}
}
extension AppearanceFactory {
private static var catInfo: Appearance {
return Appearance(photos: [UIImage()], backgroundColor: .red)
}
private static var dogInfo: Appearance {
return Appearance(photos: [UIImage(), UIImage()], backgroundColor: .blue)
}
}
================================================
FILE: Sources/Flyweight/RealWorld/Info.plist
================================================
CFBundleDevelopmentRegion
$(DEVELOPMENT_LANGUAGE)
CFBundleExecutable
$(EXECUTABLE_NAME)
CFBundleIdentifier
$(PRODUCT_BUNDLE_IDENTIFIER)
CFBundleInfoDictionaryVersion
6.0
CFBundleName
$(PRODUCT_NAME)
CFBundlePackageType
BNDL
CFBundleShortVersionString
1.0
CFBundleVersion
1
================================================
FILE: Sources/Flyweight/RealWorld/Output.txt
================================================
Client: I created a number of objects to display
Client: Let's show animals for the 1st time
AppearanceFactory: Can't find a cached cat-object, creating a new one.
Cell: Updating an appearance of a cat-cell: photos 1
AppearanceFactory: Reusing an existing cat-appearance.
Cell: Updating an appearance of a cat-cell: photos 1
AppearanceFactory: Can't find a cached dog-object, creating a new one.
Cell: Updating an appearance of a dog-cell: photos 2
Client: I have a new dog, let's show it the same way!
AppearanceFactory: Reusing an existing dog-appearance.
Cell: Updating an appearance of a dog-cell: photos 2
================================================
FILE: Sources/Iterator/Conceptual/Example.swift
================================================
/// EN: Iterator Design Pattern
///
/// Intent: Lets you traverse elements of a collection without exposing its
/// underlying representation (list, stack, tree, etc.).
///
/// Swift language has a built-in iterator support:
///
/// - The `IteratorProtocol` provides a simple iterator protocol:
/// https://developer.apple.com/documentation/swift/iteratorprotocol
///
/// - The `AnyIterator` struct provides basic iterator implementation:
/// https://developer.apple.com/documentation/swift/anyiterator
///
/// In this example, we'll see how to use both of these mechanisms.
///
/// RU: Паттерн Итератор
///
/// Назначение: Даёт возможность последовательно обходить элементы составных
/// объектов, не раскрывая их внутреннего представления.
///
/// Язык Swift имеет встроенную поддержку итераторов:
///
/// - Протокол `IteratorProtocol` описывает базовый интерфейс итератора:
/// https://developer.apple.com/documentation/swift/iteratorprotocol
///
/// - Структура `AnyIterator` предоставляет простую реализацию
/// итератора по-умолчанию:
/// https://developer.apple.com/documentation/swift/anyiterator
///
/// В этом примере мы увидим как работают оба этих механизма.
import XCTest
/// EN: This is a collection that we're going to iterate through using an
/// iterator that conforms to IteratorProtocol.
///
/// RU: Это коллекция, которую мы будем перебирать используя итератор,
/// реализующий IteratorProtocol.
class WordsCollection {
fileprivate lazy var items = [String]()
func append(_ item: String) {
self.items.append(item)
}
}
extension WordsCollection: Sequence {
func makeIterator() -> WordsIterator {
return WordsIterator(self)
}
}
/// EN: Concrete Iterators implement various traversal algorithms. These classes
/// store the current traversal position at all times.
///
/// RU: Конкретные Итераторы реализуют различные алгоритмы обхода. Эти классы
/// постоянно хранят текущее положение обхода.
class WordsIterator: IteratorProtocol {
private let collection: WordsCollection
private var index = 0
init(_ collection: WordsCollection) {
self.collection = collection
}
func next() -> String? {
defer { index += 1 }
return index < collection.items.count ? collection.items[index] : nil
}
}
/// EN: This is another collection that we'll provide AnyIterator for traversing
/// its items.
///
/// RU: Это другая коллекция, которая будет возвращать AnyIterator, способный
/// перебирать её элементы.
class NumbersCollection {
fileprivate lazy var items = [Int]()
func append(_ item: Int) {
self.items.append(item)
}
}
extension NumbersCollection: Sequence {
func makeIterator() -> AnyIterator {
var index = self.items.count - 1
return AnyIterator {
defer { index -= 1 }
return index >= 0 ? self.items[index] : nil
}
}
}
/// EN: Client does not know the internal representation of a given sequence.
///
/// RU: Клиент не знает о внутреннем представлении данной последовательности.
class Client {
// ...
static func clientCode(sequence: S) {
for item in sequence {
print(item)
}
}
// ...
}
/// EN: Let's see how it all works together.
///
/// RU: Давайте посмотрим как всё это будет работать.
class IteratorConceptual: XCTestCase {
func testIteratorProtocol() {
let words = WordsCollection()
words.append("First")
words.append("Second")
words.append("Third")
print("Straight traversal using IteratorProtocol:")
Client.clientCode(sequence: words)
}
func testAnyIterator() {
let numbers = NumbersCollection()
numbers.append(1)
numbers.append(2)
numbers.append(3)
print("\nReverse traversal using AnyIterator:")
Client.clientCode(sequence: numbers)
}
}
================================================
FILE: Sources/Iterator/Conceptual/Info.plist
================================================
CFBundleDevelopmentRegion
$(DEVELOPMENT_LANGUAGE)
CFBundleExecutable
$(EXECUTABLE_NAME)
CFBundleIdentifier
$(PRODUCT_BUNDLE_IDENTIFIER)
CFBundleInfoDictionaryVersion
6.0
CFBundleName
$(PRODUCT_NAME)
CFBundlePackageType
BNDL
CFBundleShortVersionString
1.0
CFBundleVersion
1
================================================
FILE: Sources/Iterator/Conceptual/Output.txt
================================================
Straight traversal using IteratorProtocol:
First
Second
Third
Reverse traversal using AnyIterator:
3
2
1
================================================
FILE: Sources/Iterator/RealWorld/Example.swift
================================================
import XCTest
class IteratorRealWorld: XCTestCase {
func test() {
let tree = Tree(1)
tree.left = Tree(2)
tree.right = Tree(3)
print("Tree traversal: Inorder")
clientCode(iterator: tree.iterator(.inOrder))
print("\nTree traversal: Preorder")
clientCode(iterator: tree.iterator(.preOrder))
print("\nTree traversal: Postorder")
clientCode(iterator: tree.iterator(.postOrder))
}
func clientCode(iterator: AnyIterator) {
while case let item? = iterator.next() {
print(item)
}
}
}
class Tree {
var value: T
var left: Tree?
var right: Tree?
init(_ value: T) {
self.value = value
}
typealias Block = (T) -> ()
enum IterationType {
case inOrder
case preOrder
case postOrder
}
func iterator(_ type: IterationType) -> AnyIterator {
var items = [T]()
switch type {
case .inOrder:
inOrder { items.append($0) }
case .preOrder:
preOrder { items.append($0) }
case .postOrder:
postOrder { items.append($0) }
}
/// Note:
/// AnyIterator is used to hide the type signature of an internal
/// iterator.
return AnyIterator(items.makeIterator())
}
private func inOrder(_ body: Block) {
left?.inOrder(body)
body(value)
right?.inOrder(body)
}
private func preOrder(_ body: Block) {
body(value)
left?.preOrder(body)
right?.preOrder(body)
}
private func postOrder(_ body: Block) {
left?.postOrder(body)
right?.postOrder(body)
body(value)
}
}
================================================
FILE: Sources/Iterator/RealWorld/Info.plist
================================================
CFBundleDevelopmentRegion
$(DEVELOPMENT_LANGUAGE)
CFBundleExecutable
$(EXECUTABLE_NAME)
CFBundleIdentifier
$(PRODUCT_BUNDLE_IDENTIFIER)
CFBundleInfoDictionaryVersion
6.0
CFBundleName
$(PRODUCT_NAME)
CFBundlePackageType
BNDL
CFBundleShortVersionString
1.0
CFBundleVersion
1
================================================
FILE: Sources/Iterator/RealWorld/Output.txt
================================================
Tree traversal: Inorder
2
1
3
Tree traversal: Preorder
1
2
3
Tree traversal: Postorder
2
3
1
================================================
FILE: Sources/Mediator/Conceptual/Example.swift
================================================
/// EN: Mediator Design Pattern
///
/// Intent: Lets you reduce chaotic dependencies between objects. The pattern
/// restricts direct communications between the objects and forces them to
/// collaborate only via a mediator object.
///
/// RU: Паттерн Посредник
///
/// Назначение: Позволяет уменьшить связанность множества классов между собой,
/// благодаря перемещению этих связей в один класс-посредник.
import XCTest
/// EN: The Mediator interface declares a method used by components to notify
/// the mediator about various events. The Mediator may react to these events
/// and pass the execution to other components.
///
/// RU: Интерфейс Посредника предоставляет метод, используемый компонентами для
/// уведомления посредника о различных событиях. Посредник может реагировать на
/// эти события и передавать исполнение другим компонентам.
protocol Mediator: AnyObject {
func notify(sender: BaseComponent, event: String)
}
/// EN: Concrete Mediators implement cooperative behavior by coordinating
/// several components.
///
/// RU: Конкретные Посредники реализуют совместное поведение, координируя
/// отдельные компоненты.
class ConcreteMediator: Mediator {
private var component1: Component1
private var component2: Component2
init(_ component1: Component1, _ component2: Component2) {
self.component1 = component1
self.component2 = component2
component1.update(mediator: self)
component2.update(mediator: self)
}
func notify(sender: BaseComponent, event: String) {
if event == "A" {
print("Mediator reacts on A and triggers following operations:")
self.component2.doC()
}
else if (event == "D") {
print("Mediator reacts on D and triggers following operations:")
self.component1.doB()
self.component2.doC()
}
}
}
/// EN: The Base Component provides the basic functionality of storing a
/// mediator's instance inside component objects.
///
/// RU: Базовый Компонент обеспечивает базовую функциональность хранения
/// экземпляра посредника внутри объектов компонентов.
class BaseComponent {
fileprivate weak var mediator: Mediator?
init(mediator: Mediator? = nil) {
self.mediator = mediator
}
func update(mediator: Mediator) {
self.mediator = mediator
}
}
/// EN: Concrete Components implement various functionality. They don't depend
/// on other components. They also don't depend on any concrete mediator
/// classes.
///
/// RU: Конкретные Компоненты реализуют различную функциональность. Они не
/// зависят от других компонентов. Они также не зависят от каких-либо конкретных
/// классов посредников.
class Component1: BaseComponent {
func doA() {
print("Component 1 does A.")
mediator?.notify(sender: self, event: "A")
}
func doB() {
print("Component 1 does B.\n")
mediator?.notify(sender: self, event: "B")
}
}
class Component2: BaseComponent {
func doC() {
print("Component 2 does C.")
mediator?.notify(sender: self, event: "C")
}
func doD() {
print("Component 2 does D.")
mediator?.notify(sender: self, event: "D")
}
}
/// EN: Let's see how it all works together.
///
/// RU: Давайте посмотрим как всё это будет работать.
class MediatorConceptual: XCTestCase {
func testMediatorConceptual() {
let component1 = Component1()
let component2 = Component2()
let mediator = ConcreteMediator(component1, component2)
print("Client triggers operation A.")
component1.doA()
print("\nClient triggers operation D.")
component2.doD()
print(mediator)
}
}
================================================
FILE: Sources/Mediator/Conceptual/Info.plist
================================================
CFBundleDevelopmentRegion
$(DEVELOPMENT_LANGUAGE)
CFBundleExecutable
$(EXECUTABLE_NAME)
CFBundleIdentifier
$(PRODUCT_BUNDLE_IDENTIFIER)
CFBundleInfoDictionaryVersion
6.0
CFBundleName
$(PRODUCT_NAME)
CFBundlePackageType
BNDL
CFBundleShortVersionString
1.0
CFBundleVersion
1
================================================
FILE: Sources/Mediator/Conceptual/Output.txt
================================================
Client triggers operation A.
Component 1 does A.
Mediator reacts on A and triggers following operations:
Component 2 does C.
Client triggers operation D.
Component 2 does D.
Mediator reacts on D and triggers following operations:
Component 1 does B.
Component 2 does C.
================================================
FILE: Sources/Mediator/RealWorld/Example.swift
================================================
import XCTest
class MediatorRealWorld: XCTestCase {
func test() {
let newsArray = [News(id: 1, title: "News1", likesCount: 1),
News(id: 2, title: "News2", likesCount: 2)]
let numberOfGivenLikes = newsArray.reduce(0, { $0 + $1.likesCount })
let mediator = ScreenMediator()
let feedVC = NewsFeedViewController(mediator, newsArray)
let newsDetailVC = NewsDetailViewController(mediator, newsArray.first!)
let profileVC = ProfileViewController(mediator, numberOfGivenLikes)
mediator.update([feedVC, newsDetailVC, profileVC])
feedVC.userLikedAllNews()
feedVC.userDislikedAllNews()
}
}
class NewsFeedViewController: ScreenUpdatable {
private var newsArray: [News]
private weak var mediator: ScreenUpdatable?
init(_ mediator: ScreenUpdatable?, _ newsArray: [News]) {
self.newsArray = newsArray
self.mediator = mediator
}
func likeAdded(to news: News) {
print("News Feed: Received a liked news model with id \(news.id)")
for var item in newsArray {
if item == news {
item.likesCount += 1
}
}
}
func likeRemoved(from news: News) {
print("News Feed: Received a disliked news model with id \(news.id)")
for var item in newsArray {
if item == news {
item.likesCount -= 1
}
}
}
func userLikedAllNews() {
print("\n\nNews Feed: User LIKED all news models")
print("News Feed: I am telling to mediator about it...\n")
newsArray.forEach({ mediator?.likeAdded(to: $0) })
}
func userDislikedAllNews() {
print("\n\nNews Feed: User DISLIKED all news models")
print("News Feed: I am telling to mediator about it...\n")
newsArray.forEach({ mediator?.likeRemoved(from: $0) })
}
}
class NewsDetailViewController: ScreenUpdatable {
private var news: News
private weak var mediator: ScreenUpdatable?
init(_ mediator: ScreenUpdatable?, _ news: News) {
self.news = news
self.mediator = mediator
}
func likeAdded(to news: News) {
print("News Detail: Received a liked news model with id \(news.id)")
if self.news == news {
self.news.likesCount += 1
}
}
func likeRemoved(from news: News) {
print("News Detail: Received a disliked news model with id \(news.id)")
if self.news == news {
self.news.likesCount -= 1
}
}
}
class ProfileViewController: ScreenUpdatable {
private var numberOfGivenLikes: Int
private weak var mediator: ScreenUpdatable?
init(_ mediator: ScreenUpdatable?, _ numberOfGivenLikes: Int) {
self.numberOfGivenLikes = numberOfGivenLikes
self.mediator = mediator
}
func likeAdded(to news: News) {
print("Profile: Received a liked news model with id \(news.id)")
numberOfGivenLikes += 1
}
func likeRemoved(from news: News) {
print("Profile: Received a disliked news model with id \(news.id)")
numberOfGivenLikes -= 1
}
}
protocol ScreenUpdatable: class {
func likeAdded(to news: News)
func likeRemoved(from news: News)
}
class ScreenMediator: ScreenUpdatable {
private var screens: [ScreenUpdatable]?
func update(_ screens: [ScreenUpdatable]) {
self.screens = screens
}
func likeAdded(to news: News) {
print("Screen Mediator: Received a liked news model with id \(news.id)")
screens?.forEach({ $0.likeAdded(to: news) })
}
func likeRemoved(from news: News) {
print("ScreenMediator: Received a disliked news model with id \(news.id)")
screens?.forEach({ $0.likeRemoved(from: news) })
}
}
struct News: Equatable {
let id: Int
let title: String
var likesCount: Int
/// Other properties
static func == (left: News, right: News) -> Bool {
return left.id == right.id
}
}
================================================
FILE: Sources/Mediator/RealWorld/Info.plist
================================================
CFBundleDevelopmentRegion
$(DEVELOPMENT_LANGUAGE)
CFBundleExecutable
$(EXECUTABLE_NAME)
CFBundleIdentifier
$(PRODUCT_BUNDLE_IDENTIFIER)
CFBundleInfoDictionaryVersion
6.0
CFBundleName
$(PRODUCT_NAME)
CFBundlePackageType
BNDL
CFBundleShortVersionString
1.0
CFBundleVersion
1
================================================
FILE: Sources/Mediator/RealWorld/Output.txt
================================================
News Feed: User LIKED all news models
News Feed: I am telling to mediator about it...
Screen Mediator: Received a liked news model with id 1
News Feed: Received a liked news model with id 1
News Detail: Received a liked news model with id 1
Profile: Received a liked news model with id 1
Screen Mediator: Received a liked news model with id 2
News Feed: Received a liked news model with id 2
News Detail: Received a liked news model with id 2
Profile: Received a liked news model with id 2
News Feed: User DISLIKED all news models
News Feed: I am telling to mediator about it...
ScreenMediator: Received a disliked news model with id 1
News Feed: Received a disliked news model with id 1
News Detail: Received a disliked news model with id 1
Profile: Received a disliked news model with id 1
ScreenMediator: Received a disliked news model with id 2
News Feed: Received a disliked news model with id 2
News Detail: Received a disliked news model with id 2
Profile: Received a disliked news model with id 2
================================================
FILE: Sources/Memento/Conceptual/Example.swift
================================================
/// EN: Memento Design Pattern
///
/// Intent: Lets you save and restore the previous state of an object without
/// revealing the details of its implementation.
///
/// RU: Паттерн Снимок
///
/// Назначение: Фиксирует и восстанавливает внутреннее состояние объекта таким
/// образом, чтобы в дальнейшем объект можно было восстановить в этом состоянии
/// без нарушения инкапсуляции.
import XCTest
/// EN: The Originator holds some important state that may change over time. It
/// also defines a method for saving the state inside a memento and another
/// method for restoring the state from it.
///
/// RU: Создатель содержит некоторое важное состояние, которое может со временем
/// меняться. Он также объявляет метод сохранения состояния внутри снимка и
/// метод восстановления состояния из него.
class Originator {
/// EN: For the sake of simplicity, the originator's state is stored inside
/// a single variable.
///
/// RU: Для удобства состояние создателя хранится внутри одной переменной.
private var state: String
init(state: String) {
self.state = state
print("Originator: My initial state is: \(state)")
}
/// EN: The Originator's business logic may affect its internal state.
/// Therefore, the client should backup the state before launching methods
/// of the business logic via the save() method.
///
/// RU: Бизнес-логика Создателя может повлиять на его внутреннее состояние.
/// Поэтому клиент должен выполнить резервное копирование состояния с
/// помощью метода save перед запуском методов бизнес-логики.
func doSomething() {
print("Originator: I'm doing something important.")
state = generateRandomString()
print("Originator: and my state has changed to: \(state)")
}
private func generateRandomString() -> String {
return String(UUID().uuidString.suffix(4))
}
/// EN: Saves the current state inside a memento.
///
/// RU: Сохраняет текущее состояние внутри снимка.
func save() -> Memento {
return ConcreteMemento(state: state)
}
/// EN: Restores the Originator's state from a memento object.
///
/// RU: Восстанавливает состояние Создателя из объекта снимка.
func restore(memento: Memento) {
guard let memento = memento as? ConcreteMemento else { return }
self.state = memento.state
print("Originator: My state has changed to: \(state)")
}
}
/// EN: The Memento interface provides a way to retrieve the memento's metadata,
/// such as creation date or name. However, it doesn't expose the Originator's
/// state.
///
/// RU: Интерфейс Снимка предоставляет способ извлечения метаданных снимка,
/// таких как дата создания или название. Однако он не раскрывает состояние
/// Создателя.
protocol Memento {
var name: String { get }
var date: Date { get }
}
/// EN: The Concrete Memento contains the infrastructure for storing the
/// Originator's state.
///
/// RU: Конкретный снимок содержит инфраструктуру для хранения состояния
/// Создателя.
class ConcreteMemento: Memento {
/// EN: The Originator uses this method when restoring its state.
///
/// RU: Создатель использует этот метод, когда восстанавливает своё
/// состояние.
private(set) var state: String
private(set) var date: Date
init(state: String) {
self.state = state
self.date = Date()
}
/// EN: The rest of the methods are used by the Caretaker to display
/// metadata.
///
/// RU: Остальные методы используются Опекуном для отображения метаданных.
var name: String { return state + " " + date.description.suffix(14).prefix(8) }
}
/// EN: The Caretaker doesn't depend on the Concrete Memento class. Therefore,
/// it doesn't have access to the originator's state, stored inside the memento.
/// It works with all mementos via the base Memento interface.
///
/// RU: Опекун не зависит от класса Конкретного Снимка. Таким образом, он не
/// имеет доступа к состоянию создателя, хранящемуся внутри снимка. Он работает
/// со всеми снимками через базовый интерфейс Снимка.
class Caretaker {
private lazy var mementos = [Memento]()
private var originator: Originator
init(originator: Originator) {
self.originator = originator
}
func backup() {
print("\nCaretaker: Saving Originator's state...\n")
mementos.append(originator.save())
}
func undo() {
guard !mementos.isEmpty else { return }
let removedMemento = mementos.removeLast()
print("Caretaker: Restoring state to: " + removedMemento.name)
originator.restore(memento: removedMemento)
}
func showHistory() {
print("Caretaker: Here's the list of mementos:\n")
mementos.forEach({ print($0.name) })
}
}
/// EN: Let's see how it all works together.
///
/// RU: Давайте посмотрим как всё это будет работать.
class MementoConceptual: XCTestCase {
func testMementoConceptual() {
let originator = Originator(state: "Super-duper-super-puper-super.")
let caretaker = Caretaker(originator: originator)
caretaker.backup()
originator.doSomething()
caretaker.backup()
originator.doSomething()
caretaker.backup()
originator.doSomething()
print("\n")
caretaker.showHistory()
print("\nClient: Now, let's rollback!\n\n")
caretaker.undo()
print("\nClient: Once more!\n\n")
caretaker.undo()
}
}
================================================
FILE: Sources/Memento/Conceptual/Info.plist
================================================
CFBundleDevelopmentRegion
$(DEVELOPMENT_LANGUAGE)
CFBundleExecutable
$(EXECUTABLE_NAME)
CFBundleIdentifier
$(PRODUCT_BUNDLE_IDENTIFIER)
CFBundleInfoDictionaryVersion
6.0
CFBundleName
$(PRODUCT_NAME)
CFBundlePackageType
BNDL
CFBundleShortVersionString
1.0
CFBundleVersion
1
================================================
FILE: Sources/Memento/Conceptual/Output.txt
================================================
Originator: My initial state is: Super-duper-super-puper-super.
Caretaker: Saving Originator's state...
Originator: I'm doing something important.
Originator: and my state has changed to: 1923
Caretaker: Saving Originator's state...
Originator: I'm doing something important.
Originator: and my state has changed to: 74FB
Caretaker: Saving Originator's state...
Originator: I'm doing something important.
Originator: and my state has changed to: 3681
Caretaker: Here's the list of mementos:
Super-duper-super-puper-super. 11:45:44
1923 11:45:44
74FB 11:45:44
Client: Now, let's rollback!
Caretaker: Restoring state to: 74FB 11:45:44
Originator: My state has changed to: 74FB
Client: Once more!
Caretaker: Restoring state to: 1923 11:45:44
Originator: My state has changed to: 1923
================================================
FILE: Sources/Memento/RealWorld/Example.swift
================================================
import XCTest
class MementoRealWorld: XCTestCase {
/// State and Command are often used together when the previous state of the
/// object should be restored in case of failure of some operation.
///
/// Note: UndoManager can be used as an alternative.
func test() {
let textView = UITextView()
let undoStack = UndoStack(textView)
textView.text = "First Change"
undoStack.save()
textView.text = "Second Change"
undoStack.save()
textView.text = (textView.text ?? "") + " & Third Change"
textView.textColor = .red
undoStack.save()
print(undoStack)
print("Client: Perform Undo operation 2 times\n")
undoStack.undo()
undoStack.undo()
print(undoStack)
}
}
class UndoStack: CustomStringConvertible {
private lazy var mementos = [Memento]()
private let textView: UITextView
init(_ textView: UITextView) {
self.textView = textView
}
func save() {
mementos.append(textView.memento)
}
func undo() {
guard !mementos.isEmpty else { return }
textView.restore(with: mementos.removeLast())
}
var description: String {
return mementos.reduce("", { $0 + $1.description })
}
}
protocol Memento: CustomStringConvertible {
var text: String { get }
var date: Date { get }
}
extension UITextView {
var memento: Memento {
return TextViewMemento(text: text,
textColor: textColor,
selectedRange: selectedRange)
}
func restore(with memento: Memento) {
guard let textViewMemento = memento as? TextViewMemento else { return }
text = textViewMemento.text
textColor = textViewMemento.textColor
selectedRange = textViewMemento.selectedRange
}
struct TextViewMemento: Memento {
let text: String
let date = Date()
let textColor: UIColor?
let selectedRange: NSRange
var description: String {
let time = Calendar.current.dateComponents([.hour, .minute, .second, .nanosecond],
from: date)
let color = String(describing: textColor)
return "Text: \(text)\n" + "Date: \(time.description)\n"
+ "Color: \(color)\n" + "Range: \(selectedRange)\n\n"
}
}
}
================================================
FILE: Sources/Memento/RealWorld/Info.plist
================================================
CFBundleDevelopmentRegion
$(DEVELOPMENT_LANGUAGE)
CFBundleExecutable
$(EXECUTABLE_NAME)
CFBundleIdentifier
$(PRODUCT_BUNDLE_IDENTIFIER)
CFBundleInfoDictionaryVersion
6.0
CFBundleName
$(PRODUCT_NAME)
CFBundlePackageType
BNDL
CFBundleShortVersionString
1.0
CFBundleVersion
1
================================================
FILE: Sources/Memento/RealWorld/Output.txt
================================================
Text: First Change
Date: hour: 12 minute: 21 second: 50 nanosecond: 821737051 isLeapMonth: false
Color: nil
Range: {12, 0}
Text: Second Change
Date: hour: 12 minute: 21 second: 50 nanosecond: 826483011 isLeapMonth: false
Color: nil
Range: {13, 0}
Text: Second Change & Third Change
Date: hour: 12 minute: 21 second: 50 nanosecond: 829187035 isLeapMonth: false
Color: Optional(UIExtendedSRGBColorSpace 1 0 0 1)
Range: {28, 0}
Client: Perform Undo operation 2 times
Text: First Change
Date: hour: 12 minute: 21 second: 50 nanosecond: 821737051 isLeapMonth: false
Color: nil
Range: {12, 0}
================================================
FILE: Sources/Observer/Conceptual/Example.swift
================================================
/// EN: Observer Design Pattern
///
/// Intent: Lets you define a subscription mechanism to notify multiple objects
/// about any events that happen to the object they're observing.
///
/// Note that there's a lot of different terms with similar meaning associated
/// with this pattern. Just remember that the Subject is also called the
/// Publisher and the Observer is often called the Subscriber and vice versa.
/// Also the verbs "observe", "listen" or "track" usually mean the same thing.
///
/// Swift language has multiple ways of implementing the Observer pattern:
///
/// - KVO. Here is an example of how to implement it in a dozen lines of code:
/// https://www.objc.io/blog/2018/04/24/bindings-with-kvo-and-keypaths/
///
/// - NotificationCenter
/// https://developer.apple.com/documentation/foundation/notificationcenter
///
/// - RxSwift:
/// https://github.com/ReactiveX/RxSwift
///
/// In this example we'll implement a custom observer from scratch.
///
/// RU: Паттерн Наблюдатель
///
/// Назначение: Создаёт механизм подписки, позволяющий одним объектам следить и
/// реагировать на события, происходящие в других объектах.
///
/// Обратите внимание, что существует множество различных терминов с похожими
/// значениями, связанных с этим паттерном. Просто помните, что Субъекта также
/// называют Издателем, а Наблюдателя часто называют Подписчиком и наоборот.
/// Также глаголы «наблюдать», «слушать» или «отслеживать» обычно означают одно
/// и то же.
///
/// Язык Swift имеет несколько способов реализации Наблюдателя. Вот некоторые из
/// них:
///
/// - KVO. Вот замечательный пример того, как можно реализовать паттерн с
/// помощью дюжины строк кода:
/// https://www.objc.io/blog/2018/04/24/bindings-with-kvo-and-keypaths/
///
/// - NotificationCenter:
/// https://developer.apple.com/documentation/foundation/notificationcenter
///
/// - RxSwift:
/// https://github.com/ReactiveX/RxSwift
///
/// В этом примере, однако, мы попробуем реализовать Наблюдатель самостоятельно.
import XCTest
/// EN: The Subject owns some important state and notifies observers when the
/// state changes.
///
/// RU: Издатель владеет некоторым важным состоянием и оповещает наблюдателей о
/// его изменениях.
class Subject {
/// EN: For the sake of simplicity, the Subject's state, essential to all
/// subscribers, is stored in this variable.
///
/// RU: Для удобства в этой переменной хранится состояние Издателя,
/// необходимое всем подписчикам.
var state: Int = { return Int(arc4random_uniform(10)) }()
/// EN: @var array List of subscribers. In real life, the list of
/// subscribers can be stored more comprehensively (categorized by event
/// type, etc.).
///
/// RU: @var array Список подписчиков. В реальной жизни список подписчиков
/// может храниться в более подробном виде (классифицируется по типу события
/// и т.д.)
private lazy var observers = [Observer]()
/// EN: The subscription management methods.
///
/// RU: Методы управления подпиской.
func attach(_ observer: Observer) {
print("Subject: Attached an observer.\n")
observers.append(observer)
}
func detach(_ observer: Observer) {
if let idx = observers.firstIndex(where: { $0 === observer }) {
observers.remove(at: idx)
print("Subject: Detached an observer.\n")
}
}
/// EN: Trigger an update in each subscriber.
///
/// RU: Запуск обновления в каждом подписчике.
func notify() {
print("Subject: Notifying observers...\n")
observers.forEach({ $0.update(subject: self)})
}
/// EN: Usually, the subscription logic is only a fraction of what a Subject
/// can really do. Subjects commonly hold some important business logic,
/// that triggers a notification method whenever something important is
/// about to happen (or after it).
///
/// RU: Обычно логика подписки – только часть того, что делает Издатель.
/// Издатели часто содержат некоторую важную бизнес-логику, которая
/// запускает метод уведомления всякий раз, когда должно произойти что-то
/// важное (или после этого).
func someBusinessLogic() {
print("\nSubject: I'm doing something important.\n")
state = Int(arc4random_uniform(10))
print("Subject: My state has just changed to: \(state)\n")
notify()
}
}
/// EN: The Observer protocol declares the update method, used by subjects.
///
/// RU: Наблюдатель объявляет метод уведомления, который используют издатели для
/// оповещения.
protocol Observer: AnyObject {
func update(subject: Subject)
}
/// EN: Concrete Observers react to the updates issued by the Subject they had
/// been attached to.
///
/// RU: Конкретные Наблюдатели реагируют на обновления, выпущенные Издателем, к
/// которому они прикреплены.
class ConcreteObserverA: Observer {
func update(subject: Subject) {
if subject.state < 3 {
print("ConcreteObserverA: Reacted to the event.\n")
}
}
}
class ConcreteObserverB: Observer {
func update(subject: Subject) {
if subject.state >= 3 {
print("ConcreteObserverB: Reacted to the event.\n")
}
}
}
/// EN: Let's see how it all works together.
///
/// RU: Давайте посмотрим как всё это будет работать.
class ObserverConceptual: XCTestCase {
func testObserverConceptual() {
let subject = Subject()
let observer1 = ConcreteObserverA()
let observer2 = ConcreteObserverB()
subject.attach(observer1)
subject.attach(observer2)
subject.someBusinessLogic()
subject.someBusinessLogic()
subject.detach(observer2)
subject.someBusinessLogic()
}
}
================================================
FILE: Sources/Observer/Conceptual/Info.plist
================================================
CFBundleDevelopmentRegion
$(DEVELOPMENT_LANGUAGE)
CFBundleExecutable
$(EXECUTABLE_NAME)
CFBundleIdentifier
$(PRODUCT_BUNDLE_IDENTIFIER)
CFBundleInfoDictionaryVersion
6.0
CFBundleName
$(PRODUCT_NAME)
CFBundlePackageType
BNDL
CFBundleShortVersionString
1.0
CFBundleVersion
1
================================================
FILE: Sources/Observer/Conceptual/Output.txt
================================================
Subject: Attached an observer.
Subject: Attached an observer.
Subject: I'm doing something important.
Subject: My state has just changed to: 4
Subject: Notifying observers...
ConcreteObserverB: Reacted to the event.
Subject: I'm doing something important.
Subject: My state has just changed to: 2
Subject: Notifying observers...
ConcreteObserverA: Reacted to the event.
Subject: Detached an observer.
Subject: I'm doing something important.
Subject: My state has just changed to: 8
Subject: Notifying observers...
================================================
FILE: Sources/Observer/RealWorld/Example.swift
================================================
import XCTest
class ObserverRealWorld: XCTestCase {
func test() {
let cartManager = CartManager()
let navigationBar = UINavigationBar()
let cartVC = CartViewController()
cartManager.add(subscriber: navigationBar)
cartManager.add(subscriber: cartVC)
let apple = Food(id: 111, name: "Apple", price: 10, calories: 20)
cartManager.add(product: apple)
let tShirt = Clothes(id: 222, name: "T-shirt", price: 200, size: "L")
cartManager.add(product: tShirt)
cartManager.remove(product: apple)
}
}
protocol CartSubscriber: CustomStringConvertible {
func accept(changed cart: [Product])
}
protocol Product {
var id: Int { get }
var name: String { get }
var price: Double { get }
func isEqual(to product: Product) -> Bool
}
extension Product {
func isEqual(to product: Product) -> Bool {
return id == product.id
}
}
struct Food: Product {
var id: Int
var name: String
var price: Double
/// Food-specific properties
var calories: Int
}
struct Clothes: Product {
var id: Int
var name: String
var price: Double
/// Clothes-specific properties
var size: String
}
class CartManager {
private lazy var cart = [Product]()
private lazy var subscribers = [CartSubscriber]()
func add(subscriber: CartSubscriber) {
print("CartManager: I'am adding a new subscriber: \(subscriber.description)")
subscribers.append(subscriber)
}
func add(product: Product) {
print("\nCartManager: I'am adding a new product: \(product.name)")
cart.append(product)
notifySubscribers()
}
func remove(subscriber filter: (CartSubscriber) -> (Bool)) {
guard let index = subscribers.firstIndex(where: filter) else { return }
subscribers.remove(at: index)
}
func remove(product: Product) {
guard let index = cart.firstIndex(where: { $0.isEqual(to: product) }) else { return }
print("\nCartManager: Product '\(product.name)' is removed from a cart")
cart.remove(at: index)
notifySubscribers()
}
private func notifySubscribers() {
subscribers.forEach({ $0.accept(changed: cart) })
}
}
extension UINavigationBar: CartSubscriber {
func accept(changed cart: [Product]) {
print("UINavigationBar: Updating an appearance of navigation items")
}
open override var description: String { return "UINavigationBar" }
}
class CartViewController: UIViewController, CartSubscriber {
func accept(changed cart: [Product]) {
print("CartViewController: Updating an appearance of a list view with products")
}
open override var description: String { return "CartViewController" }
}
================================================
FILE: Sources/Observer/RealWorld/Info.plist
================================================
CFBundleDevelopmentRegion
$(DEVELOPMENT_LANGUAGE)
CFBundleExecutable
$(EXECUTABLE_NAME)
CFBundleIdentifier
$(PRODUCT_BUNDLE_IDENTIFIER)
CFBundleInfoDictionaryVersion
6.0
CFBundleName
$(PRODUCT_NAME)
CFBundlePackageType
BNDL
CFBundleShortVersionString
1.0
CFBundleVersion
1
================================================
FILE: Sources/Observer/RealWorld/Output.txt
================================================
CartManager: I'am adding a new subscriber: UINavigationBar
CartManager: I'am adding a new subscriber: CartViewController
CartManager: I'am adding a new product: Apple
UINavigationBar: Updating an appearance of navigation items
CartViewController: Updating an appearance of a list view with products
CartManager: I'am adding a new product: T-shirt
UINavigationBar: Updating an appearance of navigation items
CartViewController: Updating an appearance of a list view with products
CartManager: Product 'Apple' is removed from a cart
UINavigationBar: Updating an appearance of navigation items
CartViewController: Updating an appearance of a list view with products
================================================
FILE: Sources/Prototype/Conceptual/Example.swift
================================================
/// EN: Prototype Design Pattern
///
/// Intent: Lets you copy existing objects without making your code dependent on
/// their classes.
///
/// RU: Паттерн Прототип
///
/// Назначение: Позволяет копировать объекты, не вдаваясь в подробности их
/// реализации.
import XCTest
/// EN: Swift has built-in cloning support. To add cloning support to your
/// class, you need to implement the NSCopying protocol in that class and
/// provide the implementation for the `copy` method.
///
/// RU: Swift имеет встроенную поддержку клонирования. Чтобы сделать класс
/// клонируемым, вам нужно реализовать в нём протокол NSCopying, а именно метод
/// `copy`.
class BaseClass: NSCopying, Equatable {
private var intValue = 1
private var stringValue = "Value"
required init(intValue: Int = 1, stringValue: String = "Value") {
self.intValue = intValue
self.stringValue = stringValue
}
/// MARK: - NSCopying
func copy(with zone: NSZone? = nil) -> Any {
let prototype = type(of: self).init()
prototype.intValue = intValue
prototype.stringValue = stringValue
print("Values defined in BaseClass have been cloned!")
return prototype
}
/// MARK: - Equatable
static func == (lhs: BaseClass, rhs: BaseClass) -> Bool {
return lhs.intValue == rhs.intValue && lhs.stringValue == rhs.stringValue
}
}
/// EN: Subclasses can override the base `copy` method to copy their own data
/// into the resulting object. But you should always call the base method first.
///
/// RU: Подклассы могет переопределять базовый метод `copy`, чтобы дополнительно
/// скопировать данные собственного класса. Но в этом случае всегда сперва
/// вызывайте родительскую реализацию метод копирования.
class SubClass: BaseClass {
private var boolValue = true
func copy() -> Any {
return copy(with: nil)
}
override func copy(with zone: NSZone?) -> Any {
guard let prototype = super.copy(with: zone) as? SubClass else {
return SubClass() // oops
}
prototype.boolValue = boolValue
print("Values defined in SubClass have been cloned!")
return prototype
}
}
/// EN: The client code.
///
/// RU: Клиентский код.
class Client {
// ...
static func someClientCode() {
let original = SubClass(intValue: 2, stringValue: "Value2")
guard let copy = original.copy() as? SubClass else {
XCTAssert(false)
return
}
/// EN: See implementation of `Equatable` protocol for more details.
///
/// RU: См. реализацию протокола `Equatable`.
XCTAssert(copy == original)
print("The original object is equal to the copied object!")
}
// ...
}
/// EN: Let's see how it all works together.
///
/// RU: Давайте посмотрим как всё это будет работать.
class PrototypeConceptual: XCTestCase {
func testPrototype_NSCopying() {
Client.someClientCode()
}
}
================================================
FILE: Sources/Prototype/Conceptual/Info.plist
================================================
CFBundleDevelopmentRegion
$(DEVELOPMENT_LANGUAGE)
CFBundleExecutable
$(EXECUTABLE_NAME)
CFBundleIdentifier
$(PRODUCT_BUNDLE_IDENTIFIER)
CFBundleInfoDictionaryVersion
6.0
CFBundleName
$(PRODUCT_NAME)
CFBundlePackageType
BNDL
CFBundleShortVersionString
1.0
CFBundleVersion
1
================================================
FILE: Sources/Prototype/Conceptual/Output.txt
================================================
Values defined in BaseClass have been cloned!
Values defined in SubClass have been cloned!
The original object is equal to the copied object!
================================================
FILE: Sources/Prototype/RealWorld/Example.swift
================================================
import XCTest
class PrototypeRealWorld: XCTestCase {
func testPrototypeRealWorld() {
let author = Author(id: 10, username: "Ivan_83")
let page = Page(title: "My First Page", contents: "Hello world!", author: author)
page.add(comment: Comment(message: "Keep it up!"))
/// Since NSCopying returns Any, the copied object should be unwrapped.
guard let anotherPage = page.copy() as? Page else {
XCTFail("Page was not copied")
return
}
/// Comments should be empty as it is a new page.
XCTAssert(anotherPage.comments.isEmpty)
/// Note that the author is now referencing two objects.
XCTAssert(author.pagesCount == 2)
print("Original title: " + page.title)
print("Copied title: " + anotherPage.title)
print("Count of pages: " + String(author.pagesCount))
}
}
private class Author {
private var id: Int
private var username: String
private var pages = [Page]()
init(id: Int, username: String) {
self.id = id
self.username = username
}
func add(page: Page) {
pages.append(page)
}
var pagesCount: Int {
return pages.count
}
}
private class Page: NSCopying {
private(set) var title: String
private(set) var contents: String
private weak var author: Author?
private(set) var comments = [Comment]()
init(title: String, contents: String, author: Author?) {
self.title = title
self.contents = contents
self.author = author
author?.add(page: self)
}
func add(comment: Comment) {
comments.append(comment)
}
/// MARK: - NSCopying
func copy(with zone: NSZone? = nil) -> Any {
return Page(title: "Copy of '" + title + "'", contents: contents, author: author)
}
}
private struct Comment {
let date = Date()
let message: String
}
================================================
FILE: Sources/Prototype/RealWorld/Info.plist
================================================
CFBundleDevelopmentRegion
$(DEVELOPMENT_LANGUAGE)
CFBundleExecutable
$(EXECUTABLE_NAME)
CFBundleIdentifier
$(PRODUCT_BUNDLE_IDENTIFIER)
CFBundleInfoDictionaryVersion
6.0
CFBundleName
$(PRODUCT_NAME)
CFBundlePackageType
BNDL
CFBundleShortVersionString
1.0
CFBundleVersion
1
================================================
FILE: Sources/Prototype/RealWorld/Output.txt
================================================
Original title: My First Page
Copied title: Copy of 'My First Page'
Count of pages: 2
================================================
FILE: Sources/Proxy/Conceptual/Example.swift
================================================
/// EN: Proxy Design Pattern
///
/// Intent: Provide a surrogate or placeholder for another object to control
/// access to the original object or to add other responsibilities.
///
/// RU: Паттерн Заместитель
///
/// Назначение: Позволяет подставлять вместо реальных объектов специальные
/// объекты-заменители. Эти объекты перехватывают вызовы к оригинальному
/// объекту, позволяя сделать что-то до или после передачи вызова оригиналу.
import XCTest
/// EN: The Subject interface declares common operations for both RealSubject
/// and the Proxy. As long as the client works with RealSubject using this
/// interface, you'll be able to pass it a proxy instead of a real subject.
///
/// RU: Интерфейс Субъекта объявляет общие операции как для Реального Субъекта,
/// так и для Заместителя. Пока клиент работает с Реальным Субъектом, используя
/// этот интерфейс, вы сможете передать ему заместителя вместо реального
/// субъекта.
protocol Subject {
func request()
}
/// EN: The RealSubject contains some core business logic. Usually, RealSubjects
/// are capable of doing some useful work which may also be very slow or
/// sensitive - e.g. correcting input data. A Proxy can solve these issues
/// without any changes to the RealSubject's code.
///
/// RU: Реальный Субъект содержит некоторую базовую бизнес-логику. Как правило,
/// Реальные Субъекты способны выполнять некоторую полезную работу, которая к
/// тому же может быть очень медленной или точной – например, коррекция входных
/// данных. Заместитель может решить эти задачи без каких-либо изменений в коде
/// Реального Субъекта.
class RealSubject: Subject {
func request() {
print("RealSubject: Handling request.")
}
}
/// EN: The Proxy has an interface identical to the RealSubject.
///
/// RU: Интерфейс Заместителя идентичен интерфейсу Реального Субъекта.
class Proxy: Subject {
private var realSubject: RealSubject
/// EN: The Proxy maintains a reference to an object of the RealSubject
/// class. It can be either lazy-loaded or passed to the Proxy by the
/// client.
///
/// RU: Заместитель хранит ссылку на объект класса РеальныйСубъект. Клиент
/// может либо лениво загрузить его, либо передать Заместителю.
init(_ realSubject: RealSubject) {
self.realSubject = realSubject
}
/// EN: The most common applications of the Proxy pattern are lazy loading,
/// caching, controlling the access, logging, etc. A Proxy can perform one
/// of these things and then, depending on the result, pass the execution to
/// the same method in a linked RealSubject object.
///
/// RU: Наиболее распространёнными областями применения паттерна Заместитель
/// являются ленивая загрузка, кэширование, контроль доступа, ведение
/// журнала и т.д. Заместитель может выполнить одну из этих задач, а затем,
/// в зависимости от результата, передать выполнение одноимённому методу в
/// связанном объекте класса РеальныйСубъект.
func request() {
if (checkAccess()) {
realSubject.request()
logAccess()
}
}
private func checkAccess() -> Bool {
/// EN: Some real checks should go here.
///
/// RU: Некоторые реальные проверки должны проходить здесь.
print("Proxy: Checking access prior to firing a real request.")
return true
}
private func logAccess() {
print("Proxy: Logging the time of request.")
}
}
/// EN: The client code is supposed to work with all objects (both subjects and
/// proxies) via the Subject interface in order to support both real subjects
/// and proxies. In real life, however, clients mostly work with their real
/// subjects directly. In this case, to implement the pattern more easily, you
/// can extend your proxy from the real subject's class.
///
/// RU: Клиентский код должен работать со всеми объектами (как с реальными, так
/// и заместителями) через интерфейс Субъекта, чтобы поддерживать как реальные
/// субъекты, так и заместителей. В реальной жизни, однако, клиенты в основном
/// работают с реальными субъектами напрямую. В этом случае, для более простой
/// реализации паттерна, можно расширить заместителя из класса реального
/// субъекта.
class Client {
// ...
static func clientCode(subject: Subject) {
// ...
subject.request()
// ...
}
// ...
}
/// EN: Let's see how it all works together.
///
/// RU: Давайте посмотрим как всё это будет работать.
class ProxyConceptual: XCTestCase {
func test() {
print("Client: Executing the client code with a real subject:")
let realSubject = RealSubject()
Client.clientCode(subject: realSubject)
print("\nClient: Executing the same client code with a proxy:")
let proxy = Proxy(realSubject)
Client.clientCode(subject: proxy)
}
}
================================================
FILE: Sources/Proxy/Conceptual/Info.plist
================================================
CFBundleDevelopmentRegion
$(DEVELOPMENT_LANGUAGE)
CFBundleExecutable
$(EXECUTABLE_NAME)
CFBundleIdentifier
$(PRODUCT_BUNDLE_IDENTIFIER)
CFBundleInfoDictionaryVersion
6.0
CFBundleName
$(PRODUCT_NAME)
CFBundlePackageType
BNDL
CFBundleShortVersionString
1.0
CFBundleVersion
1
================================================
FILE: Sources/Proxy/Conceptual/Output.txt
================================================
Client: Executing the client code with a real subject:
RealSubject: Handling request.
Client: Executing the same client code with a proxy:
Proxy: Checking access prior to firing a real request.
RealSubject: Handling request.
Proxy: Logging the time of request.
================================================
FILE: Sources/Proxy/RealWorld/Example.swift
================================================
import XCTest
class ProxyRealWorld: XCTestCase {
/// EN: Proxy Design Pattern
///
/// Intent: Provide a surrogate or placeholder for another object to control
/// access to the original object or to add other responsibilities.
///
/// Example: There are countless ways proxies can be used: caching, logging,
/// access control, delayed initialization, etc.
///
/// RU: Паттерн Заместитель
///
/// Назначение: Позволяет подставлять вместо реальных объектов специальные
/// объекты-заменители. Эти объекты перехватывают вызовы к оригинальному
/// объекту, позволяя сделать что-то до или после передачи вызова оригиналу.
///
/// Пример: Существует бесчисленное множество направлений, где могут быть
/// использованы заместители: кэширование, логирование, контроль доступа,
/// отложенная инициализация и т.д.
func testProxyRealWorld() {
print("Client: Loading a profile WITHOUT proxy")
loadBasicProfile(with: Keychain())
loadProfileWithBankAccount(with: Keychain())
print("\nClient: Let's load a profile WITH proxy")
loadBasicProfile(with: ProfileProxy())
loadProfileWithBankAccount(with: ProfileProxy())
}
func loadBasicProfile(with service: ProfileService) {
service.loadProfile(with: [.basic], success: { profile in
print("Client: Basic profile is loaded")
}) { error in
print("Client: Cannot load a basic profile")
print("Client: Error: " + error.localizedSummary)
}
}
func loadProfileWithBankAccount(with service: ProfileService) {
service.loadProfile(with: [.basic, .bankAccount], success: { profile in
print("Client: Basic profile with a bank account is loaded")
}) { error in
print("Client: Cannot load a profile with a bank account")
print("Client: Error: " + error.localizedSummary)
}
}
}
enum AccessField {
case basic
case bankAccount
}
protocol ProfileService {
typealias Success = (Profile) -> ()
typealias Failure = (LocalizedError) -> ()
func loadProfile(with fields: [AccessField], success: Success, failure: Failure)
}
class ProfileProxy: ProfileService {
private let keychain = Keychain()
func loadProfile(with fields: [AccessField], success: Success, failure: Failure) {
if let error = checkAccess(for: fields) {
failure(error)
} else {
/// Note:
/// At this point, the `success` and `failure` closures can be
/// passed directly to the original service (as it is now) or
/// expanded here to handle a result (for example, to cache).
keychain.loadProfile(with: fields, success: success, failure: failure)
}
}
private func checkAccess(for fields: [AccessField]) -> LocalizedError? {
if fields.contains(.bankAccount) {
switch BiometricsService.checkAccess() {
case .authorized: return nil
case .denied: return ProfileError.accessDenied
}
}
return nil
}
}
class Keychain: ProfileService {
func loadProfile(with fields: [AccessField], success: Success, failure: Failure) {
var profile = Profile()
for item in fields {
switch item {
case .basic:
let info = loadBasicProfile()
profile.firstName = info[Profile.Keys.firstName.raw]
profile.lastName = info[Profile.Keys.lastName.raw]
profile.email = info[Profile.Keys.email.raw]
case .bankAccount:
profile.bankAccount = loadBankAccount()
}
}
success(profile)
}
private func loadBasicProfile() -> [String : String] {
/// Gets these fields from a secure storage.
return [Profile.Keys.firstName.raw : "Vasya",
Profile.Keys.lastName.raw : "Pupkin",
Profile.Keys.email.raw : "vasya.pupkin@gmail.com"]
}
private func loadBankAccount() -> BankAccount {
/// Gets these fields from a secure storage.
return BankAccount(id: 12345, amount: 999)
}
}
class BiometricsService {
enum Access {
case authorized
case denied
}
static func checkAccess() -> Access {
/// The service uses Face ID, Touch ID or a plain old password to
/// determine whether the current user is an owner of the device.
/// Let's assume that in our example a user forgot a password :)
return .denied
}
}
struct Profile {
enum Keys: String {
case firstName
case lastName
case email
}
var firstName: String?
var lastName: String?
var email: String?
var bankAccount: BankAccount?
}
struct BankAccount {
var id: Int
var amount: Double
}
enum ProfileError: LocalizedError {
case accessDenied
var errorDescription: String? {
switch self {
case .accessDenied:
return "Access is denied. Please enter a valid password"
}
}
}
extension RawRepresentable {
var raw: Self.RawValue {
return rawValue
}
}
extension LocalizedError {
var localizedSummary: String {
return errorDescription ?? ""
}
}
================================================
FILE: Sources/Proxy/RealWorld/Info.plist
================================================
CFBundleDevelopmentRegion
$(DEVELOPMENT_LANGUAGE)
CFBundleExecutable
$(EXECUTABLE_NAME)
CFBundleIdentifier
$(PRODUCT_BUNDLE_IDENTIFIER)
CFBundleInfoDictionaryVersion
6.0
CFBundleName
$(PRODUCT_NAME)
CFBundlePackageType
BNDL
CFBundleShortVersionString
1.0
CFBundleVersion
1
================================================
FILE: Sources/Proxy/RealWorld/Output.txt
================================================
Client: Loading a profile WITHOUT proxy
Client: Basic profile is loaded
Client: Basic profile with a bank account is loaded
Client: Let's load a profile WITH proxy
Client: Basic profile is loaded
Client: Cannot load a profile with a bank account
Client: Error: Access is denied. Please enter a valid password
================================================
FILE: Sources/Singleton/Conceptual/Example.swift
================================================
/// EN: Singleton Design Pattern
///
/// Intent: Lets you ensure that a class has only one instance, while providing
/// a global access point to this instance.
///
/// RU: Паттерн Одиночка
///
/// Назначение: Гарантирует, что у класса есть только один экземпляр, и
/// предоставляет к нему глобальную точку доступа.
import XCTest
/// EN: The Singleton class defines the `shared` field that lets clients access
/// the unique singleton instance.
///
/// RU: Класс Одиночка предоставляет поле `shared`, которое позволяет клиентам
/// получать доступ к уникальному экземпляру одиночки.
class Singleton {
/// EN: The static field that controls the access to the singleton instance.
///
/// This implementation let you extend the Singleton class while keeping
/// just one instance of each subclass around.
///
/// RU: Статическое поле, управляющие доступом к экземпляру одиночки.
///
/// Эта реализация позволяет вам расширять класс Одиночки, сохраняя повсюду
/// только один экземпляр каждого подкласса.
static var shared: Singleton = {
let instance = Singleton()
// EN: ... configure the instance
// ...
//
// RU: ... настройка объекта
// ...
return instance
}()
/// EN: The Singleton's initializer should always be private to prevent
/// direct construction calls with the `new` operator.
///
/// RU: Инициализатор Одиночки всегда должен быть скрытым, чтобы
/// предотвратить прямое создание объекта через инициализатор.
private init() {}
/// EN: Finally, any singleton should define some business logic, which can
/// be executed on its instance.
///
/// RU: Наконец, любой одиночка должен содержать некоторую бизнес-логику,
/// которая может быть выполнена на его экземпляре.
func someBusinessLogic() -> String {
// ...
return "Result of the 'someBusinessLogic' call"
}
}
/// EN: Singletons should not be cloneable.
///
/// RU: Одиночки не должны быть клонируемыми.
extension Singleton: NSCopying {
func copy(with zone: NSZone? = nil) -> Any {
return self
}
}
/// EN: The client code.
///
/// RU: Клиентский код.
class Client {
// ...
static func someClientCode() {
let instance1 = Singleton.shared
let instance2 = Singleton.shared
if (instance1 === instance2) {
print("Singleton works, both variables contain the same instance.")
} else {
print("Singleton failed, variables contain different instances.")
}
}
// ...
}
/// EN: Let's see how it all works together.
///
/// RU: Давайте посмотрим как всё это будет работать.
class SingletonConceptual: XCTestCase {
func testSingletonConceptual() {
Client.someClientCode()
}
}
================================================
FILE: Sources/Singleton/Conceptual/Info.plist
================================================
CFBundleDevelopmentRegion
$(DEVELOPMENT_LANGUAGE)
CFBundleExecutable
$(EXECUTABLE_NAME)
CFBundleIdentifier
$(PRODUCT_BUNDLE_IDENTIFIER)
CFBundleInfoDictionaryVersion
6.0
CFBundleName
$(PRODUCT_NAME)
CFBundlePackageType
BNDL
CFBundleShortVersionString
1.0
CFBundleVersion
1
================================================
FILE: Sources/Singleton/Conceptual/Output.txt
================================================
Singleton works, both variables contain the same instance.
================================================
FILE: Sources/Singleton/RealWorld/Example.swift
================================================
import XCTest
/// Singleton Design Pattern
///
/// Intent: Ensure that class has a single instance, and provide a global point
/// of access to it.
class SingletonRealWorld: XCTestCase {
func testSingletonRealWorld() {
/// There are two view controllers.
///
/// MessagesListVC displays a list of last messages from a user's chats.
/// ChatVC displays a chat with a friend.
///
/// FriendsChatService fetches messages from a server and provides all
/// subscribers (view controllers in our example) with new and removed
/// messages.
///
/// FriendsChatService is used by both view controllers. It can be
/// implemented as an instance of a class as well as a global variable.
///
/// In this example, it is important to have only one instance that
/// performs resource-intensive work.
let listVC = MessagesListVC()
let chatVC = ChatVC()
listVC.startReceiveMessages()
chatVC.startReceiveMessages()
/// ... add view controllers to the navigation stack ...
}
}
class BaseVC: UIViewController, MessageSubscriber {
func accept(new messages: [Message]) {
/// Handles new messages in the base class
}
func accept(removed messages: [Message]) {
/// Hanldes removed messages in the base class
}
func startReceiveMessages() {
/// The singleton can be injected as a dependency. However, from an
/// informational perspective, this example calls FriendsChatService
/// directly to illustrate the intent of the pattern, which is: "...to
/// provide the global point of access to the instance..."
FriendsChatService.shared.add(subscriber: self)
}
}
class MessagesListVC: BaseVC {
override func accept(new messages: [Message]) {
print("MessagesListVC accepted 'new messages'")
/// Handles new messages in the child class
}
override func accept(removed messages: [Message]) {
print("MessagesListVC accepted 'removed messages'")
/// Handles removed messages in the child class
}
override func startReceiveMessages() {
print("MessagesListVC starts receive messages")
super.startReceiveMessages()
}
}
class ChatVC: BaseVC {
override func accept(new messages: [Message]) {
print("ChatVC accepted 'new messages'")
/// Handles new messages in the child class
}
override func accept(removed messages: [Message]) {
print("ChatVC accepted 'removed messages'")
/// Handles removed messages in the child class
}
override func startReceiveMessages() {
print("ChatVC starts receive messages")
super.startReceiveMessages()
}
}
/// Protocol for call-back events
protocol MessageSubscriber {
func accept(new messages: [Message])
func accept(removed messages: [Message])
}
/// Protocol for communication with a message service
protocol MessageService {
func add(subscriber: MessageSubscriber)
}
/// Message domain model
struct Message {
let id: Int
let text: String
}
class FriendsChatService: MessageService {
static let shared = FriendsChatService()
private var subscribers = [MessageSubscriber]()
func add(subscriber: MessageSubscriber) {
/// In this example, fetching starts again by adding a new subscriber
subscribers.append(subscriber)
/// Please note, the first subscriber will receive messages again when
/// the second subscriber is added
startFetching()
}
func startFetching() {
/// Set up the network stack, establish a connection...
/// ...and retrieve data from a server
let newMessages = [Message(id: 0, text: "Text0"),
Message(id: 5, text: "Text5"),
Message(id: 10, text: "Text10")]
let removedMessages = [Message(id: 1, text: "Text0")]
/// Send updated data to subscribers
receivedNew(messages: newMessages)
receivedRemoved(messages: removedMessages)
}
}
private extension FriendsChatService {
func receivedNew(messages: [Message]) {
subscribers.forEach { item in
item.accept(new: messages)
}
}
func receivedRemoved(messages: [Message]) {
subscribers.forEach { item in
item.accept(removed: messages)
}
}
}
================================================
FILE: Sources/Singleton/RealWorld/Info.plist
================================================
CFBundleDevelopmentRegion
$(DEVELOPMENT_LANGUAGE)
CFBundleExecutable
$(EXECUTABLE_NAME)
CFBundleIdentifier
$(PRODUCT_BUNDLE_IDENTIFIER)
CFBundleInfoDictionaryVersion
6.0
CFBundleName
$(PRODUCT_NAME)
CFBundlePackageType
BNDL
CFBundleShortVersionString
1.0
CFBundleVersion
1
================================================
FILE: Sources/Singleton/RealWorld/Output.txt
================================================
MessagesListVC starts receive messages
MessagesListVC accepted 'new messages'
MessagesListVC accepted 'removed messages'
======== At this point, the second subscriber is added ======
ChatVC starts receive messages
MessagesListVC accepted 'new messages'
ChatVC accepted 'new messages'
MessagesListVC accepted 'removed messages'
ChatVC accepted 'removed messages'
================================================
FILE: Sources/State/Conceptual/Example.swift
================================================
/// EN: State Design Pattern
///
/// Intent: Lets an object alter its behavior when its internal state changes.
/// It appears as if the object changed its class.
///
/// RU: Паттерн Состояние
///
/// Назначение: Позволяет объектам менять поведение в зависимости от своего
/// состояния. Извне создаётся впечатление, что изменился класс объекта.
import XCTest
/// EN: The Context defines the interface of interest to clients. It also
/// maintains a reference to an instance of a State subclass, which represents
/// the current state of the Context.
///
/// RU: Контекст определяет интерфейс, представляющий интерес для клиентов. Он
/// также хранит ссылку на экземпляр подкласса Состояния, который отображает
/// текущее состояние Контекста.
class Context {
/// EN: A reference to the current state of the Context.
///
/// RU: Ссылка на текущее состояние Контекста.
private var state: State
init(_ state: State) {
self.state = state
transitionTo(state: state)
}
/// EN: The Context allows changing the State object at runtime.
///
/// RU: Контекст позволяет изменять объект Состояния во время выполнения.
func transitionTo(state: State) {
print("Context: Transition to " + String(describing: state))
self.state = state
self.state.update(context: self)
}
/// EN: The Context delegates part of its behavior to the current State
/// object.
///
/// RU: Контекст делегирует часть своего поведения текущему объекту
/// Состояния.
func request1() {
state.handle1()
}
func request2() {
state.handle2()
}
}
/// EN: The base State class declares methods that all Concrete State should
/// implement and also provides a backreference to the Context object,
/// associated with the State. This backreference can be used by States to
/// transition the Context to another State.
///
/// RU: Базовый класс Состояния объявляет методы, которые должны реализовать все
/// Конкретные Состояния, а также предоставляет обратную ссылку на объект
/// Контекст, связанный с Состоянием. Эта обратная ссылка может использоваться
/// Состояниями для передачи Контекста другому Состоянию.
protocol State: AnyObject {
func update(context: Context)
func handle1()
func handle2()
}
class BaseState: State {
private(set) weak var context: Context?
func update(context: Context) {
self.context = context
}
func handle1() {}
func handle2() {}
}
/// EN: Concrete States implement various behaviors, associated with a state of
/// the Context.
///
/// RU: Конкретные Состояния реализуют различные модели поведения, связанные с
/// состоянием Контекста.
class ConcreteStateA: BaseState {
override func handle1() {
print("ConcreteStateA handles request1.")
print("ConcreteStateA wants to change the state of the context.\n")
context?.transitionTo(state: ConcreteStateB())
}
override func handle2() {
print("ConcreteStateA handles request2.\n")
}
}
class ConcreteStateB: BaseState {
override func handle1() {
print("ConcreteStateB handles request1.\n")
}
override func handle2() {
print("ConcreteStateB handles request2.")
print("ConcreteStateB wants to change the state of the context.\n")
context?.transitionTo(state: ConcreteStateA())
}
}
/// EN: Let's see how it all works together.
///
/// RU: Давайте посмотрим как всё это будет работать.
class StateConceptual: XCTestCase {
func test() {
let context = Context(ConcreteStateA())
context.request1()
context.request2()
}
}
================================================
FILE: Sources/State/Conceptual/Info.plist
================================================
CFBundleDevelopmentRegion
$(DEVELOPMENT_LANGUAGE)
CFBundleExecutable
$(EXECUTABLE_NAME)
CFBundleIdentifier
$(PRODUCT_BUNDLE_IDENTIFIER)
CFBundleInfoDictionaryVersion
6.0
CFBundleName
$(PRODUCT_NAME)
CFBundlePackageType
BNDL
CFBundleShortVersionString
1.0
CFBundleVersion
1
================================================
FILE: Sources/State/Conceptual/Output.txt
================================================
Context: Transition to StateConceptual.ConcreteStateA
ConcreteStateA handles request1.
ConcreteStateA wants to change the state of the context.
Context: Transition to StateConceptual.ConcreteStateB
ConcreteStateB handles request2.
ConcreteStateB wants to change the state of the context.
Context: Transition to StateConceptual.ConcreteStateA
================================================
FILE: Sources/State/RealWorld/Example.swift
================================================
import XCTest
class StateRealWorld: XCTestCase {
func test() {
print("Client: I'm starting working with a location tracker")
let tracker = LocationTracker()
print()
tracker.startTracking()
print()
tracker.pauseTracking(for: 2)
print()
tracker.makeCheckIn()
print()
tracker.findMyChildren()
print()
tracker.stopTracking()
}
}
class LocationTracker {
/// Location tracking is enabled by default
private lazy var trackingState: TrackingState = EnabledTrackingState(tracker: self)
func startTracking() {
trackingState.startTracking()
}
func stopTracking() {
trackingState.stopTracking()
}
func pauseTracking(for time: TimeInterval) {
trackingState.pauseTracking(for: time)
}
func makeCheckIn() {
trackingState.makeCheckIn()
}
func findMyChildren() {
trackingState.findMyChildren()
}
func update(state: TrackingState) {
trackingState = state
}
}
protocol TrackingState {
func startTracking()
func stopTracking()
func pauseTracking(for time: TimeInterval)
func makeCheckIn()
func findMyChildren()
}
class EnabledTrackingState: TrackingState {
private weak var tracker: LocationTracker?
init(tracker: LocationTracker?) {
self.tracker = tracker
}
func startTracking() {
print("EnabledTrackingState: startTracking is invoked")
print("EnabledTrackingState: tracking location....1")
print("EnabledTrackingState: tracking location....2")
print("EnabledTrackingState: tracking location....3")
}
func stopTracking() {
print("EnabledTrackingState: Received 'stop tracking'")
print("EnabledTrackingState: Changing state to 'disabled'...")
tracker?.update(state: DisabledTrackingState(tracker: tracker))
tracker?.stopTracking()
}
func pauseTracking(for time: TimeInterval) {
print("EnabledTrackingState: Received 'pause tracking' for \(time) seconds")
print("EnabledTrackingState: Changing state to 'disabled'...")
tracker?.update(state: DisabledTrackingState(tracker: tracker))
tracker?.pauseTracking(for: time)
}
func makeCheckIn() {
print("EnabledTrackingState: performing check-in at the current location")
}
func findMyChildren() {
print("EnabledTrackingState: searching for children...")
}
}
class DisabledTrackingState: TrackingState {
private weak var tracker: LocationTracker?
init(tracker: LocationTracker?) {
self.tracker = tracker
}
func startTracking() {
print("DisabledTrackingState: Received 'start tracking'")
print("DisabledTrackingState: Changing state to 'enabled'...")
tracker?.update(state: EnabledTrackingState(tracker: tracker))
}
func pauseTracking(for time: TimeInterval) {
print("DisabledTrackingState: Pause tracking for \(time) seconds")
for i in 0...Int(time) {
print("DisabledTrackingState: pause...\(i)")
}
print("DisabledTrackingState: Time is over")
print("DisabledTrackingState: Returing to 'enabled state'...\n")
self.tracker?.update(state: EnabledTrackingState(tracker: self.tracker))
self.tracker?.startTracking()
}
func stopTracking() {
print("DisabledTrackingState: Received 'stop tracking'")
print("DisabledTrackingState: Do nothing...")
}
func makeCheckIn() {
print("DisabledTrackingState: Received 'make check-in'")
print("DisabledTrackingState: Changing state to 'enabled'...")
tracker?.update(state: EnabledTrackingState(tracker: tracker))
tracker?.makeCheckIn()
}
func findMyChildren() {
print("DisabledTrackingState: Received 'find my children'")
print("DisabledTrackingState: Changing state to 'enabled'...")
tracker?.update(state: EnabledTrackingState(tracker: tracker))
tracker?.findMyChildren()
}
}
================================================
FILE: Sources/State/RealWorld/Info.plist
================================================
CFBundleDevelopmentRegion
$(DEVELOPMENT_LANGUAGE)
CFBundleExecutable
$(EXECUTABLE_NAME)
CFBundleIdentifier
$(PRODUCT_BUNDLE_IDENTIFIER)
CFBundleInfoDictionaryVersion
6.0
CFBundleName
$(PRODUCT_NAME)
CFBundlePackageType
BNDL
CFBundleShortVersionString
1.0
CFBundleVersion
1
================================================
FILE: Sources/State/RealWorld/Output.txt
================================================
Client: I'm starting working with a location tracker
EnabledTrackingState: startTracking is invoked
EnabledTrackingState: tracking location....1
EnabledTrackingState: tracking location....2
EnabledTrackingState: tracking location....3
EnabledTrackingState: Received 'pause tracking' for 2.0 seconds
EnabledTrackingState: Changing state to 'disabled'...
DisabledTrackingState: Pause tracking for 2.0 seconds
DisabledTrackingState: pause...0
DisabledTrackingState: pause...1
DisabledTrackingState: pause...2
DisabledTrackingState: Time is over
DisabledTrackingState: Returing to 'enabled state'...
EnabledTrackingState: startTracking is invoked
EnabledTrackingState: tracking location....1
EnabledTrackingState: tracking location....2
EnabledTrackingState: tracking location....3
EnabledTrackingState: performing check-in at the current location
EnabledTrackingState: searching for children...
EnabledTrackingState: Received 'stop tracking'
EnabledTrackingState: Changing state to 'disabled'...
DisabledTrackingState: Received 'stop tracking'
DisabledTrackingState: Do nothing...
================================================
FILE: Sources/Strategy/Conceptual/Example.swift
================================================
/// EN: Strategy Design Pattern
///
/// Intent: Lets you define a family of algorithms, put each of them into a
/// separate class, and make their objects interchangeable.
///
/// RU: Паттерн Стратегия
///
/// Назначение: Определяет семейство схожих алгоритмов и помещает каждый из них
/// в собственный класс, после чего алгоритмы можно взаимозаменять прямо во
/// время исполнения программы.
import XCTest
/// EN: The Context defines the interface of interest to clients.
///
/// RU: Контекст определяет интерфейс, представляющий интерес для клиентов.
class Context {
/// EN: The Context maintains a reference to one of the Strategy objects.
/// The Context does not know the concrete class of a strategy. It should
/// work with all strategies via the Strategy interface.
///
/// RU: Контекст хранит ссылку на один из объектов Стратегии. Контекст не
/// знает конкретного класса стратегии. Он должен работать со всеми
/// стратегиями через интерфейс Стратегии.
private var strategy: Strategy
/// EN: Usually, the Context accepts a strategy through the constructor, but
/// also provides a setter to change it at runtime.
///
/// RU: Обычно Контекст принимает стратегию через конструктор, а также
/// предоставляет сеттер для её изменения во время выполнения.
init(strategy: Strategy) {
self.strategy = strategy
}
/// EN: Usually, the Context allows replacing a Strategy object at runtime.
///
/// RU: Обычно Контекст позволяет заменить объект Стратегии во время
/// выполнения.
func update(strategy: Strategy) {
self.strategy = strategy
}
/// EN: The Context delegates some work to the Strategy object instead of
/// implementing multiple versions of the algorithm on its own.
///
/// RU: Вместо того, чтобы самостоятельно реализовывать множественные версии
/// алгоритма, Контекст делегирует некоторую работу объекту Стратегии.
func doSomeBusinessLogic() {
print("Context: Sorting data using the strategy (not sure how it'll do it)\n")
let result = strategy.doAlgorithm(["a", "b", "c", "d", "e"])
print(result.joined(separator: ","))
}
}
/// EN: The Strategy interface declares operations common to all supported
/// versions of some algorithm.
///
/// The Context uses this interface to call the algorithm defined by Concrete
/// Strategies.
///
/// RU: Интерфейс Стратегии объявляет операции, общие для всех поддерживаемых
/// версий некоторого алгоритма.
///
/// Контекст использует этот интерфейс для вызова алгоритма, определённого
/// Конкретными Стратегиями.
protocol Strategy {
func doAlgorithm(_ data: [T]) -> [T]
}
/// EN: Concrete Strategies implement the algorithm while following the base
/// Strategy interface. The interface makes them interchangeable in the Context.
///
/// RU: Конкретные Стратегии реализуют алгоритм, следуя базовому интерфейсу
/// Стратегии. Этот интерфейс делает их взаимозаменяемыми в Контексте.
class ConcreteStrategyA: Strategy {
func doAlgorithm(_ data: [T]) -> [T] {
return data.sorted()
}
}
class ConcreteStrategyB: Strategy {
func doAlgorithm(_ data: [T]) -> [T] {
return data.sorted(by: >)
}
}
/// EN: Let's see how it all works together.
///
/// RU: Давайте посмотрим как всё это будет работать.
class StrategyConceptual: XCTestCase {
func test() {
/// EN: The client code picks a concrete strategy and passes it to the
/// context. The client should be aware of the differences between
/// strategies in order to make the right choice.
///
/// RU: Клиентский код выбирает конкретную стратегию и передаёт её в
/// контекст. Клиент должен знать о различиях между стратегиями, чтобы
/// сделать правильный выбор.
let context = Context(strategy: ConcreteStrategyA())
print("Client: Strategy is set to normal sorting.\n")
context.doSomeBusinessLogic()
print("\nClient: Strategy is set to reverse sorting.\n")
context.update(strategy: ConcreteStrategyB())
context.doSomeBusinessLogic()
}
}
================================================
FILE: Sources/Strategy/Conceptual/Info.plist
================================================
CFBundleDevelopmentRegion
$(DEVELOPMENT_LANGUAGE)
CFBundleExecutable
$(EXECUTABLE_NAME)
CFBundleIdentifier
$(PRODUCT_BUNDLE_IDENTIFIER)
CFBundleInfoDictionaryVersion
6.0
CFBundleName
$(PRODUCT_NAME)
CFBundlePackageType
BNDL
CFBundleShortVersionString
1.0
CFBundleVersion
1
================================================
FILE: Sources/Strategy/Conceptual/Output.txt
================================================
Client: Strategy is set to normal sorting.
Context: Sorting data using the strategy (not sure how it'll do it)
a,b,c,d,e
Client: Strategy is set to reverse sorting.
Context: Sorting data using the strategy (not sure how it'll do it)
e,d,c,b,a
================================================
FILE: Sources/Strategy/RealWorld/Example.swift
================================================
import XCTest
class StrategyRealWorld: XCTestCase {
/// This example shows a simple implementation of a list controller that is
/// able to display models from different data sources:
///
/// (MemoryStorage, CoreDataStorage, RealmStorage)
func test() {
let controller = ListController()
let memoryStorage = MemoryStorage()
memoryStorage.add(usersFromNetwork())
clientCode(use: controller, with: memoryStorage)
clientCode(use: controller, with: CoreDataStorage())
clientCode(use: controller, with: RealmStorage())
}
func clientCode(use controller: ListController, with dataSource: DataSource) {
controller.update(dataSource: dataSource)
controller.displayModels()
}
private func usersFromNetwork() -> [User] {
let firstUser = User(id: 1, username: "username1")
let secondUser = User(id: 2, username: "username2")
return [firstUser, secondUser]
}
}
class ListController {
private var dataSource: DataSource?
func update(dataSource: DataSource) {
/// ... resest current states ...
self.dataSource = dataSource
}
func displayModels() {
guard let dataSource = dataSource else { return }
let models = dataSource.loadModels() as [User]
/// Bind models to cells of a list view...
print("\nListController: Displaying models...")
models.forEach({ print($0) })
}
}
protocol DataSource {
func loadModels() -> [T]
}
class MemoryStorage: DataSource {
private lazy var items = [Model]()
func add(_ items: [Model]) {
self.items.append(contentsOf: items)
}
func loadModels() -> [T] {
guard T.self == User.self else { return [] }
return items as! [T]
}
}
class CoreDataStorage: DataSource {
func loadModels() -> [T] {
guard T.self == User.self else { return [] }
let firstUser = User(id: 3, username: "username3")
let secondUser = User(id: 4, username: "username4")
return [firstUser, secondUser] as! [T]
}
}
class RealmStorage: DataSource {
func loadModels() -> [T] {
guard T.self == User.self else { return [] }
let firstUser = User(id: 5, username: "username5")
let secondUser = User(id: 6, username: "username6")
return [firstUser, secondUser] as! [T]
}
}
protocol DomainModel {
var id: Int { get }
}
struct User: DomainModel {
var id: Int
var username: String
}
================================================
FILE: Sources/Strategy/RealWorld/Info.plist
================================================
CFBundleDevelopmentRegion
$(DEVELOPMENT_LANGUAGE)
CFBundleExecutable
$(EXECUTABLE_NAME)
CFBundleIdentifier
$(PRODUCT_BUNDLE_IDENTIFIER)
CFBundleInfoDictionaryVersion
6.0
CFBundleName
$(PRODUCT_NAME)
CFBundlePackageType
BNDL
CFBundleShortVersionString
1.0
CFBundleVersion
1
================================================
FILE: Sources/Strategy/RealWorld/Output.txt
================================================
ListController: Displaying models...
User(id: 1, username: "username1")
User(id: 2, username: "username2")
ListController: Displaying models...
User(id: 3, username: "username3")
User(id: 4, username: "username4")
ListController: Displaying models...
User(id: 5, username: "username5")
User(id: 6, username: "username6")
================================================
FILE: Sources/TemplateMethod/Conceptual/Example.swift
================================================
/// EN: Template Method Design Pattern
///
/// Intent: Defines the skeleton of an algorithm in the superclass but lets
/// subclasses override specific steps of the algorithm without changing its
/// structure.
///
/// RU: Паттерн Шаблонный метод
///
/// Назначение: Определяет скелет алгоритма, перекладывая ответственность за
/// некоторые его шаги на подклассы. Паттерн позволяет подклассам переопределять
/// шаги алгоритма, не меняя его общей структуры.
import XCTest
/// EN: The Abstract Protocol and its extension defines a template method that
/// contains a skeleton of some algorithm, composed of calls to (usually)
/// abstract primitive operations.
///
/// Concrete subclasses should implement these operations, but leave the
/// template method itself intact.
///
/// RU: Абстрактный Протокол и его расширение определяет шаблонный метод,
/// содержащий скелет некоторого алгоритма, состоящего из вызовов (обычно)
/// абстрактных примитивных операций.
///
/// Конкретные подклассы должны реализовать эти операции, но оставить сам
/// шаблонный метод без изменений.
protocol AbstractProtocol {
/// EN: The template method defines the skeleton of an algorithm.
///
/// RU: Шаблонный метод определяет скелет алгоритма.
func templateMethod()
/// EN: These operations already have implementations.
///
/// RU: Эти операции уже имеют реализации.
func baseOperation1()
func baseOperation2()
func baseOperation3()
/// EN: These operations have to be implemented in subclasses.
///
/// RU: А эти операции должны быть реализованы в подклассах.
func requiredOperations1()
func requiredOperation2()
/// EN: These are "hooks." Subclasses may override them, but it's not
/// mandatory since the hooks already have default (but empty)
/// implementation. Hooks provide additional extension points in some
/// crucial places of the algorithm.
///
/// RU: Это «хуки». Подклассы могут переопределять их, но это не
/// обязательно, поскольку у хуков уже есть стандартная (но пустая)
/// реализация. Хуки предоставляют дополнительные точки расширения в
/// некоторых критических местах алгоритма.
func hook1()
func hook2()
}
extension AbstractProtocol {
func templateMethod() {
baseOperation1()
requiredOperations1()
baseOperation2()
hook1()
requiredOperation2()
baseOperation3()
hook2()
}
/// EN: These operations already have implementations.
///
/// RU: Эти операции уже имеют реализации.
func baseOperation1() {
print("AbstractProtocol says: I am doing the bulk of the work\n")
}
func baseOperation2() {
print("AbstractProtocol says: But I let subclasses override some operations\n")
}
func baseOperation3() {
print("AbstractProtocol says: But I am doing the bulk of the work anyway\n")
}
func hook1() {}
func hook2() {}
}
/// EN: Concrete classes have to implement all abstract operations of the base
/// class. They can also override some operations with a default implementation.
///
/// RU: Конкретные классы должны реализовать все абстрактные операции базового
/// класса. Они также могут переопределить некоторые операции с реализацией по
/// умолчанию.
class ConcreteClass1: AbstractProtocol {
func requiredOperations1() {
print("ConcreteClass1 says: Implemented Operation1\n")
}
func requiredOperation2() {
print("ConcreteClass1 says: Implemented Operation2\n")
}
func hook2() {
print("ConcreteClass1 says: Overridden Hook2\n")
}
}
/// EN: Usually, concrete classes override only a fraction of base class'
/// operations.
///
/// RU: Обычно конкретные классы переопределяют только часть операций базового
/// класса.
class ConcreteClass2: AbstractProtocol {
func requiredOperations1() {
print("ConcreteClass2 says: Implemented Operation1\n")
}
func requiredOperation2() {
print("ConcreteClass2 says: Implemented Operation2\n")
}
func hook1() {
print("ConcreteClass2 says: Overridden Hook1\n")
}
}
/// EN: The client code calls the template method to execute the algorithm.
/// Client code does not have to know the concrete class of an object it works
/// with, as long as it works with objects through the interface of their base
/// class.
///
/// RU: Клиентский код вызывает шаблонный метод для выполнения алгоритма.
/// Клиентский код не должен знать конкретный класс объекта, с которым работает,
/// при условии, что он работает с объектами через интерфейс их базового класса.
class Client {
// ...
static func clientCode(use object: AbstractProtocol) {
// ...
object.templateMethod()
// ...
}
// ...
}
/// EN: Let's see how it all works together.
///
/// RU: Давайте посмотрим как всё это будет работать.
class TemplateMethodConceptual: XCTestCase {
func test() {
print("Same client code can work with different subclasses:\n")
Client.clientCode(use: ConcreteClass1())
print("\nSame client code can work with different subclasses:\n")
Client.clientCode(use: ConcreteClass2())
}
}
================================================
FILE: Sources/TemplateMethod/Conceptual/Info.plist
================================================
CFBundleDevelopmentRegion
$(DEVELOPMENT_LANGUAGE)
CFBundleExecutable
$(EXECUTABLE_NAME)
CFBundleIdentifier
$(PRODUCT_BUNDLE_IDENTIFIER)
CFBundleInfoDictionaryVersion
6.0
CFBundleName
$(PRODUCT_NAME)
CFBundlePackageType
BNDL
CFBundleShortVersionString
1.0
CFBundleVersion
1
================================================
FILE: Sources/TemplateMethod/Conceptual/Output.txt
================================================
Same client code can work with different subclasses:
AbstractProtocol says: I am doing the bulk of the work
ConcreteClass1 says: Implemented Operation1
AbstractProtocol says: But I let subclasses override some operations
ConcreteClass1 says: Implemented Operation2
AbstractProtocol says: But I am doing the bulk of the work anyway
ConcreteClass1 says: Overridden Hook2
Same client code can work with different subclasses:
AbstractProtocol says: I am doing the bulk of the work
ConcreteClass2 says: Implemented Operation1
AbstractProtocol says: But I let subclasses override some operations
ConcreteClass2 says: Overridden Hook1
ConcreteClass2 says: Implemented Operation2
AbstractProtocol says: But I am doing the bulk of the work anyway
================================================
FILE: Sources/TemplateMethod/RealWorld/Example.swift
================================================
import XCTest
import AVFoundation
import CoreLocation
import Photos
class TemplateMethodRealWorld: XCTestCase {
/// A good example of Template Method is a life cycle of UIViewController
func testTemplateMethodReal() {
let accessors = [CameraAccessor(), MicrophoneAccessor(), PhotoLibraryAccessor()]
accessors.forEach { item in
item.requestAccessIfNeeded({ status in
let message = status ? "You have access to " : "You do not have access to "
print(message + item.description + "\n")
})
}
}
}
class PermissionAccessor: CustomStringConvertible {
typealias Completion = (Bool) -> ()
func requestAccessIfNeeded(_ completion: @escaping Completion) {
guard !hasAccess() else { completion(true); return }
willReceiveAccess()
requestAccess { status in
status ? self.didReceiveAccess() : self.didRejectAccess()
completion(status)
}
}
func requestAccess(_ completion: @escaping Completion) {
fatalError("Should be overridden")
}
func hasAccess() -> Bool {
fatalError("Should be overridden")
}
var description: String { return "PermissionAccessor" }
/// Hooks
func willReceiveAccess() {}
func didReceiveAccess() {}
func didRejectAccess() {}
}
class CameraAccessor: PermissionAccessor {
override func requestAccess(_ completion: @escaping Completion) {
AVCaptureDevice.requestAccess(for: .video) { status in
return completion(status)
}
}
override func hasAccess() -> Bool {
return AVCaptureDevice.authorizationStatus(for: .video) == .authorized
}
override var description: String { return "Camera" }
}
class MicrophoneAccessor: PermissionAccessor {
override func requestAccess(_ completion: @escaping Completion) {
AVAudioSession.sharedInstance().requestRecordPermission { status in
completion(status)
}
}
override func hasAccess() -> Bool {
return AVAudioSession.sharedInstance().recordPermission == .granted
}
override var description: String { return "Microphone" }
}
class PhotoLibraryAccessor: PermissionAccessor {
override func requestAccess(_ completion: @escaping Completion) {
PHPhotoLibrary.requestAuthorization { status in
completion(status == .authorized)
}
}
override func hasAccess() -> Bool {
return PHPhotoLibrary.authorizationStatus() == .authorized
}
override var description: String { return "PhotoLibrary" }
override func didReceiveAccess() {
/// We want to track how many people give access to the PhotoLibrary.
print("PhotoLibrary Accessor: Receive access. Updating analytics...")
}
override func didRejectAccess() {
/// ... and also we want to track how many people rejected access.
print("PhotoLibrary Accessor: Rejected with access. Updating analytics...")
}
}
================================================
FILE: Sources/TemplateMethod/RealWorld/Info.plist
================================================
CFBundleDevelopmentRegion
$(DEVELOPMENT_LANGUAGE)
CFBundleExecutable
$(EXECUTABLE_NAME)
CFBundleIdentifier
$(PRODUCT_BUNDLE_IDENTIFIER)
CFBundleInfoDictionaryVersion
6.0
CFBundleName
$(PRODUCT_NAME)
CFBundlePackageType
BNDL
CFBundleShortVersionString
1.0
CFBundleVersion
1
================================================
FILE: Sources/TemplateMethod/RealWorld/Output.txt
================================================
You have access to Camera
You have access to Microphone
PhotoLibrary Accessor: Rejected with access. Updating analytics...
You do not have access to PhotoLibrary
================================================
FILE: Sources/Visitor/Conceptual/Example.swift
================================================
/// EN: Visitor Design Pattern
///
/// Intent: Lets you separate algorithms from the objects on which they operate.
///
/// RU: Паттерн Посетитель
///
/// Назначение: Позволяет создавать новые операции, не меняя классы объектов,
/// над которыми эти операции могут выполняться.
import XCTest
/// EN: The Component interface declares an `accept` method that should take the
/// base visitor interface as an argument.
///
/// RU: Интерфейс Компонента объявляет метод принятия, который в качестве
/// аргумента может получать любой объект, реализующий интерфейс посетителя.
protocol Component {
func accept(_ visitor: Visitor)
}
/// EN: Each Concrete Component must implement the `accept` method in such a way
/// that it calls the visitor's method corresponding to the component's class.
///
/// RU: Каждый Конкретный Компонент должен реализовать метод принятия таким
/// образом, чтобы он вызывал метод посетителя, соотвествующий классу
/// компонента.
class ConcreteComponentA: Component {
/// EN: Note that we're calling `visitConcreteComponentA`, which matches the
/// current class name. This way we let the visitor know the class of the
/// component it works with.
///
/// RU: Обратите внимание, мы вызываем visitConcreteComponentA, что
/// соответствует названию текущего класса. Таким образом мы позволяем
/// посетителю узнать, с каким классом компонента он работает.
func accept(_ visitor: Visitor) {
visitor.visitConcreteComponentA(element: self)
}
/// EN: Concrete Components may have special methods that don't exist in
/// their base class or interface. The Visitor is still able to use these
/// methods since it's aware of the component's concrete class.
///
/// RU: Конкретные Компоненты могут иметь особые методы, не объявленные в их
/// базовом классе или интерфейсе. Посетитель всё же может использовать эти
/// методы, поскольку он знает о конкретном классе компонента.
func exclusiveMethodOfConcreteComponentA() -> String {
return "A"
}
}
class ConcreteComponentB: Component {
/// EN: Same here: visitConcreteComponentB => ConcreteComponentB
///
/// RU: То же самое здесь: visitConcreteComponentB => ConcreteComponentB
func accept(_ visitor: Visitor) {
visitor.visitConcreteComponentB(element: self)
}
func specialMethodOfConcreteComponentB() -> String {
return "B"
}
}
/// EN: The Visitor Interface declares a set of visiting methods that correspond
/// to component classes. The signature of a visiting method allows the visitor
/// to identify the exact class of the component that it's dealing with.
///
/// RU: Интерфейс Посетителя объявляет набор методов посещения, соответствующих
/// классам компонентов. Сигнатура метода посещения позволяет посетителю
/// определить конкретный класс компонента, с которым он имеет дело.
protocol Visitor {
func visitConcreteComponentA(element: ConcreteComponentA)
func visitConcreteComponentB(element: ConcreteComponentB)
}
/// EN: Concrete Visitors implement several versions of the same algorithm,
/// which can work with all concrete component classes.
///
/// You can experience the biggest benefit of the Visitor pattern when using it
/// with a complex object structure, such as a Composite tree. In this case, it
/// might be helpful to store some intermediate state of the algorithm while
/// executing visitor's methods over various objects of the structure.
///
/// RU: Конкретные Посетители реализуют несколько версий одного и того же
/// алгоритма, которые могут работать со всеми классами конкретных компонентов.
///
/// Максимальную выгоду от паттерна Посетитель вы почувствуете, используя его со
/// сложной структурой объектов, такой как дерево Компоновщика. В этом случае
/// было бы полезно хранить некоторое промежуточное состояние алгоритма при
/// выполнении методов посетителя над различными объектами структуры.
class ConcreteVisitor1: Visitor {
func visitConcreteComponentA(element: ConcreteComponentA) {
print(element.exclusiveMethodOfConcreteComponentA() + " + ConcreteVisitor1\n")
}
func visitConcreteComponentB(element: ConcreteComponentB) {
print(element.specialMethodOfConcreteComponentB() + " + ConcreteVisitor1\n")
}
}
class ConcreteVisitor2: Visitor {
func visitConcreteComponentA(element: ConcreteComponentA) {
print(element.exclusiveMethodOfConcreteComponentA() + " + ConcreteVisitor2\n")
}
func visitConcreteComponentB(element: ConcreteComponentB) {
print(element.specialMethodOfConcreteComponentB() + " + ConcreteVisitor2\n")
}
}
/// EN: The client code can run visitor operations over any set of elements
/// without figuring out their concrete classes. The accept operation directs a
/// call to the appropriate operation in the visitor object.
///
/// RU: Клиентский код может выполнять операции посетителя над любым набором
/// элементов, не выясняя их конкретных классов. Операция принятия направляет
/// вызов к соответствующей операции в объекте посетителя.
class Client {
// ...
static func clientCode(components: [Component], visitor: Visitor) {
// ...
components.forEach({ $0.accept(visitor) })
// ...
}
// ...
}
/// EN: Let's see how it all works together.
///
/// RU: Давайте посмотрим как всё это будет работать.
class VisitorConceptual: XCTestCase {
func test() {
let components: [Component] = [ConcreteComponentA(), ConcreteComponentB()]
print("The client code works with all visitors via the base Visitor interface:\n")
let visitor1 = ConcreteVisitor1()
Client.clientCode(components: components, visitor: visitor1)
print("\nIt allows the same client code to work with different types of visitors:\n")
let visitor2 = ConcreteVisitor2()
Client.clientCode(components: components, visitor: visitor2)
}
}
================================================
FILE: Sources/Visitor/Conceptual/Info.plist
================================================
CFBundleDevelopmentRegion
$(DEVELOPMENT_LANGUAGE)
CFBundleExecutable
$(EXECUTABLE_NAME)
CFBundleIdentifier
$(PRODUCT_BUNDLE_IDENTIFIER)
CFBundleInfoDictionaryVersion
6.0
CFBundleName
$(PRODUCT_NAME)
CFBundlePackageType
BNDL
CFBundleShortVersionString
1.0
CFBundleVersion
1
================================================
FILE: Sources/Visitor/Conceptual/Output.txt
================================================
The client code works with all visitors via the base Visitor interface:
A + ConcreteVisitor1
B + ConcreteVisitor1
It allows the same client code to work with different types of visitors:
A + ConcreteVisitor2
B + ConcreteVisitor2
================================================
FILE: Sources/Visitor/RealWorld/Example.swift
================================================
import Foundation
import XCTest
protocol Notification: CustomStringConvertible {
func accept(visitor: NotificationPolicy) -> Bool
}
struct Email {
let emailOfSender: String
var description: String { return "Email" }
}
struct SMS {
let phoneNumberOfSender: String
var description: String { return "SMS" }
}
struct Push {
let usernameOfSender: String
var description: String { return "Push" }
}
extension Email: Notification {
func accept(visitor: NotificationPolicy) -> Bool {
return visitor.isTurnedOn(for: self)
}
}
extension SMS: Notification {
func accept(visitor: NotificationPolicy) -> Bool {
return visitor.isTurnedOn(for: self)
}
}
extension Push: Notification {
func accept(visitor: NotificationPolicy) -> Bool {
return visitor.isTurnedOn(for: self)
}
}
protocol NotificationPolicy: CustomStringConvertible {
func isTurnedOn(for email: Email) -> Bool
func isTurnedOn(for sms: SMS) -> Bool
func isTurnedOn(for push: Push) -> Bool
}
class NightPolicyVisitor: NotificationPolicy {
func isTurnedOn(for email: Email) -> Bool {
return false
}
func isTurnedOn(for sms: SMS) -> Bool {
return true
}
func isTurnedOn(for push: Push) -> Bool {
return false
}
var description: String { return "Night Policy Visitor" }
}
class DefaultPolicyVisitor: NotificationPolicy {
func isTurnedOn(for email: Email) -> Bool {
return true
}
func isTurnedOn(for sms: SMS) -> Bool {
return true
}
func isTurnedOn(for push: Push) -> Bool {
return true
}
var description: String { return "Default Policy Visitor" }
}
class BlackListVisitor: NotificationPolicy {
private var bannedEmails = [String]()
private var bannedPhones = [String]()
private var bannedUsernames = [String]()
init(emails: [String], phones: [String], usernames: [String]) {
self.bannedEmails = emails
self.bannedPhones = phones
self.bannedUsernames = usernames
}
func isTurnedOn(for email: Email) -> Bool {
return bannedEmails.contains(email.emailOfSender)
}
func isTurnedOn(for sms: SMS) -> Bool {
return bannedPhones.contains(sms.phoneNumberOfSender)
}
func isTurnedOn(for push: Push) -> Bool {
return bannedUsernames.contains(push.usernameOfSender)
}
var description: String { return "Black List Visitor" }
}
class VisitorRealWorld: XCTestCase {
func testVisitorRealWorld() {
let email = Email(emailOfSender: "some@email.com")
let sms = SMS(phoneNumberOfSender: "+3806700000")
let push = Push(usernameOfSender: "Spammer")
let notifications: [Notification] = [email, sms, push]
clientCode(handle: notifications, with: DefaultPolicyVisitor())
clientCode(handle: notifications, with: NightPolicyVisitor())
}
}
extension VisitorRealWorld {
/// Client code traverses notifications with visitors and checks whether a
/// notification is in a blacklist and should be shown in accordance with a
/// current SilencePolicy
func clientCode(handle notifications: [Notification], with policy: NotificationPolicy) {
let blackList = createBlackList()
print("\nClient: Using \(policy.description) and \(blackList.description)")
notifications.forEach { item in
guard !item.accept(visitor: blackList) else {
print("\tWARNING: " + item.description + " is in a black list")
return
}
if item.accept(visitor: policy) {
print("\t" + item.description + " notification will be shown")
} else {
print("\t" + item.description + " notification will be silenced")
}
}
}
private func createBlackList() -> BlackListVisitor {
return BlackListVisitor(emails: ["banned@email.com"],
phones: ["000000000", "1234325232"],
usernames: ["Spammer"])
}
}
================================================
FILE: Sources/Visitor/RealWorld/Info.plist
================================================
CFBundleDevelopmentRegion
$(DEVELOPMENT_LANGUAGE)
CFBundleExecutable
$(EXECUTABLE_NAME)
CFBundleIdentifier
$(PRODUCT_BUNDLE_IDENTIFIER)
CFBundleInfoDictionaryVersion
6.0
CFBundleName
$(PRODUCT_NAME)
CFBundlePackageType
BNDL
CFBundleShortVersionString
1.0
CFBundleVersion
1
================================================
FILE: Sources/Visitor/RealWorld/Output.txt
================================================
Client: Using Default Policy Visitor and Black List Visitor
Email notification will be shown
SMS notification will be shown
WARNING: Push is in a black list
Client: Using Night Policy Visitor and Black List Visitor
Email notification will be silenced
SMS notification will be shown
WARNING: Push is in a black list