├── Chapter01
└── SwiftBuildingBlocks-master
│ ├── .gitignore
│ ├── 1_YourFirstSwiftProgramme
│ └── Swift Cookbook.playground
│ │ ├── Contents.swift
│ │ └── contents.xcplayground
│ ├── 2_StringsIntsFloatsAndBools
│ └── StringsIntsFloatsAndBools.playground
│ │ ├── Contents.swift
│ │ └── contents.xcplayground
│ ├── 3_OptionalsUnwrapAndForceUnwrap
│ ├── DaysOfTheWeek.playground
│ │ ├── Contents.swift
│ │ └── contents.xcplayground
│ ├── HowManyFingers.playground
│ │ ├── Contents.swift
│ │ └── contents.xcplayground
│ ├── IUOSubtlety.playground
│ │ ├── Contents.swift
│ │ └── contents.xcplayground
│ └── LegalName.playground
│ │ ├── Contents.swift
│ │ └── contents.xcplayground
│ ├── 4_Functions
│ ├── DefaultParameterValues.playground
│ │ ├── Contents.swift
│ │ └── contents.xcplayground
│ ├── FullName.playground
│ │ ├── Contents.swift
│ │ └── contents.xcplayground
│ └── ParameterOverloading.playground
│ │ ├── Contents.swift
│ │ └── contents.xcplayground
│ ├── 5_ObjectClasses
│ ├── MovieReview.playground
│ │ ├── Contents.swift
│ │ └── contents.xcplayground
│ └── PersonFriendsAndFamily.playground
│ │ ├── Contents.swift
│ │ └── contents.xcplayground
│ ├── 6_Structs
│ ├── PersonName.playground
│ │ ├── Contents.swift
│ │ └── contents.xcplayground
│ └── PersonWithPersonName.playground
│ │ ├── Contents.swift
│ │ └── contents.xcplayground
│ ├── 7_Enumerations
│ ├── CompassPoint.playground
│ │ ├── Contents.swift
│ │ └── contents.xcplayground
│ ├── RatingIntBacked.playground
│ │ ├── Contents.swift
│ │ └── contents.xcplayground
│ ├── Title.playground
│ │ ├── Contents.swift
│ │ └── contents.xcplayground
│ ├── TitleAssociatedValue.playground
│ │ ├── Contents.swift
│ │ └── contents.xcplayground
│ ├── TitleComputedProperty.playground
│ │ ├── Contents.swift
│ │ └── contents.xcplayground
│ ├── TitleStringBacked.playground
│ │ ├── Contents.swift
│ │ └── contents.xcplayground
│ └── TitleWithMethod.playground
│ │ ├── Contents.swift
│ │ └── contents.xcplayground
│ ├── 8_Closures
│ ├── ContactClosures.playground
│ │ ├── Contents.swift
│ │ └── contents.xcplayground
│ └── PersonWithSaveClosure.playground
│ │ ├── Contents.swift
│ │ └── contents.xcplayground
│ ├── 9_Protocols
│ └── Saveable.playground
│ │ ├── Contents.swift
│ │ └── contents.xcplayground
│ ├── LICENSE
│ └── README.md
├── Chapter02
└── BuildingOnTheBuildingBlocks-master
│ ├── .gitignore
│ ├── 1_BundlingVariablesIntoTuples
│ ├── MovieReviewNormalisation.playground
│ │ ├── Contents.swift
│ │ └── contents.xcplayground
│ └── MovieReviewNormalisationUsingLabels.playground
│ │ ├── Contents.swift
│ │ └── contents.xcplayground
│ ├── 2_OrderYourDataWithArrays
│ └── MoviesToWatch.playground
│ │ ├── Contents.swift
│ │ └── contents.xcplayground
│ ├── 3_ContainYourDataWithSets
│ ├── AnimalKingdom.playground
│ │ ├── Contents.swift
│ │ └── contents.xcplayground
│ ├── Planets.playground
│ │ ├── Contents.swift
│ │ └── contents.xcplayground
│ └── SetBasics.playground
│ │ ├── Contents.swift
│ │ └── contents.xcplayground
│ ├── 4_StoreKeyValuePairsWithDictionaries
│ ├── EmployeeDirectory.playground
│ │ ├── Contents.swift
│ │ └── contents.xcplayground
│ └── EmployeeDirectoryWithHashableKey.playground
│ │ ├── Contents.swift
│ │ └── contents.xcplayground
│ ├── 5_SubscriptsForCustomTypes
│ └── TicTacToe.playground
│ │ ├── Contents.swift
│ │ └── contents.xcplayground
│ ├── 6_ChangeYourNameWithTypealias
│ ├── ProgrammeFetcher.playground
│ │ ├── Contents.swift
│ │ └── contents.xcplayground
│ ├── ProgrammeFetcherWithTypeAlias.playground
│ │ ├── Contents.swift
│ │ └── contents.xcplayground
│ └── PugGrumble.playground
│ │ ├── Contents.swift
│ │ └── contents.xcplayground
│ ├── 7_PropertyObservers
│ └── UserManager.playground
│ │ ├── Contents.swift
│ │ └── contents.xcplayground
│ ├── 8_ControllingAccessWithAccessControl
│ ├── AccessControl.playground
│ │ ├── Contents.swift
│ │ └── contents.xcplayground
│ ├── AccessControl.xcworkspace
│ │ └── contents.xcworkspacedata
│ └── AppleInc
│ │ ├── AppleInc.xcodeproj
│ │ └── project.pbxproj
│ │ └── AppleInc
│ │ ├── Apple.swift
│ │ ├── AppleInc.h
│ │ ├── AppleStore.swift
│ │ ├── Info.plist
│ │ ├── SecretProductDepartment.swift
│ │ └── SwiftLanguage.swift
│ ├── 9_ExtendingFunctionalityWithExtensions
│ ├── CrewComplement.playground
│ │ ├── Contents.swift
│ │ └── contents.xcplayground
│ └── FirstWord.playground
│ │ ├── Contents.swift
│ │ └── contents.xcplayground
│ └── LICENSE
├── Chapter03
└── DataWranglingWithSwiftControlFlow-master
│ ├── .gitignore
│ ├── 1_MakeDecisionsWithIfElse
│ ├── PoolBallType.playground
│ │ ├── Contents.swift
│ │ └── contents.xcplayground
│ ├── PoolBallTypeConditionalUnwrap.playground
│ │ ├── Contents.swift
│ │ └── contents.xcplayground
│ ├── PoolBallTypeImproved.playground
│ │ ├── Contents.swift
│ │ └── contents.xcplayground
│ ├── PoolFrame.playground
│ │ ├── Contents.swift
│ │ └── contents.xcplayground
│ └── PoolFrameResultWithEnum.playground
│ │ ├── Contents.swift
│ │ └── contents.xcplayground
│ ├── 2_SwitchItUp
│ ├── TextAdventure.playground
│ │ ├── Contents.swift
│ │ └── contents.xcplayground
│ └── TextAdventureImproved.playground
│ │ ├── Contents.swift
│ │ └── contents.xcplayground
│ ├── 3_ForTheLoveOfLoops
│ └── TheBeatles.playground
│ │ ├── Contents.swift
│ │ └── contents.xcplayground
│ ├── 4_WhileLoops
│ └── HeadsOrTails.playground
│ │ ├── Contents.swift
│ │ └── contents.xcplayground
│ ├── 5_TryThrowDoAndCatch
│ ├── Meal.playground
│ │ ├── Contents.swift
│ │ └── contents.xcplayground
│ └── MealAdditional.playground
│ │ ├── Contents.swift
│ │ └── contents.xcplayground
│ ├── 6_CheckUpFrontWithGuard
│ └── Planets.playground
│ │ ├── Contents.swift
│ │ └── contents.xcplayground
│ ├── 7_DoItLaterWithDefer
│ ├── MovieReviewClassifier.playground
│ │ ├── Contents.swift
│ │ └── contents.xcplayground
│ └── MovieReviewClassifierMultipleDefers.playground
│ │ ├── Contents.swift
│ │ └── contents.xcplayground
│ ├── 8_BailOutWithFatalErrorAndPrecondition
│ └── MovieReviewClassifierWithBailOut.playground
│ │ ├── Contents.swift
│ │ └── contents.xcplayground
│ └── LICENSE
├── Chapter04
└── GenericsOperatorsAndNestedTypes-master
│ ├── .gitignore
│ ├── 1_UsingGenericsWithTypes
│ ├── RecentList.playground
│ │ ├── Contents.swift
│ │ └── contents.xcplayground
│ ├── RecentListPrintableList.playground
│ │ ├── Contents.swift
│ │ └── contents.xcplayground
│ └── RecentListWithGenerics.playground
│ │ ├── Contents.swift
│ │ └── contents.xcplayground
│ ├── 2_UsingGenericsWithFunctions
│ └── MakeDuplicates.playground
│ │ ├── Contents.swift
│ │ └── contents.xcplayground
│ ├── 3_UsingGenericsWithProtocols
│ ├── TransportMethod.playground
│ │ ├── Contents.swift
│ │ └── contents.xcplayground
│ └── TransportMethodByRoad.playground
│ │ ├── Contents.swift
│ │ └── contents.xcplayground
│ ├── 4_AdvancedOperators
│ └── BitWiseOperators.playground
│ │ ├── Contents.swift
│ │ └── contents.xcplayground
│ ├── 5_OptionSet
│ └── Devices.playground
│ │ ├── Contents.swift
│ │ └── contents.xcplayground
│ ├── 6_CustomOperators
│ ├── AppendingOperator.playground
│ │ ├── Contents.swift
│ │ └── contents.xcplayground
│ └── AppendingOperatorWithPrecedence.playground
│ │ ├── Contents.swift
│ │ └── contents.xcplayground
│ ├── 7_NestedTypes
│ ├── Device.playground
│ │ ├── Contents.swift
│ │ └── contents.xcplayground
│ └── Operation.playground
│ │ ├── Contents.swift
│ │ └── contents.xcplayground
│ ├── LICENSE
│ └── README.md
├── Chapter05
└── BeyondTheStandardLibrary-master
│ ├── .gitignore
│ ├── 1_Foundation
│ └── NextChristmas.playground
│ │ ├── Contents.swift
│ │ └── contents.xcplayground
│ ├── 2_Networking
│ └── ImageFetcher.playground
│ │ ├── Contents.swift
│ │ └── contents.xcplayground
│ ├── 3_JSON
│ ├── IssueCreator.playground
│ │ ├── Contents.swift
│ │ └── contents.xcplayground
│ ├── PrintRepos.playground
│ │ ├── Contents.swift
│ │ └── contents.xcplayground
│ ├── PrintReposWithCompletionHandler.playground
│ │ ├── Contents.swift
│ │ └── contents.xcplayground
│ └── ResultEnum.playground
│ │ ├── Contents.swift
│ │ └── contents.xcplayground
│ ├── 4_XML
│ ├── XML Reading.playground
│ │ ├── Contents.swift
│ │ └── contents.xcplayground
│ └── XML Writing.playground
│ │ ├── Contents.swift
│ │ └── contents.xcplayground
│ ├── 5_CocoaTouch
│ └── CocoaTouchExample
│ │ ├── CocoaTouchExample.xcodeproj
│ │ ├── project.pbxproj
│ │ └── project.xcworkspace
│ │ │ └── contents.xcworkspacedata
│ │ ├── CocoaTouchExample
│ │ ├── AppDelegate.swift
│ │ ├── Assets.xcassets
│ │ │ └── AppIcon.appiconset
│ │ │ │ └── Contents.json
│ │ ├── Base.lproj
│ │ │ ├── LaunchScreen.storyboard
│ │ │ └── Main.storyboard
│ │ ├── Info.plist
│ │ └── ReposTableViewController.swift
│ │ ├── CocoaTouchExampleTests
│ │ ├── CocoaTouchExampleTests.swift
│ │ └── Info.plist
│ │ └── CocoaTouchExampleUITests
│ │ ├── CocoaTouchExampleUITests.swift
│ │ └── Info.plist
│ ├── LICENSE
│ └── README.md
├── Chapter06
└── SwiftPlaygroundExamples-master
│ ├── .gitignore
│ ├── EmbeddedResource.playground
│ ├── Contents.swift
│ ├── Resources
│ │ └── texture.png
│ └── contents.xcplayground
│ ├── EmbeddedSources.playground
│ ├── Contents.swift
│ ├── Resources
│ │ └── texture.png
│ ├── Sources
│ │ ├── BarChart.swift
│ │ └── Color.swift
│ └── contents.xcplayground
│ ├── LICENSE
│ ├── MultiplePages.playground
│ ├── Pages
│ │ ├── Bitcoin.xcplaygroundpage
│ │ │ └── Contents.swift
│ │ ├── Etherium.xcplaygroundpage
│ │ │ └── Contents.swift
│ │ └── Lightcoin.xcplaygroundpage
│ │ │ └── Contents.swift
│ ├── Resources
│ │ └── texture.png
│ ├── Sources
│ │ ├── BarChart.swift
│ │ └── Color.swift
│ └── contents.xcplayground
│ ├── README.md
│ ├── Simple_iOS.playground
│ ├── Contents.swift
│ └── contents.xcplayground
│ └── Simple_macOS.playground
│ ├── Contents.swift
│ └── contents.xcplayground
├── Chapter07
└── ServerSideSwift-master
│ ├── .gitignore
│ ├── LICENSE
│ ├── README.md
│ ├── TaskAPI
│ ├── .travis.yml
│ ├── Config
│ │ ├── app.json
│ │ ├── crypto.json
│ │ ├── droplet.json
│ │ ├── fluent.json
│ │ └── server.json
│ ├── Package.pins
│ ├── Package.swift
│ ├── Public
│ │ └── .gitkeep
│ ├── README.md
│ ├── Sources
│ │ ├── App
│ │ │ ├── Config+Setup.swift
│ │ │ ├── Controllers
│ │ │ │ └── PostController.swift
│ │ │ ├── Droplet+Setup.swift
│ │ │ ├── Models
│ │ │ │ ├── Post.swift
│ │ │ │ └── Task.swift
│ │ │ └── Routes.swift
│ │ └── Run
│ │ │ └── main.swift
│ ├── TaskAPI.xcodeproj
│ │ ├── AppTests_Info.plist
│ │ ├── App_Info.plist
│ │ ├── BCrypt_Info.plist
│ │ ├── Bits_Info.plist
│ │ ├── Branches_Info.plist
│ │ ├── CHTTP_Info.plist
│ │ ├── CSQLite_Info.plist
│ │ ├── Cache_Info.plist
│ │ ├── Configs_Info.plist
│ │ ├── Console_Info.plist
│ │ ├── Cookies_Info.plist
│ │ ├── Core_Info.plist
│ │ ├── Crypto_Info.plist
│ │ ├── Debugging_Info.plist
│ │ ├── FluentProvider_Info.plist
│ │ ├── FluentTester_Info.plist
│ │ ├── Fluent_Info.plist
│ │ ├── FormData_Info.plist
│ │ ├── GeneratedModuleMap
│ │ │ ├── CHTTP
│ │ │ │ └── module.modulemap
│ │ │ └── CSQLite
│ │ │ │ └── module.modulemap
│ │ ├── HTTP_Info.plist
│ │ ├── JSON_Info.plist
│ │ ├── Multipart_Info.plist
│ │ ├── Node_Info.plist
│ │ ├── PathIndexable_Info.plist
│ │ ├── Random_Info.plist
│ │ ├── Routing_Info.plist
│ │ ├── SMTP_Info.plist
│ │ ├── SQLite_Info.plist
│ │ ├── Sessions_Info.plist
│ │ ├── Sockets_Info.plist
│ │ ├── TLS_Info.plist
│ │ ├── Testing_Info.plist
│ │ ├── Transport_Info.plist
│ │ ├── URI_Info.plist
│ │ ├── Vapor_Info.plist
│ │ ├── WebSockets_Info.plist
│ │ ├── libc_Info.plist
│ │ ├── project.pbxproj
│ │ ├── project.xcworkspace
│ │ │ └── contents.xcworkspacedata
│ │ └── xcshareddata
│ │ │ └── xcschemes
│ │ │ ├── TaskAPI.xcscheme
│ │ │ └── xcschememanagement.plist
│ ├── Tests
│ │ ├── AppTests
│ │ │ ├── PostControllerTests.swift
│ │ │ ├── RouteTests.swift
│ │ │ └── Utilities.swift
│ │ └── LinuxMain.swift
│ ├── circle.yml
│ └── license
│ ├── TaskAPIUsingHeroku
│ ├── .travis.yml
│ ├── Config
│ │ ├── app.json
│ │ ├── crypto.json
│ │ ├── droplet.json
│ │ ├── fluent.json
│ │ ├── secrets
│ │ │ └── postgresql.json
│ │ └── server.json
│ ├── Package.pins
│ ├── Package.resolved
│ ├── Package.swift
│ ├── Procfile
│ ├── Public
│ │ └── .gitkeep
│ ├── README.md
│ ├── Sources
│ │ ├── App
│ │ │ ├── Config+Setup.swift
│ │ │ ├── Controllers
│ │ │ │ ├── PostController.swift
│ │ │ │ └── TaskController.swift
│ │ │ ├── Droplet+Setup.swift
│ │ │ ├── Models
│ │ │ │ ├── Post.swift
│ │ │ │ └── Task.swift
│ │ │ └── Routes.swift
│ │ └── Run
│ │ │ └── main.swift
│ ├── TaskAPI.xcodeproj
│ │ ├── AppTests_Info.plist
│ │ ├── App_Info.plist
│ │ ├── BCrypt_Info.plist
│ │ ├── Bits_Info.plist
│ │ ├── Branches_Info.plist
│ │ ├── CHTTP_Info.plist
│ │ ├── CSQLite_Info.plist
│ │ ├── Cache_Info.plist
│ │ ├── Configs_Info.plist
│ │ ├── Console_Info.plist
│ │ ├── Cookies_Info.plist
│ │ ├── Core_Info.plist
│ │ ├── Crypto_Info.plist
│ │ ├── Debugging_Info.plist
│ │ ├── FluentProvider_Info.plist
│ │ ├── FluentTester_Info.plist
│ │ ├── Fluent_Info.plist
│ │ ├── FormData_Info.plist
│ │ ├── GeneratedModuleMap
│ │ │ ├── CHTTP
│ │ │ │ └── module.modulemap
│ │ │ └── CSQLite
│ │ │ │ └── module.modulemap
│ │ ├── HTTP_Info.plist
│ │ ├── JSON_Info.plist
│ │ ├── Multipart_Info.plist
│ │ ├── Node_Info.plist
│ │ ├── PathIndexable_Info.plist
│ │ ├── PostgreSQLDriver_Info.plist
│ │ ├── PostgreSQLProvider_Info.plist
│ │ ├── PostgreSQL_Info.plist
│ │ ├── Random_Info.plist
│ │ ├── Routing_Info.plist
│ │ ├── SMTP_Info.plist
│ │ ├── SQLite_Info.plist
│ │ ├── Sessions_Info.plist
│ │ ├── Sockets_Info.plist
│ │ ├── TLS_Info.plist
│ │ ├── Testing_Info.plist
│ │ ├── Transport_Info.plist
│ │ ├── URI_Info.plist
│ │ ├── Vapor_Info.plist
│ │ ├── WebSockets_Info.plist
│ │ ├── libc_Info.plist
│ │ ├── project.pbxproj
│ │ ├── project.xcworkspace
│ │ │ └── contents.xcworkspacedata
│ │ └── xcshareddata
│ │ │ └── xcschemes
│ │ │ ├── TaskAPI-Package.xcscheme
│ │ │ ├── TaskAPI.xcscheme
│ │ │ └── xcschememanagement.plist
│ ├── Tests
│ │ ├── AppTests
│ │ │ ├── PostControllerTests.swift
│ │ │ ├── RouteTests.swift
│ │ │ └── Utilities.swift
│ │ └── LinuxMain.swift
│ ├── circle.yml
│ └── license
│ ├── TaskAPIUsingPostgres
│ ├── .travis.yml
│ ├── Config
│ │ ├── app.json
│ │ ├── crypto.json
│ │ ├── droplet.json
│ │ ├── fluent.json
│ │ ├── secrets
│ │ │ └── postgresql.json
│ │ └── server.json
│ ├── Package.pins
│ ├── Package.resolved
│ ├── Package.swift
│ ├── Public
│ │ └── .gitkeep
│ ├── README.md
│ ├── Sources
│ │ ├── App
│ │ │ ├── Config+Setup.swift
│ │ │ ├── Controllers
│ │ │ │ ├── PostController.swift
│ │ │ │ └── TaskController.swift
│ │ │ ├── Droplet+Setup.swift
│ │ │ ├── Models
│ │ │ │ ├── Post.swift
│ │ │ │ └── Task.swift
│ │ │ └── Routes.swift
│ │ └── Run
│ │ │ └── main.swift
│ ├── TaskAPI.xcodeproj
│ │ ├── AppTests_Info.plist
│ │ ├── App_Info.plist
│ │ ├── BCrypt_Info.plist
│ │ ├── Bits_Info.plist
│ │ ├── Branches_Info.plist
│ │ ├── CHTTP_Info.plist
│ │ ├── CSQLite_Info.plist
│ │ ├── Cache_Info.plist
│ │ ├── Configs_Info.plist
│ │ ├── Console_Info.plist
│ │ ├── Cookies_Info.plist
│ │ ├── Core_Info.plist
│ │ ├── Crypto_Info.plist
│ │ ├── Debugging_Info.plist
│ │ ├── FluentProvider_Info.plist
│ │ ├── FluentTester_Info.plist
│ │ ├── Fluent_Info.plist
│ │ ├── FormData_Info.plist
│ │ ├── GeneratedModuleMap
│ │ │ ├── CHTTP
│ │ │ │ └── module.modulemap
│ │ │ └── CSQLite
│ │ │ │ └── module.modulemap
│ │ ├── HTTP_Info.plist
│ │ ├── JSON_Info.plist
│ │ ├── Multipart_Info.plist
│ │ ├── Node_Info.plist
│ │ ├── PathIndexable_Info.plist
│ │ ├── PostgreSQLDriver_Info.plist
│ │ ├── PostgreSQLProvider_Info.plist
│ │ ├── PostgreSQL_Info.plist
│ │ ├── Random_Info.plist
│ │ ├── Routing_Info.plist
│ │ ├── SMTP_Info.plist
│ │ ├── SQLite_Info.plist
│ │ ├── Sessions_Info.plist
│ │ ├── Sockets_Info.plist
│ │ ├── TLS_Info.plist
│ │ ├── Testing_Info.plist
│ │ ├── Transport_Info.plist
│ │ ├── URI_Info.plist
│ │ ├── Vapor_Info.plist
│ │ ├── WebSockets_Info.plist
│ │ ├── libc_Info.plist
│ │ ├── project.pbxproj
│ │ ├── project.xcworkspace
│ │ │ └── contents.xcworkspacedata
│ │ └── xcshareddata
│ │ │ └── xcschemes
│ │ │ ├── TaskAPI-Package.xcscheme
│ │ │ ├── TaskAPI.xcscheme
│ │ │ └── xcschememanagement.plist
│ ├── Tests
│ │ ├── AppTests
│ │ │ ├── PostControllerTests.swift
│ │ │ ├── RouteTests.swift
│ │ │ └── Utilities.swift
│ │ └── LinuxMain.swift
│ ├── circle.yml
│ └── license
│ └── TaskAPIUsingResources
│ ├── .travis.yml
│ ├── Config
│ ├── app.json
│ ├── crypto.json
│ ├── droplet.json
│ ├── fluent.json
│ └── server.json
│ ├── Package.pins
│ ├── Package.swift
│ ├── Public
│ └── .gitkeep
│ ├── README.md
│ ├── Sources
│ ├── App
│ │ ├── Config+Setup.swift
│ │ ├── Controllers
│ │ │ ├── PostController.swift
│ │ │ └── TaskController.swift
│ │ ├── Droplet+Setup.swift
│ │ ├── Models
│ │ │ ├── Post.swift
│ │ │ └── Task.swift
│ │ └── Routes.swift
│ └── Run
│ │ └── main.swift
│ ├── TaskAPI.xcodeproj
│ ├── AppTests_Info.plist
│ ├── App_Info.plist
│ ├── BCrypt_Info.plist
│ ├── Bits_Info.plist
│ ├── Branches_Info.plist
│ ├── CHTTP_Info.plist
│ ├── CSQLite_Info.plist
│ ├── Cache_Info.plist
│ ├── Configs_Info.plist
│ ├── Console_Info.plist
│ ├── Cookies_Info.plist
│ ├── Core_Info.plist
│ ├── Crypto_Info.plist
│ ├── Debugging_Info.plist
│ ├── FluentProvider_Info.plist
│ ├── FluentTester_Info.plist
│ ├── Fluent_Info.plist
│ ├── FormData_Info.plist
│ ├── GeneratedModuleMap
│ │ ├── CHTTP
│ │ │ └── module.modulemap
│ │ └── CSQLite
│ │ │ └── module.modulemap
│ ├── HTTP_Info.plist
│ ├── JSON_Info.plist
│ ├── Multipart_Info.plist
│ ├── Node_Info.plist
│ ├── PathIndexable_Info.plist
│ ├── Random_Info.plist
│ ├── Routing_Info.plist
│ ├── SMTP_Info.plist
│ ├── SQLite_Info.plist
│ ├── Sessions_Info.plist
│ ├── Sockets_Info.plist
│ ├── TLS_Info.plist
│ ├── Testing_Info.plist
│ ├── Transport_Info.plist
│ ├── URI_Info.plist
│ ├── Vapor_Info.plist
│ ├── WebSockets_Info.plist
│ ├── libc_Info.plist
│ ├── project.pbxproj
│ ├── project.xcworkspace
│ │ └── contents.xcworkspacedata
│ └── xcshareddata
│ │ └── xcschemes
│ │ ├── TaskAPI.xcscheme
│ │ └── xcschememanagement.plist
│ ├── Tests
│ ├── AppTests
│ │ ├── PostControllerTests.swift
│ │ ├── RouteTests.swift
│ │ └── Utilities.swift
│ └── LinuxMain.swift
│ ├── circle.yml
│ └── license
├── Chapter08
└── PhotobookCreator-master
│ ├── .gitignore
│ ├── LICENSE
│ ├── PhotobookCreator.xcodeproj
│ ├── project.pbxproj
│ └── project.xcworkspace
│ │ └── contents.xcworkspacedata
│ └── PhotobookCreator
│ ├── AppDelegate.swift
│ ├── Assets.xcassets
│ ├── AppIcon.appiconset
│ │ └── Contents.json
│ └── Contents.json
│ ├── Base.lproj
│ ├── LaunchScreen.storyboard
│ └── Main.storyboard
│ ├── Info.plist
│ ├── Resources
│ └── SamplePhotos
│ │ ├── 2971575403_a95793f8d6_o.jpg
│ │ ├── 318497346_bf7a36cbcd_o.jpg
│ │ ├── 33489304834_202dcc7b05_o.jpg
│ │ └── 7290640736_80e28c782e_o.jpg
│ └── Sources
│ ├── PhotoBookBuilder.swift
│ ├── PhotoCollectionViewController.swift
│ └── PhotoResizer.swift
├── LICENSE
└── README.md
/Chapter01/SwiftBuildingBlocks-master/1_YourFirstSwiftProgramme/Swift Cookbook.playground/Contents.swift:
--------------------------------------------------------------------------------
1 | //: Playground - noun: a place where people can play
2 |
3 | import UIKit
4 |
5 | var str = "Hello, Swift!"
6 |
--------------------------------------------------------------------------------
/Chapter01/SwiftBuildingBlocks-master/1_YourFirstSwiftProgramme/Swift Cookbook.playground/contents.xcplayground:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Chapter01/SwiftBuildingBlocks-master/2_StringsIntsFloatsAndBools/StringsIntsFloatsAndBools.playground/contents.xcplayground:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Chapter01/SwiftBuildingBlocks-master/3_OptionalsUnwrapAndForceUnwrap/DaysOfTheWeek.playground/Contents.swift:
--------------------------------------------------------------------------------
1 |
2 | var dayOfTheWeek: String = "Monday"
3 | dayOfTheWeek = "Tuesday"
4 | dayOfTheWeek = "Wednesday"
5 | dayOfTheWeek = nil // Will not compile
6 |
--------------------------------------------------------------------------------
/Chapter01/SwiftBuildingBlocks-master/3_OptionalsUnwrapAndForceUnwrap/DaysOfTheWeek.playground/contents.xcplayground:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Chapter01/SwiftBuildingBlocks-master/3_OptionalsUnwrapAndForceUnwrap/HowManyFingers.playground/Contents.swift:
--------------------------------------------------------------------------------
1 |
2 | // Start of the game
3 | var numberOfFingersHeldUpByFinn: Int?
4 | // Finn's hand behind his back
5 | numberOfFingersHeldUpByFinn = nil
6 | // Finn shows his hand
7 | numberOfFingersHeldUpByFinn = 3
8 | // Finn puts hand back behind his back
9 | numberOfFingersHeldUpByFinn = nil
10 | // Finn shows his hand
11 | numberOfFingersHeldUpByFinn = 1
12 | print(numberOfFingersHeldUpByFinn ?? "Unknown")
13 | // End of the game
14 | let lastNumberOfFingersHeldUpByFinn: Int = numberOfFingersHeldUpByFinn!
15 |
--------------------------------------------------------------------------------
/Chapter01/SwiftBuildingBlocks-master/3_OptionalsUnwrapAndForceUnwrap/HowManyFingers.playground/contents.xcplayground:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Chapter01/SwiftBuildingBlocks-master/3_OptionalsUnwrapAndForceUnwrap/IUOSubtlety.playground/Contents.swift:
--------------------------------------------------------------------------------
1 |
2 | var input: Int! = 5 // Int!
3 | print(input) // 5
4 | var output1 = input // Int?
5 | print(output1 as Any) // Optional(5)
6 | var output2 = input + 1 // Int
7 | print(output2) // 5
8 |
--------------------------------------------------------------------------------
/Chapter01/SwiftBuildingBlocks-master/3_OptionalsUnwrapAndForceUnwrap/IUOSubtlety.playground/contents.xcplayground:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Chapter01/SwiftBuildingBlocks-master/3_OptionalsUnwrapAndForceUnwrap/LegalName.playground/Contents.swift:
--------------------------------------------------------------------------------
1 |
2 | var legalName: String!
3 | // At birth
4 | legalName = nil
5 | // At birth registration
6 | legalName = "Alissa Jones"
7 | // At enrolling in school
8 | print(legalName)
9 | // At enrolling in college
10 | print(legalName)
11 | // Registering Marriage
12 | legalName = "Alissa Moon"
13 | // When meeting new people
14 | print(legalName)
15 |
--------------------------------------------------------------------------------
/Chapter01/SwiftBuildingBlocks-master/3_OptionalsUnwrapAndForceUnwrap/LegalName.playground/contents.xcplayground:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Chapter01/SwiftBuildingBlocks-master/4_Functions/DefaultParameterValues.playground/Contents.swift:
--------------------------------------------------------------------------------
1 |
2 | func fullName(givenName: String, middleName: String, familyName: String = "Moon") -> String {
3 | return "\(givenName) \(middleName) \(familyName)"
4 | }
5 |
6 | let keith = fullName(givenName: "Keith", middleName: "David")
7 | let alissa = fullName(givenName: "Alissa", middleName: "May")
8 | let laura = fullName(givenName: "Laura", middleName: "May", familyName: "Jones")
9 | print(keith) // Keith David Moon
10 | print(alissa) // Alissa May Moon
11 | print(laura) // Laura May Jones
12 |
--------------------------------------------------------------------------------
/Chapter01/SwiftBuildingBlocks-master/4_Functions/DefaultParameterValues.playground/contents.xcplayground:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Chapter01/SwiftBuildingBlocks-master/4_Functions/FullName.playground/contents.xcplayground:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Chapter01/SwiftBuildingBlocks-master/4_Functions/ParameterOverloading.playground/Contents.swift:
--------------------------------------------------------------------------------
1 |
2 | func combine(_ givenName: String, _ familyName: String) -> String {
3 | return "\(givenName) \(familyName)"
4 | }
5 |
6 | func combine(_ integer1: Int, _ integer2: Int) -> Int {
7 | return integer1+integer2
8 | }
9 |
10 | let combinedString = combine("Finnley", "Moon")
11 | let combinedInt = combine(5, 10)
12 | print(combinedString) // Finnley Moon
13 | print(combinedInt) // 15
14 |
--------------------------------------------------------------------------------
/Chapter01/SwiftBuildingBlocks-master/4_Functions/ParameterOverloading.playground/contents.xcplayground:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Chapter01/SwiftBuildingBlocks-master/5_ObjectClasses/MovieReview.playground/contents.xcplayground:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Chapter01/SwiftBuildingBlocks-master/5_ObjectClasses/PersonFriendsAndFamily.playground/contents.xcplayground:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Chapter01/SwiftBuildingBlocks-master/6_Structs/PersonName.playground/contents.xcplayground:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Chapter01/SwiftBuildingBlocks-master/6_Structs/PersonWithPersonName.playground/contents.xcplayground:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Chapter01/SwiftBuildingBlocks-master/7_Enumerations/CompassPoint.playground/Contents.swift:
--------------------------------------------------------------------------------
1 |
2 | enum CompassPoint {
3 | case North, South, East, West
4 | }
5 |
--------------------------------------------------------------------------------
/Chapter01/SwiftBuildingBlocks-master/7_Enumerations/CompassPoint.playground/contents.xcplayground:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Chapter01/SwiftBuildingBlocks-master/7_Enumerations/RatingIntBacked.playground/Contents.swift:
--------------------------------------------------------------------------------
1 |
2 | enum Rating: Int {
3 | case worst // Infered as 0
4 | case bad // Infered as 1
5 | case average // Infered as 2
6 | case good // Infered as 3
7 | case best // Infered as 4
8 | }
9 |
--------------------------------------------------------------------------------
/Chapter01/SwiftBuildingBlocks-master/7_Enumerations/RatingIntBacked.playground/contents.xcplayground:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Chapter01/SwiftBuildingBlocks-master/7_Enumerations/Title.playground/Contents.swift:
--------------------------------------------------------------------------------
1 |
2 | enum Title {
3 | case mr
4 | case mrs
5 | case mister
6 | case miss
7 | case dr
8 | case prof
9 | case other
10 | }
11 |
12 | let title1 = Title.mr
13 |
14 | let title2: Title
15 | title2 = .mr
16 |
--------------------------------------------------------------------------------
/Chapter01/SwiftBuildingBlocks-master/7_Enumerations/Title.playground/contents.xcplayground:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Chapter01/SwiftBuildingBlocks-master/7_Enumerations/TitleAssociatedValue.playground/Contents.swift:
--------------------------------------------------------------------------------
1 |
2 | enum Title {
3 | case mr
4 | case mrs
5 | case mister
6 | case miss
7 | case dr
8 | case prof
9 | case other(String)
10 | }
11 |
12 | let mister: Title = .mr
13 | let dame: Title = .other("Dame")
14 |
--------------------------------------------------------------------------------
/Chapter01/SwiftBuildingBlocks-master/7_Enumerations/TitleAssociatedValue.playground/contents.xcplayground:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Chapter01/SwiftBuildingBlocks-master/7_Enumerations/TitleComputedProperty.playground/Contents.swift:
--------------------------------------------------------------------------------
1 |
2 | enum Title: String {
3 | case mr = "Mr"
4 | case mrs = "Mrs"
5 | case mister = "Master"
6 | case miss = "Miss"
7 | case dr = "Dr"
8 | case prof = "Prof"
9 | case other // Inferred as "other"
10 |
11 | var isProfessional: Bool {
12 | return self == Title.dr || self == Title.prof
13 | }
14 | }
15 |
16 | let loganTitle = Title.mr
17 | let xavierTitle = Title.prof
18 |
19 | print(loganTitle.isProfessional) // false
20 | print(xavierTitle.isProfessional) // true
21 |
--------------------------------------------------------------------------------
/Chapter01/SwiftBuildingBlocks-master/7_Enumerations/TitleComputedProperty.playground/contents.xcplayground:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Chapter01/SwiftBuildingBlocks-master/7_Enumerations/TitleStringBacked.playground/Contents.swift:
--------------------------------------------------------------------------------
1 |
2 | enum Title: String {
3 | case mr = "Mr"
4 | case mrs = "Mrs"
5 | case mister = "Master"
6 | case miss = "Miss"
7 | case dr = "Dr"
8 | case prof = "Prof"
9 | case other // Inferred as "other"
10 | }
11 |
12 | let title1 = Title.mr
13 | print(title1.rawValue) // "Mr"
14 |
--------------------------------------------------------------------------------
/Chapter01/SwiftBuildingBlocks-master/7_Enumerations/TitleStringBacked.playground/contents.xcplayground:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Chapter01/SwiftBuildingBlocks-master/7_Enumerations/TitleWithMethod.playground/Contents.swift:
--------------------------------------------------------------------------------
1 |
2 | enum Title: String {
3 | case mr = "Mr"
4 | case mrs = "Mrs"
5 | case mister = "Master"
6 | case miss = "Miss"
7 | case dr = "Dr"
8 | case prof = "Prof"
9 | case other // Inferred as "other"
10 | func isProfessional() -> Bool {
11 | return self == Title.dr || self == Title.prof
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/Chapter01/SwiftBuildingBlocks-master/7_Enumerations/TitleWithMethod.playground/contents.xcplayground:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Chapter01/SwiftBuildingBlocks-master/8_Closures/ContactClosures.playground/contents.xcplayground:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Chapter01/SwiftBuildingBlocks-master/8_Closures/PersonWithSaveClosure.playground/contents.xcplayground:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Chapter01/SwiftBuildingBlocks-master/9_Protocols/Saveable.playground/contents.xcplayground:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Chapter01/SwiftBuildingBlocks-master/README.md:
--------------------------------------------------------------------------------
1 | # SwiftBuildingBlocks
2 | Code relating to Chapter 1 of Swift 4 Programming Cookbook
3 |
--------------------------------------------------------------------------------
/Chapter02/BuildingOnTheBuildingBlocks-master/1_BundlingVariablesIntoTuples/MovieReviewNormalisation.playground/contents.xcplayground:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Chapter02/BuildingOnTheBuildingBlocks-master/1_BundlingVariablesIntoTuples/MovieReviewNormalisationUsingLabels.playground/contents.xcplayground:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Chapter02/BuildingOnTheBuildingBlocks-master/2_OrderYourDataWithArrays/MoviesToWatch.playground/contents.xcplayground:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Chapter02/BuildingOnTheBuildingBlocks-master/3_ContainYourDataWithSets/AnimalKingdom.playground/contents.xcplayground:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Chapter02/BuildingOnTheBuildingBlocks-master/3_ContainYourDataWithSets/Planets.playground/Contents.swift:
--------------------------------------------------------------------------------
1 |
2 | let planets: Set = ["Mercury", "Venus", "Earth",
3 | "Mars", "Jupiter", "Saturn",
4 | "Uranus", "Neptune", "Pluto"]
5 | //planets.remove("Pluto") // Doesn't compile
6 |
--------------------------------------------------------------------------------
/Chapter02/BuildingOnTheBuildingBlocks-master/3_ContainYourDataWithSets/Planets.playground/contents.xcplayground:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Chapter02/BuildingOnTheBuildingBlocks-master/3_ContainYourDataWithSets/SetBasics.playground/contents.xcplayground:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Chapter02/BuildingOnTheBuildingBlocks-master/4_StoreKeyValuePairsWithDictionaries/EmployeeDirectory.playground/contents.xcplayground:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Chapter02/BuildingOnTheBuildingBlocks-master/4_StoreKeyValuePairsWithDictionaries/EmployeeDirectoryWithHashableKey.playground/contents.xcplayground:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Chapter02/BuildingOnTheBuildingBlocks-master/5_SubscriptsForCustomTypes/TicTacToe.playground/contents.xcplayground:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Chapter02/BuildingOnTheBuildingBlocks-master/6_ChangeYourNameWithTypealias/ProgrammeFetcher.playground/Contents.swift:
--------------------------------------------------------------------------------
1 |
2 | enum Channel {
3 | case BBC1
4 | case BBC2
5 | case BBCNews
6 | //...
7 | }
8 |
9 | class ProgrammeFetcher {
10 |
11 | func fetchCurrentProgrammeName(forChannel channel: Channel, resultHandler: (String?, Error?) -> Void) {
12 | // ...
13 | // Do the work to get the current programme
14 | // ...
15 | let programmeName = "Sherlock"
16 | resultHandler(programmeName, nil)
17 | }
18 |
19 | func fetchNextProgrammeName(forChannel channel: Channel, resultHandler: (String?, Error?) -> Void) {
20 | // ...
21 | // Do the work to get the next programme
22 | // ...
23 | let programmeName = "Luther"
24 | resultHandler(programmeName, nil)
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/Chapter02/BuildingOnTheBuildingBlocks-master/6_ChangeYourNameWithTypealias/ProgrammeFetcher.playground/contents.xcplayground:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Chapter02/BuildingOnTheBuildingBlocks-master/6_ChangeYourNameWithTypealias/ProgrammeFetcherWithTypeAlias.playground/contents.xcplayground:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Chapter02/BuildingOnTheBuildingBlocks-master/6_ChangeYourNameWithTypealias/PugGrumble.playground/Contents.swift:
--------------------------------------------------------------------------------
1 |
2 | struct Pug {
3 | let name: String
4 | }
5 |
6 | let pugs = [Pug]()
7 |
8 | typealias Grumble = [Pug]
9 |
10 | var grumble = Grumble()
11 |
12 | let marty = Pug(name: "Marty McPug")
13 | let wolfie = Pug(name: "Wolfgang Pug")
14 | let poppy = Pug(name: "Poppy")
15 | let rudy = Pug(name: "Rudy")
16 | grumble.append(marty)
17 | grumble.append(wolfie)
18 | grumble.append(poppy)
19 | grumble.append(rudy)
20 |
--------------------------------------------------------------------------------
/Chapter02/BuildingOnTheBuildingBlocks-master/6_ChangeYourNameWithTypealias/PugGrumble.playground/contents.xcplayground:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Chapter02/BuildingOnTheBuildingBlocks-master/7_PropertyObservers/UserManager.playground/contents.xcplayground:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Chapter02/BuildingOnTheBuildingBlocks-master/8_ControllingAccessWithAccessControl/AccessControl.playground/contents.xcplayground:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Chapter02/BuildingOnTheBuildingBlocks-master/8_ControllingAccessWithAccessControl/AccessControl.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/Chapter02/BuildingOnTheBuildingBlocks-master/8_ControllingAccessWithAccessControl/AppleInc/AppleInc/AppleInc.h:
--------------------------------------------------------------------------------
1 | //
2 | // AppleInc.h
3 | // AppleInc
4 | //
5 | // Created by Keith Moon on 07/07/2017.
6 | // Copyright © 2017 Data Ninjitsu. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | //! Project version number for AppleInc.
12 | FOUNDATION_EXPORT double AppleIncVersionNumber;
13 |
14 | //! Project version string for AppleInc.
15 | FOUNDATION_EXPORT const unsigned char AppleIncVersionString[];
16 |
17 | // In this header, you should import all the public headers of your framework using statements like #import
18 |
19 |
20 |
--------------------------------------------------------------------------------
/Chapter02/BuildingOnTheBuildingBlocks-master/8_ControllingAccessWithAccessControl/AppleInc/AppleInc/SecretProductDepartment.swift:
--------------------------------------------------------------------------------
1 |
2 | class SecretProductDepartment {
3 |
4 | private var secretCodeWord = "Titan"
5 | private var secretProducts = ["iPhone 8",
6 | "Apple Car",
7 | "Apple Brain Implant",
8 | "Apple Spaceship"]
9 |
10 | func nextProduct(givenCodeWord codeWord: String) -> String? {
11 | let codeCorrect = codeWord == secretCodeWord
12 | return codeCorrect ? secretProducts.first : nil
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/Chapter02/BuildingOnTheBuildingBlocks-master/8_ControllingAccessWithAccessControl/AppleInc/AppleInc/SwiftLanguage.swift:
--------------------------------------------------------------------------------
1 |
2 | open class SwiftLanguage {
3 |
4 | open func versionNumber() -> Float {
5 | return 4.0
6 | }
7 |
8 | open func supportedPlatforms() -> [String] {
9 | return ["iOS", "macOSX", "tvOS", "watchOS", "Linux"]
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/Chapter02/BuildingOnTheBuildingBlocks-master/9_ExtendingFunctionalityWithExtensions/CrewComplement.playground/contents.xcplayground:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Chapter02/BuildingOnTheBuildingBlocks-master/9_ExtendingFunctionalityWithExtensions/FirstWord.playground/Contents.swift:
--------------------------------------------------------------------------------
1 |
2 | extension String {
3 | func firstWord() -> String {
4 | let firstSpace = index(of: " ") ?? endIndex
5 | let firstNameSubString = prefix(upTo: firstSpace)
6 | return String(firstNameSubString)
7 | }
8 | }
9 |
10 | let llap = "Live long, and prosper"
11 | let firstWord = llap.firstWord()
12 | print(firstWord) // Live
13 |
--------------------------------------------------------------------------------
/Chapter02/BuildingOnTheBuildingBlocks-master/9_ExtendingFunctionalityWithExtensions/FirstWord.playground/contents.xcplayground:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Chapter03/DataWranglingWithSwiftControlFlow-master/1_MakeDecisionsWithIfElse/PoolBallType.playground/Contents.swift:
--------------------------------------------------------------------------------
1 |
2 | enum PoolBallType {
3 | case solid
4 | case stripe
5 | case black
6 | }
7 |
8 | func poolBallType(forNumber number: Int) -> PoolBallType {
9 | if number < 8 {
10 | return .solid
11 | } else if number > 8 {
12 | return .stripe
13 | } else {
14 | return .black
15 | }
16 | }
17 |
18 | let two = poolBallType(forNumber: 2) // .solid
19 | let eight = poolBallType(forNumber: 8) // .black
20 | let twelve = poolBallType(forNumber: 12) // .stripe
21 |
22 | // Not ideal
23 | let zero = poolBallType(forNumber: 0) // .solid
24 | let sixteen = poolBallType(forNumber: 16) // .stripe
25 |
--------------------------------------------------------------------------------
/Chapter03/DataWranglingWithSwiftControlFlow-master/1_MakeDecisionsWithIfElse/PoolBallType.playground/contents.xcplayground:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Chapter03/DataWranglingWithSwiftControlFlow-master/1_MakeDecisionsWithIfElse/PoolBallTypeConditionalUnwrap.playground/contents.xcplayground:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Chapter03/DataWranglingWithSwiftControlFlow-master/1_MakeDecisionsWithIfElse/PoolBallTypeImproved.playground/Contents.swift:
--------------------------------------------------------------------------------
1 |
2 | enum PoolBallType {
3 | case solid
4 | case stripe
5 | case black
6 | }
7 |
8 | func poolBallType(forNumber number: Int) -> PoolBallType? {
9 | if number > 0 && number < 8 {
10 | return .solid
11 | } else if number > 8 && number < 16 {
12 | return .stripe
13 | } else if number == 8 {
14 | return .black
15 | } else {
16 | return nil
17 | }
18 | }
19 |
20 | let two = poolBallType(forNumber: 2) // .solid
21 | let eight = poolBallType(forNumber: 8) // .black
22 | let twelve = poolBallType(forNumber: 12) // .stripe
23 | let zero = poolBallType(forNumber: 0) // nil
24 | let sixteen = poolBallType(forNumber: 16) // nil
25 |
--------------------------------------------------------------------------------
/Chapter03/DataWranglingWithSwiftControlFlow-master/1_MakeDecisionsWithIfElse/PoolBallTypeImproved.playground/contents.xcplayground:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Chapter03/DataWranglingWithSwiftControlFlow-master/1_MakeDecisionsWithIfElse/PoolFrame.playground/contents.xcplayground:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Chapter03/DataWranglingWithSwiftControlFlow-master/1_MakeDecisionsWithIfElse/PoolFrameResultWithEnum.playground/Contents.swift:
--------------------------------------------------------------------------------
1 |
2 | enum Result {
3 | case win(congratulationsMessage: String)
4 | case lose(commiserationsMessage: String)
5 | }
6 |
7 | func printMessage(forResult result: Result) {
8 | if case Result.win(congratulationsMessage: let winString) = result {
9 | print("You won! \(winString)")
10 | } else if case Result.lose(commiserationsMessage: let loseString) = result {
11 | print("You lost :( \(loseString)")
12 | }
13 | }
14 |
15 | let result = Result.win(congratulationsMessage: "You're simply the best!")
16 | printMessage(forResult: result) // You won! You're simply the best!
17 |
--------------------------------------------------------------------------------
/Chapter03/DataWranglingWithSwiftControlFlow-master/1_MakeDecisionsWithIfElse/PoolFrameResultWithEnum.playground/contents.xcplayground:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Chapter03/DataWranglingWithSwiftControlFlow-master/2_SwitchItUp/TextAdventure.playground/contents.xcplayground:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Chapter03/DataWranglingWithSwiftControlFlow-master/2_SwitchItUp/TextAdventureImproved.playground/contents.xcplayground:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Chapter03/DataWranglingWithSwiftControlFlow-master/3_ForTheLoveOfLoops/TheBeatles.playground/Contents.swift:
--------------------------------------------------------------------------------
1 |
2 | let theBeatles = ["John", "Paul", "George", "Ringo"]
3 |
4 | for musician in theBeatles {
5 | print(musician)
6 | }
7 |
8 | // 5 times table
9 | for value in 1...12 {
10 | print("5 x \(value) = \(value*5)")
11 | }
12 |
13 | let beatlesByInstrument = ["rhythm guitar": "John",
14 | "bass guitar": "Paul",
15 | "lead guitar": "George",
16 | "drums": "Ringo"]
17 |
18 | for (key, value) in beatlesByInstrument {
19 | print("\(value) plays \(key)")
20 | }
21 |
--------------------------------------------------------------------------------
/Chapter03/DataWranglingWithSwiftControlFlow-master/3_ForTheLoveOfLoops/TheBeatles.playground/contents.xcplayground:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Chapter03/DataWranglingWithSwiftControlFlow-master/4_WhileLoops/HeadsOrTails.playground/Contents.swift:
--------------------------------------------------------------------------------
1 |
2 | import Foundation
3 |
4 | enum CoinFlip: Int {
5 | case heads
6 | case tails
7 |
8 | static func flipCoin() -> CoinFlip {
9 | return CoinFlip(rawValue: Int(arc4random_uniform(2)))!
10 | }
11 | }
12 |
13 | func howManyHeadsInARow() -> Int {
14 |
15 | var numberOfHeadsInARow = 0
16 |
17 | while CoinFlip.flipCoin() == .heads {
18 | numberOfHeadsInARow = numberOfHeadsInARow + 1
19 | }
20 | return numberOfHeadsInARow
21 | }
22 |
23 | let noOfHeads = howManyHeadsInARow()
24 |
--------------------------------------------------------------------------------
/Chapter03/DataWranglingWithSwiftControlFlow-master/4_WhileLoops/HeadsOrTails.playground/contents.xcplayground:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Chapter03/DataWranglingWithSwiftControlFlow-master/5_TryThrowDoAndCatch/Meal.playground/contents.xcplayground:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Chapter03/DataWranglingWithSwiftControlFlow-master/5_TryThrowDoAndCatch/MealAdditional.playground/contents.xcplayground:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Chapter03/DataWranglingWithSwiftControlFlow-master/6_CheckUpFrontWithGuard/Planets.playground/contents.xcplayground:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Chapter03/DataWranglingWithSwiftControlFlow-master/7_DoItLaterWithDefer/MovieReviewClassifier.playground/contents.xcplayground:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Chapter03/DataWranglingWithSwiftControlFlow-master/7_DoItLaterWithDefer/MovieReviewClassifierMultipleDefers.playground/contents.xcplayground:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Chapter03/DataWranglingWithSwiftControlFlow-master/8_BailOutWithFatalErrorAndPrecondition/MovieReviewClassifierWithBailOut.playground/contents.xcplayground:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Chapter04/GenericsOperatorsAndNestedTypes-master/1_UsingGenericsWithTypes/RecentList.playground/contents.xcplayground:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Chapter04/GenericsOperatorsAndNestedTypes-master/1_UsingGenericsWithTypes/RecentListPrintableList.playground/contents.xcplayground:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Chapter04/GenericsOperatorsAndNestedTypes-master/1_UsingGenericsWithTypes/RecentListWithGenerics.playground/contents.xcplayground:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Chapter04/GenericsOperatorsAndNestedTypes-master/2_UsingGenericsWithFunctions/MakeDuplicates.playground/Contents.swift:
--------------------------------------------------------------------------------
1 |
2 | func makeDuplicates(of item: ItemType, withKeys keys: Set) -> [String: ItemType] {
3 |
4 | var duplicates = [String: ItemType]()
5 | for key in keys {
6 | duplicates[key] = item
7 | }
8 | return duplicates
9 | }
10 |
11 | let awards: Set = ["Director",
12 | "Cinematography",
13 | "Film Editing",
14 | "Visual Effects",
15 | "Original Music Score",
16 | "Sound Editing",
17 | "Sound Mixing"]
18 | let oscars2014 = makeDuplicates(of: "Gravity", withKeys: awards)
19 | print(oscars2014["Director"] ?? "Unknown") // Gravity
20 | print(oscars2014["Visual Effects"] ?? "Unknown") // Gravity
21 |
--------------------------------------------------------------------------------
/Chapter04/GenericsOperatorsAndNestedTypes-master/2_UsingGenericsWithFunctions/MakeDuplicates.playground/contents.xcplayground:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Chapter04/GenericsOperatorsAndNestedTypes-master/3_UsingGenericsWithProtocols/TransportMethod.playground/contents.xcplayground:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Chapter04/GenericsOperatorsAndNestedTypes-master/3_UsingGenericsWithProtocols/TransportMethodByRoad.playground/contents.xcplayground:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Chapter04/GenericsOperatorsAndNestedTypes-master/4_AdvancedOperators/BitWiseOperators.playground/contents.xcplayground:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Chapter04/GenericsOperatorsAndNestedTypes-master/5_OptionSet/Devices.playground/contents.xcplayground:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Chapter04/GenericsOperatorsAndNestedTypes-master/6_CustomOperators/AppendingOperator.playground/contents.xcplayground:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Chapter04/GenericsOperatorsAndNestedTypes-master/6_CustomOperators/AppendingOperatorWithPrecedence.playground/contents.xcplayground:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Chapter04/GenericsOperatorsAndNestedTypes-master/7_NestedTypes/Device.playground/contents.xcplayground:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Chapter04/GenericsOperatorsAndNestedTypes-master/7_NestedTypes/Operation.playground/Contents.swift:
--------------------------------------------------------------------------------
1 |
2 | class Operation {
3 |
4 | let doctorsName: String
5 | let patientsName: String
6 |
7 | init(doctorsName: String, patientsName: String) {
8 | self.doctorsName = doctorsName
9 | self.patientsName = patientsName
10 | }
11 | }
12 |
13 | import Foundation
14 |
15 | let medicalOperation = Operation(doctorsName: "Dr. Crusher", patientsName: "Commander Riker")
16 | let longRunningOperation = Foundation.Operation()
17 |
--------------------------------------------------------------------------------
/Chapter04/GenericsOperatorsAndNestedTypes-master/7_NestedTypes/Operation.playground/contents.xcplayground:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Chapter04/GenericsOperatorsAndNestedTypes-master/README.md:
--------------------------------------------------------------------------------
1 | # GenericsOperatorsAndNestedTypes
2 | Code relating to Chapter 4 of Swift 4 Programming Cookbook
3 |
--------------------------------------------------------------------------------
/Chapter05/BeyondTheStandardLibrary-master/1_Foundation/NextChristmas.playground/contents.xcplayground:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Chapter05/BeyondTheStandardLibrary-master/2_Networking/ImageFetcher.playground/Contents.swift:
--------------------------------------------------------------------------------
1 |
2 | import Foundation
3 | import PlaygroundSupport
4 | import UIKit
5 |
6 | PlaygroundPage.current.needsIndefiniteExecution = true
7 |
8 | let config = URLSessionConfiguration.default
9 | let session = URLSession(configuration: config)
10 |
11 | let urlString = "https://imgs.xkcd.com/comics/api.png"
12 | let url = URL(string: urlString)!
13 | let request = URLRequest(url: url)
14 |
15 | let task = session.dataTask(with: request) { (data, response, error) in
16 |
17 | guard let imageData = data else {
18 | return // No Image, handle error
19 | }
20 | let image = UIImage(data: imageData)
21 | }
22 | task.resume()
23 |
--------------------------------------------------------------------------------
/Chapter05/BeyondTheStandardLibrary-master/2_Networking/ImageFetcher.playground/contents.xcplayground:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Chapter05/BeyondTheStandardLibrary-master/3_JSON/IssueCreator.playground/contents.xcplayground:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Chapter05/BeyondTheStandardLibrary-master/3_JSON/PrintRepos.playground/contents.xcplayground:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Chapter05/BeyondTheStandardLibrary-master/3_JSON/PrintReposWithCompletionHandler.playground/contents.xcplayground:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Chapter05/BeyondTheStandardLibrary-master/3_JSON/ResultEnum.playground/contents.xcplayground:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Chapter05/BeyondTheStandardLibrary-master/4_XML/XML Reading.playground/contents.xcplayground:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Chapter05/BeyondTheStandardLibrary-master/4_XML/XML Writing.playground/contents.xcplayground:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Chapter05/BeyondTheStandardLibrary-master/5_CocoaTouch/CocoaTouchExample/CocoaTouchExample.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Chapter05/BeyondTheStandardLibrary-master/5_CocoaTouch/CocoaTouchExample/CocoaTouchExampleTests/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | BNDL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleVersion
20 | 1
21 |
22 |
23 |
--------------------------------------------------------------------------------
/Chapter05/BeyondTheStandardLibrary-master/5_CocoaTouch/CocoaTouchExample/CocoaTouchExampleUITests/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | BNDL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleVersion
20 | 1
21 |
22 |
23 |
--------------------------------------------------------------------------------
/Chapter05/BeyondTheStandardLibrary-master/README.md:
--------------------------------------------------------------------------------
1 | # BeyondTheStandardLibrary
2 | Code relating to Chapter 5 of Swift 4 Programming Cookbook
3 |
--------------------------------------------------------------------------------
/Chapter06/SwiftPlaygroundExamples-master/EmbeddedResource.playground/Resources/texture.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PacktPublishing/Swift-4-Programming-Cookbook/145d868a918517d0eaed55a1fd7a18ce25667e3d/Chapter06/SwiftPlaygroundExamples-master/EmbeddedResource.playground/Resources/texture.png
--------------------------------------------------------------------------------
/Chapter06/SwiftPlaygroundExamples-master/EmbeddedResource.playground/contents.xcplayground:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Chapter06/SwiftPlaygroundExamples-master/EmbeddedSources.playground/Contents.swift:
--------------------------------------------------------------------------------
1 | //: Playground - noun: a place where people can play
2 |
3 | import PlaygroundSupport
4 | import UIKit
5 |
6 | let barView = BarChart(frame: CGRect(x: 0, y: 0, width: 300, height: 300))
7 | barView.backgroundColor = .white
8 |
9 | let bar1 = Bar(value: 20, color: Color(red: 1, green: 0, blue: 0))
10 | let bar2 = Bar(value: 40, color: Color(red: 0, green: 1, blue: 0))
11 | let bar3 = Bar(value: 25, color: Color(red: 0, green: 0, blue: 1))
12 |
13 | barView.bars = [bar1, bar2, bar3]
14 |
15 | PlaygroundPage.current.liveView = barView
16 |
--------------------------------------------------------------------------------
/Chapter06/SwiftPlaygroundExamples-master/EmbeddedSources.playground/Resources/texture.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PacktPublishing/Swift-4-Programming-Cookbook/145d868a918517d0eaed55a1fd7a18ce25667e3d/Chapter06/SwiftPlaygroundExamples-master/EmbeddedSources.playground/Resources/texture.png
--------------------------------------------------------------------------------
/Chapter06/SwiftPlaygroundExamples-master/EmbeddedSources.playground/Sources/Color.swift:
--------------------------------------------------------------------------------
1 | import UIKit
2 |
3 | public struct Color {
4 | let red: Float
5 | let green: Float
6 | let blue: Float
7 | let alpha: Float
8 |
9 | public init(red: Float, green: Float, blue: Float, alpha: Float = 1.0) {
10 | self.red = red
11 | self.green = green
12 | self.blue = blue
13 | self.alpha = alpha
14 | }
15 |
16 | var displayColor: UIColor {
17 | return UIColor(red: CGFloat(red),
18 | green: CGFloat(green),
19 | blue: CGFloat(blue),
20 | alpha: CGFloat(alpha))
21 | }
22 | }
23 |
24 |
--------------------------------------------------------------------------------
/Chapter06/SwiftPlaygroundExamples-master/EmbeddedSources.playground/contents.xcplayground:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Chapter06/SwiftPlaygroundExamples-master/MultiplePages.playground/Pages/Etherium.xcplaygroundpage/Contents.swift:
--------------------------------------------------------------------------------
1 | //: [Previous: Bitcoin](@previous)
2 |
3 | import PlaygroundSupport
4 | import UIKit
5 |
6 | let barView = BarChart(frame: CGRect(x: 0, y: 0, width: 300, height: 300))
7 | barView.backgroundColor = .white
8 |
9 | let blue = Color(red: 0, green: 0, blue: 1, alpha: 1.0)
10 |
11 | let jan2017 = Bar(value: 8.06, color: blue)
12 | let feb2017 = Bar(value: 10.70, color: blue)
13 | let mar2017 = Bar(value: 17.17, color: blue)
14 | let apr2017 = Bar(value: 50.43, color: blue)
15 | let may2017 = Bar(value: 76.85, color: blue)
16 | let jun2017 = Bar(value: 230.15, color: blue)
17 |
18 | barView.bars = [jan2017, feb2017, mar2017, apr2017, may2017, jun2017]
19 |
20 | PlaygroundPage.current.liveView = barView
21 |
22 |
23 | //: [Next: Lightcoin](@next)
24 |
--------------------------------------------------------------------------------
/Chapter06/SwiftPlaygroundExamples-master/MultiplePages.playground/Pages/Lightcoin.xcplaygroundpage/Contents.swift:
--------------------------------------------------------------------------------
1 | //: [Previous](@previous)
2 |
3 | import PlaygroundSupport
4 | import UIKit
5 |
6 | let barView = BarChart(frame: CGRect(x: 0, y: 0, width: 300, height: 300))
7 | barView.backgroundColor = .white
8 |
9 | let red = Color(red: 1, green: 0, blue: 0, alpha: 1.0)
10 |
11 | let jan2017 = Bar(value: 4.32, color: red)
12 | let feb2017 = Bar(value: 3.99, color: red)
13 | let mar2017 = Bar(value: 3.77, color: red)
14 | let apr2017 = Bar(value: 7.43, color: red)
15 | let may2017 = Bar(value: 15.42, color: red)
16 | let jun2017 = Bar(value: 26.44, color: red)
17 |
18 | barView.bars = [jan2017, feb2017, mar2017, apr2017, may2017, jun2017]
19 |
20 | PlaygroundPage.current.liveView = barView
21 |
--------------------------------------------------------------------------------
/Chapter06/SwiftPlaygroundExamples-master/MultiplePages.playground/Resources/texture.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PacktPublishing/Swift-4-Programming-Cookbook/145d868a918517d0eaed55a1fd7a18ce25667e3d/Chapter06/SwiftPlaygroundExamples-master/MultiplePages.playground/Resources/texture.png
--------------------------------------------------------------------------------
/Chapter06/SwiftPlaygroundExamples-master/MultiplePages.playground/Sources/Color.swift:
--------------------------------------------------------------------------------
1 | import UIKit
2 |
3 | public struct Color {
4 | let red: Float
5 | let green: Float
6 | let blue: Float
7 | let alpha: Float
8 |
9 | public init(red: Float, green: Float, blue: Float, alpha: Float = 1.0) {
10 | self.red = red
11 | self.green = green
12 | self.blue = blue
13 | self.alpha = alpha
14 | }
15 |
16 | var displayColor: UIColor {
17 | return UIColor(red: CGFloat(red),
18 | green: CGFloat(green),
19 | blue: CGFloat(blue),
20 | alpha: CGFloat(alpha))
21 | }
22 | }
23 |
24 |
--------------------------------------------------------------------------------
/Chapter06/SwiftPlaygroundExamples-master/MultiplePages.playground/contents.xcplayground:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Chapter06/SwiftPlaygroundExamples-master/README.md:
--------------------------------------------------------------------------------
1 | # SwiftPlaygroundExamples
2 | Example of different types of Swift Playgrounds
3 |
--------------------------------------------------------------------------------
/Chapter06/SwiftPlaygroundExamples-master/Simple_iOS.playground/contents.xcplayground:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Chapter06/SwiftPlaygroundExamples-master/Simple_macOS.playground/contents.xcplayground:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/README.md:
--------------------------------------------------------------------------------
1 | # ServerSideSwift
2 | Code relating to Chapter 7 of Swift 4 Programming Cookbook
3 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPI/.travis.yml:
--------------------------------------------------------------------------------
1 | os:
2 | - linux
3 | - osx
4 | language: generic
5 | sudo: required
6 | dist: trusty
7 |
8 | osx_image: xcode8.3
9 | before_install:
10 | - if [ $TRAVIS_OS_NAME == "osx" ]; then
11 | brew tap vapor/tap;
12 | brew update;
13 | brew install vapor;
14 | else
15 | eval "$(curl -sL https://apt.vapor.sh)";
16 | sudo apt-get install vapor;
17 | sudo chmod -R a+rx /usr/;
18 | fi
19 |
20 | script:
21 | - swift build
22 | - swift build -c release
23 | - swift test
24 |
25 | after_success:
26 | - eval "$(curl -sL https://swift.vapor.sh/codecov)"
27 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPI/Config/app.json:
--------------------------------------------------------------------------------
1 | {
2 | "foo": "foo-bar"
3 | }
4 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPI/Config/crypto.json:
--------------------------------------------------------------------------------
1 | {
2 | "hash": {
3 | "method": "sha256",
4 | "encoding": "hex",
5 | "key": "0000000000000000"
6 | },
7 |
8 | "cipher": {
9 | "method": "aes256",
10 | "encoding": "base64",
11 | "key": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA="
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPI/Config/server.json:
--------------------------------------------------------------------------------
1 | {
2 | "//": "The $PORT:8080 call tells the json file to see if there",
3 | "//": "is any value at the 'PORT' environment variable.",
4 | "//": "If there is no value there, it will fallback to '8080'",
5 | "port": "$PORT:8080",
6 |
7 | "host": "0.0.0.0",
8 |
9 | "//": "It's very rare that a server manages its own TLS.",
10 | "//": "More commonly, vapor is served behind a proxy like nginx.",
11 | "securityLayer": "none"
12 | }
13 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPI/Package.swift:
--------------------------------------------------------------------------------
1 | import PackageDescription
2 |
3 | let package = Package(
4 | name: "TaskAPI",
5 | targets: [
6 | Target(name: "App"),
7 | Target(name: "Run", dependencies: ["App"]),
8 | ],
9 | dependencies: [
10 | .Package(url: "https://github.com/vapor/vapor.git", majorVersion: 2),
11 | .Package(url: "https://github.com/vapor/fluent-provider.git", majorVersion: 1)
12 | ],
13 | exclude: [
14 | "Config",
15 | "Database",
16 | "Localization",
17 | "Public",
18 | "Resources",
19 | ]
20 | )
21 |
22 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPI/Public/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PacktPublishing/Swift-4-Programming-Cookbook/145d868a918517d0eaed55a1fd7a18ce25667e3d/Chapter07/ServerSideSwift-master/TaskAPI/Public/.gitkeep
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPI/Sources/App/Config+Setup.swift:
--------------------------------------------------------------------------------
1 | import FluentProvider
2 |
3 | extension Config {
4 | public func setup() throws {
5 | // allow fuzzy conversions for these types
6 | // (add your own types here)
7 | Node.fuzzy = [Row.self, JSON.self, Node.self]
8 |
9 | try setupProviders()
10 | try setupPreparations()
11 | }
12 |
13 | /// Configure providers
14 | private func setupProviders() throws {
15 | try addProvider(FluentProvider.Provider.self)
16 | }
17 |
18 | /// Add all models that should have their
19 | /// schemas prepared before the app boots
20 | private func setupPreparations() throws {
21 | preparations.append(Post.self)
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPI/Sources/App/Droplet+Setup.swift:
--------------------------------------------------------------------------------
1 | @_exported import Vapor
2 |
3 | extension Droplet {
4 | public func setup() throws {
5 | try setupRoutes()
6 | // Do any additional droplet setup
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPI/Sources/Run/main.swift:
--------------------------------------------------------------------------------
1 | import App
2 |
3 | /// We have isolated all of our App's logic into
4 | /// the App module because it makes our app
5 | /// more testable.
6 | ///
7 | /// In general, the executable portion of our App
8 | /// shouldn't include much more code than is presented
9 | /// here.
10 | ///
11 | /// We simply initialize our Droplet, optionally
12 | /// passing in values if necessary
13 | /// Then, we pass it to our App's setup function
14 | /// this should setup all the routes and special
15 | /// features of our app
16 | ///
17 | /// .run() runs the Droplet's commands,
18 | /// if no command is given, it will default to "serve"
19 | let config = try Config()
20 | try config.setup()
21 |
22 | let drop = try Droplet(config)
23 | try drop.setup()
24 |
25 | try drop.run()
26 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPI/TaskAPI.xcodeproj/AppTests_Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | CFBundleDevelopmentRegion
5 | en
6 | CFBundleExecutable
7 | $(EXECUTABLE_NAME)
8 | CFBundleIdentifier
9 | $(PRODUCT_BUNDLE_IDENTIFIER)
10 | CFBundleInfoDictionaryVersion
11 | 6.0
12 | CFBundleName
13 | $(PRODUCT_NAME)
14 | CFBundlePackageType
15 | BNDL
16 | CFBundleShortVersionString
17 | 1.0
18 | CFBundleSignature
19 | ????
20 | CFBundleVersion
21 | $(CURRENT_PROJECT_VERSION)
22 | NSPrincipalClass
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPI/TaskAPI.xcodeproj/App_Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | CFBundleDevelopmentRegion
5 | en
6 | CFBundleExecutable
7 | $(EXECUTABLE_NAME)
8 | CFBundleIdentifier
9 | $(PRODUCT_BUNDLE_IDENTIFIER)
10 | CFBundleInfoDictionaryVersion
11 | 6.0
12 | CFBundleName
13 | $(PRODUCT_NAME)
14 | CFBundlePackageType
15 | FMWK
16 | CFBundleShortVersionString
17 | 1.0
18 | CFBundleSignature
19 | ????
20 | CFBundleVersion
21 | $(CURRENT_PROJECT_VERSION)
22 | NSPrincipalClass
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPI/TaskAPI.xcodeproj/BCrypt_Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | CFBundleDevelopmentRegion
5 | en
6 | CFBundleExecutable
7 | $(EXECUTABLE_NAME)
8 | CFBundleIdentifier
9 | $(PRODUCT_BUNDLE_IDENTIFIER)
10 | CFBundleInfoDictionaryVersion
11 | 6.0
12 | CFBundleName
13 | $(PRODUCT_NAME)
14 | CFBundlePackageType
15 | FMWK
16 | CFBundleShortVersionString
17 | 1.0
18 | CFBundleSignature
19 | ????
20 | CFBundleVersion
21 | $(CURRENT_PROJECT_VERSION)
22 | NSPrincipalClass
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPI/TaskAPI.xcodeproj/Bits_Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | CFBundleDevelopmentRegion
5 | en
6 | CFBundleExecutable
7 | $(EXECUTABLE_NAME)
8 | CFBundleIdentifier
9 | $(PRODUCT_BUNDLE_IDENTIFIER)
10 | CFBundleInfoDictionaryVersion
11 | 6.0
12 | CFBundleName
13 | $(PRODUCT_NAME)
14 | CFBundlePackageType
15 | FMWK
16 | CFBundleShortVersionString
17 | 1.0
18 | CFBundleSignature
19 | ????
20 | CFBundleVersion
21 | $(CURRENT_PROJECT_VERSION)
22 | NSPrincipalClass
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPI/TaskAPI.xcodeproj/Branches_Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | CFBundleDevelopmentRegion
5 | en
6 | CFBundleExecutable
7 | $(EXECUTABLE_NAME)
8 | CFBundleIdentifier
9 | $(PRODUCT_BUNDLE_IDENTIFIER)
10 | CFBundleInfoDictionaryVersion
11 | 6.0
12 | CFBundleName
13 | $(PRODUCT_NAME)
14 | CFBundlePackageType
15 | FMWK
16 | CFBundleShortVersionString
17 | 1.0
18 | CFBundleSignature
19 | ????
20 | CFBundleVersion
21 | $(CURRENT_PROJECT_VERSION)
22 | NSPrincipalClass
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPI/TaskAPI.xcodeproj/CHTTP_Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | CFBundleDevelopmentRegion
5 | en
6 | CFBundleExecutable
7 | $(EXECUTABLE_NAME)
8 | CFBundleIdentifier
9 | $(PRODUCT_BUNDLE_IDENTIFIER)
10 | CFBundleInfoDictionaryVersion
11 | 6.0
12 | CFBundleName
13 | $(PRODUCT_NAME)
14 | CFBundlePackageType
15 | FMWK
16 | CFBundleShortVersionString
17 | 1.0
18 | CFBundleSignature
19 | ????
20 | CFBundleVersion
21 | $(CURRENT_PROJECT_VERSION)
22 | NSPrincipalClass
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPI/TaskAPI.xcodeproj/CSQLite_Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | CFBundleDevelopmentRegion
5 | en
6 | CFBundleExecutable
7 | $(EXECUTABLE_NAME)
8 | CFBundleIdentifier
9 | $(PRODUCT_BUNDLE_IDENTIFIER)
10 | CFBundleInfoDictionaryVersion
11 | 6.0
12 | CFBundleName
13 | $(PRODUCT_NAME)
14 | CFBundlePackageType
15 | FMWK
16 | CFBundleShortVersionString
17 | 1.0
18 | CFBundleSignature
19 | ????
20 | CFBundleVersion
21 | $(CURRENT_PROJECT_VERSION)
22 | NSPrincipalClass
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPI/TaskAPI.xcodeproj/Cache_Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | CFBundleDevelopmentRegion
5 | en
6 | CFBundleExecutable
7 | $(EXECUTABLE_NAME)
8 | CFBundleIdentifier
9 | $(PRODUCT_BUNDLE_IDENTIFIER)
10 | CFBundleInfoDictionaryVersion
11 | 6.0
12 | CFBundleName
13 | $(PRODUCT_NAME)
14 | CFBundlePackageType
15 | FMWK
16 | CFBundleShortVersionString
17 | 1.0
18 | CFBundleSignature
19 | ????
20 | CFBundleVersion
21 | $(CURRENT_PROJECT_VERSION)
22 | NSPrincipalClass
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPI/TaskAPI.xcodeproj/Configs_Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | CFBundleDevelopmentRegion
5 | en
6 | CFBundleExecutable
7 | $(EXECUTABLE_NAME)
8 | CFBundleIdentifier
9 | $(PRODUCT_BUNDLE_IDENTIFIER)
10 | CFBundleInfoDictionaryVersion
11 | 6.0
12 | CFBundleName
13 | $(PRODUCT_NAME)
14 | CFBundlePackageType
15 | FMWK
16 | CFBundleShortVersionString
17 | 1.0
18 | CFBundleSignature
19 | ????
20 | CFBundleVersion
21 | $(CURRENT_PROJECT_VERSION)
22 | NSPrincipalClass
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPI/TaskAPI.xcodeproj/Console_Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | CFBundleDevelopmentRegion
5 | en
6 | CFBundleExecutable
7 | $(EXECUTABLE_NAME)
8 | CFBundleIdentifier
9 | $(PRODUCT_BUNDLE_IDENTIFIER)
10 | CFBundleInfoDictionaryVersion
11 | 6.0
12 | CFBundleName
13 | $(PRODUCT_NAME)
14 | CFBundlePackageType
15 | FMWK
16 | CFBundleShortVersionString
17 | 1.0
18 | CFBundleSignature
19 | ????
20 | CFBundleVersion
21 | $(CURRENT_PROJECT_VERSION)
22 | NSPrincipalClass
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPI/TaskAPI.xcodeproj/Cookies_Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | CFBundleDevelopmentRegion
5 | en
6 | CFBundleExecutable
7 | $(EXECUTABLE_NAME)
8 | CFBundleIdentifier
9 | $(PRODUCT_BUNDLE_IDENTIFIER)
10 | CFBundleInfoDictionaryVersion
11 | 6.0
12 | CFBundleName
13 | $(PRODUCT_NAME)
14 | CFBundlePackageType
15 | FMWK
16 | CFBundleShortVersionString
17 | 1.0
18 | CFBundleSignature
19 | ????
20 | CFBundleVersion
21 | $(CURRENT_PROJECT_VERSION)
22 | NSPrincipalClass
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPI/TaskAPI.xcodeproj/Core_Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | CFBundleDevelopmentRegion
5 | en
6 | CFBundleExecutable
7 | $(EXECUTABLE_NAME)
8 | CFBundleIdentifier
9 | $(PRODUCT_BUNDLE_IDENTIFIER)
10 | CFBundleInfoDictionaryVersion
11 | 6.0
12 | CFBundleName
13 | $(PRODUCT_NAME)
14 | CFBundlePackageType
15 | FMWK
16 | CFBundleShortVersionString
17 | 1.0
18 | CFBundleSignature
19 | ????
20 | CFBundleVersion
21 | $(CURRENT_PROJECT_VERSION)
22 | NSPrincipalClass
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPI/TaskAPI.xcodeproj/Crypto_Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | CFBundleDevelopmentRegion
5 | en
6 | CFBundleExecutable
7 | $(EXECUTABLE_NAME)
8 | CFBundleIdentifier
9 | $(PRODUCT_BUNDLE_IDENTIFIER)
10 | CFBundleInfoDictionaryVersion
11 | 6.0
12 | CFBundleName
13 | $(PRODUCT_NAME)
14 | CFBundlePackageType
15 | FMWK
16 | CFBundleShortVersionString
17 | 1.0
18 | CFBundleSignature
19 | ????
20 | CFBundleVersion
21 | $(CURRENT_PROJECT_VERSION)
22 | NSPrincipalClass
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPI/TaskAPI.xcodeproj/Debugging_Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | CFBundleDevelopmentRegion
5 | en
6 | CFBundleExecutable
7 | $(EXECUTABLE_NAME)
8 | CFBundleIdentifier
9 | $(PRODUCT_BUNDLE_IDENTIFIER)
10 | CFBundleInfoDictionaryVersion
11 | 6.0
12 | CFBundleName
13 | $(PRODUCT_NAME)
14 | CFBundlePackageType
15 | FMWK
16 | CFBundleShortVersionString
17 | 1.0
18 | CFBundleSignature
19 | ????
20 | CFBundleVersion
21 | $(CURRENT_PROJECT_VERSION)
22 | NSPrincipalClass
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPI/TaskAPI.xcodeproj/FluentProvider_Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | CFBundleDevelopmentRegion
5 | en
6 | CFBundleExecutable
7 | $(EXECUTABLE_NAME)
8 | CFBundleIdentifier
9 | $(PRODUCT_BUNDLE_IDENTIFIER)
10 | CFBundleInfoDictionaryVersion
11 | 6.0
12 | CFBundleName
13 | $(PRODUCT_NAME)
14 | CFBundlePackageType
15 | FMWK
16 | CFBundleShortVersionString
17 | 1.0
18 | CFBundleSignature
19 | ????
20 | CFBundleVersion
21 | $(CURRENT_PROJECT_VERSION)
22 | NSPrincipalClass
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPI/TaskAPI.xcodeproj/FluentTester_Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | CFBundleDevelopmentRegion
5 | en
6 | CFBundleExecutable
7 | $(EXECUTABLE_NAME)
8 | CFBundleIdentifier
9 | $(PRODUCT_BUNDLE_IDENTIFIER)
10 | CFBundleInfoDictionaryVersion
11 | 6.0
12 | CFBundleName
13 | $(PRODUCT_NAME)
14 | CFBundlePackageType
15 | FMWK
16 | CFBundleShortVersionString
17 | 1.0
18 | CFBundleSignature
19 | ????
20 | CFBundleVersion
21 | $(CURRENT_PROJECT_VERSION)
22 | NSPrincipalClass
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPI/TaskAPI.xcodeproj/Fluent_Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | CFBundleDevelopmentRegion
5 | en
6 | CFBundleExecutable
7 | $(EXECUTABLE_NAME)
8 | CFBundleIdentifier
9 | $(PRODUCT_BUNDLE_IDENTIFIER)
10 | CFBundleInfoDictionaryVersion
11 | 6.0
12 | CFBundleName
13 | $(PRODUCT_NAME)
14 | CFBundlePackageType
15 | FMWK
16 | CFBundleShortVersionString
17 | 1.0
18 | CFBundleSignature
19 | ????
20 | CFBundleVersion
21 | $(CURRENT_PROJECT_VERSION)
22 | NSPrincipalClass
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPI/TaskAPI.xcodeproj/FormData_Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | CFBundleDevelopmentRegion
5 | en
6 | CFBundleExecutable
7 | $(EXECUTABLE_NAME)
8 | CFBundleIdentifier
9 | $(PRODUCT_BUNDLE_IDENTIFIER)
10 | CFBundleInfoDictionaryVersion
11 | 6.0
12 | CFBundleName
13 | $(PRODUCT_NAME)
14 | CFBundlePackageType
15 | FMWK
16 | CFBundleShortVersionString
17 | 1.0
18 | CFBundleSignature
19 | ????
20 | CFBundleVersion
21 | $(CURRENT_PROJECT_VERSION)
22 | NSPrincipalClass
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPI/TaskAPI.xcodeproj/GeneratedModuleMap/CHTTP/module.modulemap:
--------------------------------------------------------------------------------
1 | module CHTTP {
2 | umbrella "/Users/keefmoon/Dropbox/Projects/Swift Programming Cookbook/sourcecode/ServerSideSwift/TaskAPI/.build/checkouts/engine.git-3311994267206676365/Sources/CHTTP/include"
3 | export *
4 | }
5 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPI/TaskAPI.xcodeproj/GeneratedModuleMap/CSQLite/module.modulemap:
--------------------------------------------------------------------------------
1 | module CSQLite {
2 | umbrella "/Users/keefmoon/Dropbox/Projects/Swift Programming Cookbook/sourcecode/ServerSideSwift/TaskAPI/.build/checkouts/sqlite.git--8232814251736334455/Sources/CSQLite/include"
3 | export *
4 | }
5 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPI/TaskAPI.xcodeproj/HTTP_Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | CFBundleDevelopmentRegion
5 | en
6 | CFBundleExecutable
7 | $(EXECUTABLE_NAME)
8 | CFBundleIdentifier
9 | $(PRODUCT_BUNDLE_IDENTIFIER)
10 | CFBundleInfoDictionaryVersion
11 | 6.0
12 | CFBundleName
13 | $(PRODUCT_NAME)
14 | CFBundlePackageType
15 | FMWK
16 | CFBundleShortVersionString
17 | 1.0
18 | CFBundleSignature
19 | ????
20 | CFBundleVersion
21 | $(CURRENT_PROJECT_VERSION)
22 | NSPrincipalClass
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPI/TaskAPI.xcodeproj/JSON_Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | CFBundleDevelopmentRegion
5 | en
6 | CFBundleExecutable
7 | $(EXECUTABLE_NAME)
8 | CFBundleIdentifier
9 | $(PRODUCT_BUNDLE_IDENTIFIER)
10 | CFBundleInfoDictionaryVersion
11 | 6.0
12 | CFBundleName
13 | $(PRODUCT_NAME)
14 | CFBundlePackageType
15 | FMWK
16 | CFBundleShortVersionString
17 | 1.0
18 | CFBundleSignature
19 | ????
20 | CFBundleVersion
21 | $(CURRENT_PROJECT_VERSION)
22 | NSPrincipalClass
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPI/TaskAPI.xcodeproj/Multipart_Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | CFBundleDevelopmentRegion
5 | en
6 | CFBundleExecutable
7 | $(EXECUTABLE_NAME)
8 | CFBundleIdentifier
9 | $(PRODUCT_BUNDLE_IDENTIFIER)
10 | CFBundleInfoDictionaryVersion
11 | 6.0
12 | CFBundleName
13 | $(PRODUCT_NAME)
14 | CFBundlePackageType
15 | FMWK
16 | CFBundleShortVersionString
17 | 1.0
18 | CFBundleSignature
19 | ????
20 | CFBundleVersion
21 | $(CURRENT_PROJECT_VERSION)
22 | NSPrincipalClass
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPI/TaskAPI.xcodeproj/Node_Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | CFBundleDevelopmentRegion
5 | en
6 | CFBundleExecutable
7 | $(EXECUTABLE_NAME)
8 | CFBundleIdentifier
9 | $(PRODUCT_BUNDLE_IDENTIFIER)
10 | CFBundleInfoDictionaryVersion
11 | 6.0
12 | CFBundleName
13 | $(PRODUCT_NAME)
14 | CFBundlePackageType
15 | FMWK
16 | CFBundleShortVersionString
17 | 1.0
18 | CFBundleSignature
19 | ????
20 | CFBundleVersion
21 | $(CURRENT_PROJECT_VERSION)
22 | NSPrincipalClass
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPI/TaskAPI.xcodeproj/PathIndexable_Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | CFBundleDevelopmentRegion
5 | en
6 | CFBundleExecutable
7 | $(EXECUTABLE_NAME)
8 | CFBundleIdentifier
9 | $(PRODUCT_BUNDLE_IDENTIFIER)
10 | CFBundleInfoDictionaryVersion
11 | 6.0
12 | CFBundleName
13 | $(PRODUCT_NAME)
14 | CFBundlePackageType
15 | FMWK
16 | CFBundleShortVersionString
17 | 1.0
18 | CFBundleSignature
19 | ????
20 | CFBundleVersion
21 | $(CURRENT_PROJECT_VERSION)
22 | NSPrincipalClass
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPI/TaskAPI.xcodeproj/Random_Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | CFBundleDevelopmentRegion
5 | en
6 | CFBundleExecutable
7 | $(EXECUTABLE_NAME)
8 | CFBundleIdentifier
9 | $(PRODUCT_BUNDLE_IDENTIFIER)
10 | CFBundleInfoDictionaryVersion
11 | 6.0
12 | CFBundleName
13 | $(PRODUCT_NAME)
14 | CFBundlePackageType
15 | FMWK
16 | CFBundleShortVersionString
17 | 1.0
18 | CFBundleSignature
19 | ????
20 | CFBundleVersion
21 | $(CURRENT_PROJECT_VERSION)
22 | NSPrincipalClass
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPI/TaskAPI.xcodeproj/Routing_Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | CFBundleDevelopmentRegion
5 | en
6 | CFBundleExecutable
7 | $(EXECUTABLE_NAME)
8 | CFBundleIdentifier
9 | $(PRODUCT_BUNDLE_IDENTIFIER)
10 | CFBundleInfoDictionaryVersion
11 | 6.0
12 | CFBundleName
13 | $(PRODUCT_NAME)
14 | CFBundlePackageType
15 | FMWK
16 | CFBundleShortVersionString
17 | 1.0
18 | CFBundleSignature
19 | ????
20 | CFBundleVersion
21 | $(CURRENT_PROJECT_VERSION)
22 | NSPrincipalClass
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPI/TaskAPI.xcodeproj/SMTP_Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | CFBundleDevelopmentRegion
5 | en
6 | CFBundleExecutable
7 | $(EXECUTABLE_NAME)
8 | CFBundleIdentifier
9 | $(PRODUCT_BUNDLE_IDENTIFIER)
10 | CFBundleInfoDictionaryVersion
11 | 6.0
12 | CFBundleName
13 | $(PRODUCT_NAME)
14 | CFBundlePackageType
15 | FMWK
16 | CFBundleShortVersionString
17 | 1.0
18 | CFBundleSignature
19 | ????
20 | CFBundleVersion
21 | $(CURRENT_PROJECT_VERSION)
22 | NSPrincipalClass
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPI/TaskAPI.xcodeproj/SQLite_Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | CFBundleDevelopmentRegion
5 | en
6 | CFBundleExecutable
7 | $(EXECUTABLE_NAME)
8 | CFBundleIdentifier
9 | $(PRODUCT_BUNDLE_IDENTIFIER)
10 | CFBundleInfoDictionaryVersion
11 | 6.0
12 | CFBundleName
13 | $(PRODUCT_NAME)
14 | CFBundlePackageType
15 | FMWK
16 | CFBundleShortVersionString
17 | 1.0
18 | CFBundleSignature
19 | ????
20 | CFBundleVersion
21 | $(CURRENT_PROJECT_VERSION)
22 | NSPrincipalClass
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPI/TaskAPI.xcodeproj/Sessions_Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | CFBundleDevelopmentRegion
5 | en
6 | CFBundleExecutable
7 | $(EXECUTABLE_NAME)
8 | CFBundleIdentifier
9 | $(PRODUCT_BUNDLE_IDENTIFIER)
10 | CFBundleInfoDictionaryVersion
11 | 6.0
12 | CFBundleName
13 | $(PRODUCT_NAME)
14 | CFBundlePackageType
15 | FMWK
16 | CFBundleShortVersionString
17 | 1.0
18 | CFBundleSignature
19 | ????
20 | CFBundleVersion
21 | $(CURRENT_PROJECT_VERSION)
22 | NSPrincipalClass
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPI/TaskAPI.xcodeproj/Sockets_Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | CFBundleDevelopmentRegion
5 | en
6 | CFBundleExecutable
7 | $(EXECUTABLE_NAME)
8 | CFBundleIdentifier
9 | $(PRODUCT_BUNDLE_IDENTIFIER)
10 | CFBundleInfoDictionaryVersion
11 | 6.0
12 | CFBundleName
13 | $(PRODUCT_NAME)
14 | CFBundlePackageType
15 | FMWK
16 | CFBundleShortVersionString
17 | 1.0
18 | CFBundleSignature
19 | ????
20 | CFBundleVersion
21 | $(CURRENT_PROJECT_VERSION)
22 | NSPrincipalClass
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPI/TaskAPI.xcodeproj/TLS_Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | CFBundleDevelopmentRegion
5 | en
6 | CFBundleExecutable
7 | $(EXECUTABLE_NAME)
8 | CFBundleIdentifier
9 | $(PRODUCT_BUNDLE_IDENTIFIER)
10 | CFBundleInfoDictionaryVersion
11 | 6.0
12 | CFBundleName
13 | $(PRODUCT_NAME)
14 | CFBundlePackageType
15 | FMWK
16 | CFBundleShortVersionString
17 | 1.0
18 | CFBundleSignature
19 | ????
20 | CFBundleVersion
21 | $(CURRENT_PROJECT_VERSION)
22 | NSPrincipalClass
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPI/TaskAPI.xcodeproj/Testing_Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | CFBundleDevelopmentRegion
5 | en
6 | CFBundleExecutable
7 | $(EXECUTABLE_NAME)
8 | CFBundleIdentifier
9 | $(PRODUCT_BUNDLE_IDENTIFIER)
10 | CFBundleInfoDictionaryVersion
11 | 6.0
12 | CFBundleName
13 | $(PRODUCT_NAME)
14 | CFBundlePackageType
15 | FMWK
16 | CFBundleShortVersionString
17 | 1.0
18 | CFBundleSignature
19 | ????
20 | CFBundleVersion
21 | $(CURRENT_PROJECT_VERSION)
22 | NSPrincipalClass
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPI/TaskAPI.xcodeproj/Transport_Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | CFBundleDevelopmentRegion
5 | en
6 | CFBundleExecutable
7 | $(EXECUTABLE_NAME)
8 | CFBundleIdentifier
9 | $(PRODUCT_BUNDLE_IDENTIFIER)
10 | CFBundleInfoDictionaryVersion
11 | 6.0
12 | CFBundleName
13 | $(PRODUCT_NAME)
14 | CFBundlePackageType
15 | FMWK
16 | CFBundleShortVersionString
17 | 1.0
18 | CFBundleSignature
19 | ????
20 | CFBundleVersion
21 | $(CURRENT_PROJECT_VERSION)
22 | NSPrincipalClass
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPI/TaskAPI.xcodeproj/URI_Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | CFBundleDevelopmentRegion
5 | en
6 | CFBundleExecutable
7 | $(EXECUTABLE_NAME)
8 | CFBundleIdentifier
9 | $(PRODUCT_BUNDLE_IDENTIFIER)
10 | CFBundleInfoDictionaryVersion
11 | 6.0
12 | CFBundleName
13 | $(PRODUCT_NAME)
14 | CFBundlePackageType
15 | FMWK
16 | CFBundleShortVersionString
17 | 1.0
18 | CFBundleSignature
19 | ????
20 | CFBundleVersion
21 | $(CURRENT_PROJECT_VERSION)
22 | NSPrincipalClass
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPI/TaskAPI.xcodeproj/Vapor_Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | CFBundleDevelopmentRegion
5 | en
6 | CFBundleExecutable
7 | $(EXECUTABLE_NAME)
8 | CFBundleIdentifier
9 | $(PRODUCT_BUNDLE_IDENTIFIER)
10 | CFBundleInfoDictionaryVersion
11 | 6.0
12 | CFBundleName
13 | $(PRODUCT_NAME)
14 | CFBundlePackageType
15 | FMWK
16 | CFBundleShortVersionString
17 | 1.0
18 | CFBundleSignature
19 | ????
20 | CFBundleVersion
21 | $(CURRENT_PROJECT_VERSION)
22 | NSPrincipalClass
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPI/TaskAPI.xcodeproj/WebSockets_Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | CFBundleDevelopmentRegion
5 | en
6 | CFBundleExecutable
7 | $(EXECUTABLE_NAME)
8 | CFBundleIdentifier
9 | $(PRODUCT_BUNDLE_IDENTIFIER)
10 | CFBundleInfoDictionaryVersion
11 | 6.0
12 | CFBundleName
13 | $(PRODUCT_NAME)
14 | CFBundlePackageType
15 | FMWK
16 | CFBundleShortVersionString
17 | 1.0
18 | CFBundleSignature
19 | ????
20 | CFBundleVersion
21 | $(CURRENT_PROJECT_VERSION)
22 | NSPrincipalClass
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPI/TaskAPI.xcodeproj/libc_Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | CFBundleDevelopmentRegion
5 | en
6 | CFBundleExecutable
7 | $(EXECUTABLE_NAME)
8 | CFBundleIdentifier
9 | $(PRODUCT_BUNDLE_IDENTIFIER)
10 | CFBundleInfoDictionaryVersion
11 | 6.0
12 | CFBundleName
13 | $(PRODUCT_NAME)
14 | CFBundlePackageType
15 | FMWK
16 | CFBundleShortVersionString
17 | 1.0
18 | CFBundleSignature
19 | ????
20 | CFBundleVersion
21 | $(CURRENT_PROJECT_VERSION)
22 | NSPrincipalClass
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPI/TaskAPI.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPI/TaskAPI.xcodeproj/xcshareddata/xcschemes/xcschememanagement.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | SchemeUserState
5 |
6 | TaskAPI.xcscheme
7 |
8 |
9 | SuppressBuildableAutocreation
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPI/Tests/AppTests/Utilities.swift:
--------------------------------------------------------------------------------
1 | import Foundation
2 | @testable import App
3 | @testable import Vapor
4 | import XCTest
5 | import Testing
6 | import FluentProvider
7 |
8 | extension Droplet {
9 | static func testable() throws -> Droplet {
10 | let config = try Config(arguments: ["vapor", "--env=test"])
11 | try config.setup()
12 | let drop = try Droplet(config)
13 | try drop.setup()
14 | return drop
15 | }
16 | func serveInBackground() throws {
17 | background {
18 | try! self.run()
19 | }
20 | console.wait(seconds: 0.5)
21 | }
22 | }
23 |
24 | class TestCase: XCTestCase {
25 | override func setUp() {
26 | Node.fuzzy = [Row.self, JSON.self, Node.self]
27 | Testing.onFail = XCTFail
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPI/Tests/LinuxMain.swift:
--------------------------------------------------------------------------------
1 | #if os(Linux)
2 |
3 | import XCTest
4 | @testable import AppTests
5 |
6 | XCTMain([
7 | // AppTests
8 | testCase(PostControllerTests.allTests),
9 | testCase(RouteTests.allTests)
10 | ])
11 |
12 | #endif
13 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPI/circle.yml:
--------------------------------------------------------------------------------
1 | dependencies:
2 | override:
3 | - eval "$(curl -sL https://apt.vapor.sh)"
4 | - sudo apt-get install vapor
5 | - sudo chmod -R a+rx /usr/
6 | test:
7 | override:
8 | - swift build
9 | - swift build -c release
10 | - swift test
11 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPIUsingHeroku/.travis.yml:
--------------------------------------------------------------------------------
1 | os:
2 | - linux
3 | - osx
4 | language: generic
5 | sudo: required
6 | dist: trusty
7 |
8 | osx_image: xcode8.3
9 | before_install:
10 | - if [ $TRAVIS_OS_NAME == "osx" ]; then
11 | brew tap vapor/tap;
12 | brew update;
13 | brew install vapor;
14 | else
15 | eval "$(curl -sL https://apt.vapor.sh)";
16 | sudo apt-get install vapor;
17 | sudo chmod -R a+rx /usr/;
18 | fi
19 |
20 | script:
21 | - swift build
22 | - swift build -c release
23 | - swift test
24 |
25 | after_success:
26 | - eval "$(curl -sL https://swift.vapor.sh/codecov)"
27 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPIUsingHeroku/Config/app.json:
--------------------------------------------------------------------------------
1 | {
2 | "foo": "foo-bar"
3 | }
4 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPIUsingHeroku/Config/crypto.json:
--------------------------------------------------------------------------------
1 | {
2 | "hash": {
3 | "method": "sha256",
4 | "encoding": "hex",
5 | "key": "0000000000000000"
6 | },
7 |
8 | "cipher": {
9 | "method": "aes256",
10 | "encoding": "base64",
11 | "key": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA="
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPIUsingHeroku/Config/secrets/postgresql.json:
--------------------------------------------------------------------------------
1 | {
2 | "hostname": "127.0.0.1",
3 | "user": "keefmoon",
4 | "password": "",
5 | "database": "TaskAPI",
6 | "port": 5432
7 | }
8 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPIUsingHeroku/Config/server.json:
--------------------------------------------------------------------------------
1 | {
2 | "//": "The $PORT:8080 call tells the json file to see if there",
3 | "//": "is any value at the 'PORT' environment variable.",
4 | "//": "If there is no value there, it will fallback to '8080'",
5 | "port": "$PORT:8080",
6 |
7 | "host": "0.0.0.0",
8 |
9 | "//": "It's very rare that a server manages its own TLS.",
10 | "//": "More commonly, vapor is served behind a proxy like nginx.",
11 | "securityLayer": "none"
12 | }
13 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPIUsingHeroku/Package.swift:
--------------------------------------------------------------------------------
1 | import PackageDescription
2 |
3 | let package = Package(
4 | name: "TaskAPI",
5 | targets: [
6 | Target(name: "App"),
7 | Target(name: "Run", dependencies: ["App"]),
8 | ],
9 | dependencies: [
10 | .Package(url: "https://github.com/vapor/vapor.git", majorVersion: 2),
11 | .Package(url: "https://github.com/vapor/fluent-provider.git", majorVersion: 1),
12 | .Package(url: "https://github.com/vapor-community/postgresql-provider.git", majorVersion: 2, minor: 0)
13 | ],
14 | exclude: [
15 | "Config",
16 | "Database",
17 | "Localization",
18 | "Public",
19 | "Resources",
20 | ]
21 | )
22 |
23 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPIUsingHeroku/Procfile:
--------------------------------------------------------------------------------
1 | web: App --env=production --workdir=./ --config:servers.default.port=$PORT --config:postgresql.url=$DATABASE_URL
2 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPIUsingHeroku/Public/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PacktPublishing/Swift-4-Programming-Cookbook/145d868a918517d0eaed55a1fd7a18ce25667e3d/Chapter07/ServerSideSwift-master/TaskAPIUsingHeroku/Public/.gitkeep
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPIUsingHeroku/Sources/App/Config+Setup.swift:
--------------------------------------------------------------------------------
1 | import PostgreSQLProvider
2 |
3 | extension Config {
4 | public func setup() throws {
5 | // allow fuzzy conversions for these types
6 | // (add your own types here)
7 | Node.fuzzy = [Row.self, JSON.self, Node.self]
8 |
9 | try setupProviders()
10 | try setupPreparations()
11 | }
12 |
13 | /// Configure providers
14 | private func setupProviders() throws {
15 | try addProvider(PostgreSQLProvider.Provider.self)
16 | }
17 |
18 | /// Add all models that should have their
19 | /// schemas prepared before the app boots
20 | private func setupPreparations() throws {
21 | preparations.append(Task.self)
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPIUsingHeroku/Sources/App/Droplet+Setup.swift:
--------------------------------------------------------------------------------
1 | @_exported import Vapor
2 |
3 | extension Droplet {
4 | public func setup() throws {
5 | try setupRoutes()
6 | // Do any additional droplet setup
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPIUsingHeroku/Sources/Run/main.swift:
--------------------------------------------------------------------------------
1 | import App
2 |
3 | /// We have isolated all of our App's logic into
4 | /// the App module because it makes our app
5 | /// more testable.
6 | ///
7 | /// In general, the executable portion of our App
8 | /// shouldn't include much more code than is presented
9 | /// here.
10 | ///
11 | /// We simply initialize our Droplet, optionally
12 | /// passing in values if necessary
13 | /// Then, we pass it to our App's setup function
14 | /// this should setup all the routes and special
15 | /// features of our app
16 | ///
17 | /// .run() runs the Droplet's commands,
18 | /// if no command is given, it will default to "serve"
19 | let config = try Config()
20 | try config.setup()
21 |
22 | let drop = try Droplet(config)
23 | try drop.setup()
24 |
25 | try drop.run()
26 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPIUsingHeroku/TaskAPI.xcodeproj/AppTests_Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | CFBundleDevelopmentRegion
5 | en
6 | CFBundleExecutable
7 | $(EXECUTABLE_NAME)
8 | CFBundleIdentifier
9 | $(PRODUCT_BUNDLE_IDENTIFIER)
10 | CFBundleInfoDictionaryVersion
11 | 6.0
12 | CFBundleName
13 | $(PRODUCT_NAME)
14 | CFBundlePackageType
15 | BNDL
16 | CFBundleShortVersionString
17 | 1.0
18 | CFBundleSignature
19 | ????
20 | CFBundleVersion
21 | $(CURRENT_PROJECT_VERSION)
22 | NSPrincipalClass
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPIUsingHeroku/TaskAPI.xcodeproj/App_Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | CFBundleDevelopmentRegion
5 | en
6 | CFBundleExecutable
7 | $(EXECUTABLE_NAME)
8 | CFBundleIdentifier
9 | $(PRODUCT_BUNDLE_IDENTIFIER)
10 | CFBundleInfoDictionaryVersion
11 | 6.0
12 | CFBundleName
13 | $(PRODUCT_NAME)
14 | CFBundlePackageType
15 | FMWK
16 | CFBundleShortVersionString
17 | 1.0
18 | CFBundleSignature
19 | ????
20 | CFBundleVersion
21 | $(CURRENT_PROJECT_VERSION)
22 | NSPrincipalClass
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPIUsingHeroku/TaskAPI.xcodeproj/BCrypt_Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | CFBundleDevelopmentRegion
5 | en
6 | CFBundleExecutable
7 | $(EXECUTABLE_NAME)
8 | CFBundleIdentifier
9 | $(PRODUCT_BUNDLE_IDENTIFIER)
10 | CFBundleInfoDictionaryVersion
11 | 6.0
12 | CFBundleName
13 | $(PRODUCT_NAME)
14 | CFBundlePackageType
15 | FMWK
16 | CFBundleShortVersionString
17 | 1.0
18 | CFBundleSignature
19 | ????
20 | CFBundleVersion
21 | $(CURRENT_PROJECT_VERSION)
22 | NSPrincipalClass
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPIUsingHeroku/TaskAPI.xcodeproj/Bits_Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | CFBundleDevelopmentRegion
5 | en
6 | CFBundleExecutable
7 | $(EXECUTABLE_NAME)
8 | CFBundleIdentifier
9 | $(PRODUCT_BUNDLE_IDENTIFIER)
10 | CFBundleInfoDictionaryVersion
11 | 6.0
12 | CFBundleName
13 | $(PRODUCT_NAME)
14 | CFBundlePackageType
15 | FMWK
16 | CFBundleShortVersionString
17 | 1.0
18 | CFBundleSignature
19 | ????
20 | CFBundleVersion
21 | $(CURRENT_PROJECT_VERSION)
22 | NSPrincipalClass
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPIUsingHeroku/TaskAPI.xcodeproj/Branches_Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | CFBundleDevelopmentRegion
5 | en
6 | CFBundleExecutable
7 | $(EXECUTABLE_NAME)
8 | CFBundleIdentifier
9 | $(PRODUCT_BUNDLE_IDENTIFIER)
10 | CFBundleInfoDictionaryVersion
11 | 6.0
12 | CFBundleName
13 | $(PRODUCT_NAME)
14 | CFBundlePackageType
15 | FMWK
16 | CFBundleShortVersionString
17 | 1.0
18 | CFBundleSignature
19 | ????
20 | CFBundleVersion
21 | $(CURRENT_PROJECT_VERSION)
22 | NSPrincipalClass
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPIUsingHeroku/TaskAPI.xcodeproj/CHTTP_Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | CFBundleDevelopmentRegion
5 | en
6 | CFBundleExecutable
7 | $(EXECUTABLE_NAME)
8 | CFBundleIdentifier
9 | $(PRODUCT_BUNDLE_IDENTIFIER)
10 | CFBundleInfoDictionaryVersion
11 | 6.0
12 | CFBundleName
13 | $(PRODUCT_NAME)
14 | CFBundlePackageType
15 | FMWK
16 | CFBundleShortVersionString
17 | 1.0
18 | CFBundleSignature
19 | ????
20 | CFBundleVersion
21 | $(CURRENT_PROJECT_VERSION)
22 | NSPrincipalClass
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPIUsingHeroku/TaskAPI.xcodeproj/CSQLite_Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | CFBundleDevelopmentRegion
5 | en
6 | CFBundleExecutable
7 | $(EXECUTABLE_NAME)
8 | CFBundleIdentifier
9 | $(PRODUCT_BUNDLE_IDENTIFIER)
10 | CFBundleInfoDictionaryVersion
11 | 6.0
12 | CFBundleName
13 | $(PRODUCT_NAME)
14 | CFBundlePackageType
15 | FMWK
16 | CFBundleShortVersionString
17 | 1.0
18 | CFBundleSignature
19 | ????
20 | CFBundleVersion
21 | $(CURRENT_PROJECT_VERSION)
22 | NSPrincipalClass
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPIUsingHeroku/TaskAPI.xcodeproj/Cache_Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | CFBundleDevelopmentRegion
5 | en
6 | CFBundleExecutable
7 | $(EXECUTABLE_NAME)
8 | CFBundleIdentifier
9 | $(PRODUCT_BUNDLE_IDENTIFIER)
10 | CFBundleInfoDictionaryVersion
11 | 6.0
12 | CFBundleName
13 | $(PRODUCT_NAME)
14 | CFBundlePackageType
15 | FMWK
16 | CFBundleShortVersionString
17 | 1.0
18 | CFBundleSignature
19 | ????
20 | CFBundleVersion
21 | $(CURRENT_PROJECT_VERSION)
22 | NSPrincipalClass
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPIUsingHeroku/TaskAPI.xcodeproj/Configs_Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | CFBundleDevelopmentRegion
5 | en
6 | CFBundleExecutable
7 | $(EXECUTABLE_NAME)
8 | CFBundleIdentifier
9 | $(PRODUCT_BUNDLE_IDENTIFIER)
10 | CFBundleInfoDictionaryVersion
11 | 6.0
12 | CFBundleName
13 | $(PRODUCT_NAME)
14 | CFBundlePackageType
15 | FMWK
16 | CFBundleShortVersionString
17 | 1.0
18 | CFBundleSignature
19 | ????
20 | CFBundleVersion
21 | $(CURRENT_PROJECT_VERSION)
22 | NSPrincipalClass
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPIUsingHeroku/TaskAPI.xcodeproj/Console_Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | CFBundleDevelopmentRegion
5 | en
6 | CFBundleExecutable
7 | $(EXECUTABLE_NAME)
8 | CFBundleIdentifier
9 | $(PRODUCT_BUNDLE_IDENTIFIER)
10 | CFBundleInfoDictionaryVersion
11 | 6.0
12 | CFBundleName
13 | $(PRODUCT_NAME)
14 | CFBundlePackageType
15 | FMWK
16 | CFBundleShortVersionString
17 | 1.0
18 | CFBundleSignature
19 | ????
20 | CFBundleVersion
21 | $(CURRENT_PROJECT_VERSION)
22 | NSPrincipalClass
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPIUsingHeroku/TaskAPI.xcodeproj/Cookies_Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | CFBundleDevelopmentRegion
5 | en
6 | CFBundleExecutable
7 | $(EXECUTABLE_NAME)
8 | CFBundleIdentifier
9 | $(PRODUCT_BUNDLE_IDENTIFIER)
10 | CFBundleInfoDictionaryVersion
11 | 6.0
12 | CFBundleName
13 | $(PRODUCT_NAME)
14 | CFBundlePackageType
15 | FMWK
16 | CFBundleShortVersionString
17 | 1.0
18 | CFBundleSignature
19 | ????
20 | CFBundleVersion
21 | $(CURRENT_PROJECT_VERSION)
22 | NSPrincipalClass
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPIUsingHeroku/TaskAPI.xcodeproj/Core_Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | CFBundleDevelopmentRegion
5 | en
6 | CFBundleExecutable
7 | $(EXECUTABLE_NAME)
8 | CFBundleIdentifier
9 | $(PRODUCT_BUNDLE_IDENTIFIER)
10 | CFBundleInfoDictionaryVersion
11 | 6.0
12 | CFBundleName
13 | $(PRODUCT_NAME)
14 | CFBundlePackageType
15 | FMWK
16 | CFBundleShortVersionString
17 | 1.0
18 | CFBundleSignature
19 | ????
20 | CFBundleVersion
21 | $(CURRENT_PROJECT_VERSION)
22 | NSPrincipalClass
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPIUsingHeroku/TaskAPI.xcodeproj/Crypto_Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | CFBundleDevelopmentRegion
5 | en
6 | CFBundleExecutable
7 | $(EXECUTABLE_NAME)
8 | CFBundleIdentifier
9 | $(PRODUCT_BUNDLE_IDENTIFIER)
10 | CFBundleInfoDictionaryVersion
11 | 6.0
12 | CFBundleName
13 | $(PRODUCT_NAME)
14 | CFBundlePackageType
15 | FMWK
16 | CFBundleShortVersionString
17 | 1.0
18 | CFBundleSignature
19 | ????
20 | CFBundleVersion
21 | $(CURRENT_PROJECT_VERSION)
22 | NSPrincipalClass
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPIUsingHeroku/TaskAPI.xcodeproj/Debugging_Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | CFBundleDevelopmentRegion
5 | en
6 | CFBundleExecutable
7 | $(EXECUTABLE_NAME)
8 | CFBundleIdentifier
9 | $(PRODUCT_BUNDLE_IDENTIFIER)
10 | CFBundleInfoDictionaryVersion
11 | 6.0
12 | CFBundleName
13 | $(PRODUCT_NAME)
14 | CFBundlePackageType
15 | FMWK
16 | CFBundleShortVersionString
17 | 1.0
18 | CFBundleSignature
19 | ????
20 | CFBundleVersion
21 | $(CURRENT_PROJECT_VERSION)
22 | NSPrincipalClass
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPIUsingHeroku/TaskAPI.xcodeproj/FluentTester_Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | CFBundleDevelopmentRegion
5 | en
6 | CFBundleExecutable
7 | $(EXECUTABLE_NAME)
8 | CFBundleIdentifier
9 | $(PRODUCT_BUNDLE_IDENTIFIER)
10 | CFBundleInfoDictionaryVersion
11 | 6.0
12 | CFBundleName
13 | $(PRODUCT_NAME)
14 | CFBundlePackageType
15 | FMWK
16 | CFBundleShortVersionString
17 | 1.0
18 | CFBundleSignature
19 | ????
20 | CFBundleVersion
21 | $(CURRENT_PROJECT_VERSION)
22 | NSPrincipalClass
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPIUsingHeroku/TaskAPI.xcodeproj/Fluent_Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | CFBundleDevelopmentRegion
5 | en
6 | CFBundleExecutable
7 | $(EXECUTABLE_NAME)
8 | CFBundleIdentifier
9 | $(PRODUCT_BUNDLE_IDENTIFIER)
10 | CFBundleInfoDictionaryVersion
11 | 6.0
12 | CFBundleName
13 | $(PRODUCT_NAME)
14 | CFBundlePackageType
15 | FMWK
16 | CFBundleShortVersionString
17 | 1.0
18 | CFBundleSignature
19 | ????
20 | CFBundleVersion
21 | $(CURRENT_PROJECT_VERSION)
22 | NSPrincipalClass
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPIUsingHeroku/TaskAPI.xcodeproj/FormData_Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | CFBundleDevelopmentRegion
5 | en
6 | CFBundleExecutable
7 | $(EXECUTABLE_NAME)
8 | CFBundleIdentifier
9 | $(PRODUCT_BUNDLE_IDENTIFIER)
10 | CFBundleInfoDictionaryVersion
11 | 6.0
12 | CFBundleName
13 | $(PRODUCT_NAME)
14 | CFBundlePackageType
15 | FMWK
16 | CFBundleShortVersionString
17 | 1.0
18 | CFBundleSignature
19 | ????
20 | CFBundleVersion
21 | $(CURRENT_PROJECT_VERSION)
22 | NSPrincipalClass
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPIUsingHeroku/TaskAPI.xcodeproj/GeneratedModuleMap/CHTTP/module.modulemap:
--------------------------------------------------------------------------------
1 | module CHTTP {
2 | umbrella "/Users/keefmoon/Dropbox/Projects/Swift Programming Cookbook/sourcecode/ServerSideSwift/TaskAPIUsingHeroku/.build/checkouts/engine.git-3311994267206676365/Sources/CHTTP/include"
3 | export *
4 | }
5 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPIUsingHeroku/TaskAPI.xcodeproj/GeneratedModuleMap/CSQLite/module.modulemap:
--------------------------------------------------------------------------------
1 | module CSQLite {
2 | umbrella "/Users/keefmoon/Dropbox/Projects/Swift Programming Cookbook/sourcecode/ServerSideSwift/TaskAPIUsingHeroku/.build/checkouts/sqlite.git--8232814251736334455/Sources/CSQLite/include"
3 | export *
4 | }
5 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPIUsingHeroku/TaskAPI.xcodeproj/HTTP_Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | CFBundleDevelopmentRegion
5 | en
6 | CFBundleExecutable
7 | $(EXECUTABLE_NAME)
8 | CFBundleIdentifier
9 | $(PRODUCT_BUNDLE_IDENTIFIER)
10 | CFBundleInfoDictionaryVersion
11 | 6.0
12 | CFBundleName
13 | $(PRODUCT_NAME)
14 | CFBundlePackageType
15 | FMWK
16 | CFBundleShortVersionString
17 | 1.0
18 | CFBundleSignature
19 | ????
20 | CFBundleVersion
21 | $(CURRENT_PROJECT_VERSION)
22 | NSPrincipalClass
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPIUsingHeroku/TaskAPI.xcodeproj/JSON_Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | CFBundleDevelopmentRegion
5 | en
6 | CFBundleExecutable
7 | $(EXECUTABLE_NAME)
8 | CFBundleIdentifier
9 | $(PRODUCT_BUNDLE_IDENTIFIER)
10 | CFBundleInfoDictionaryVersion
11 | 6.0
12 | CFBundleName
13 | $(PRODUCT_NAME)
14 | CFBundlePackageType
15 | FMWK
16 | CFBundleShortVersionString
17 | 1.0
18 | CFBundleSignature
19 | ????
20 | CFBundleVersion
21 | $(CURRENT_PROJECT_VERSION)
22 | NSPrincipalClass
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPIUsingHeroku/TaskAPI.xcodeproj/Multipart_Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | CFBundleDevelopmentRegion
5 | en
6 | CFBundleExecutable
7 | $(EXECUTABLE_NAME)
8 | CFBundleIdentifier
9 | $(PRODUCT_BUNDLE_IDENTIFIER)
10 | CFBundleInfoDictionaryVersion
11 | 6.0
12 | CFBundleName
13 | $(PRODUCT_NAME)
14 | CFBundlePackageType
15 | FMWK
16 | CFBundleShortVersionString
17 | 1.0
18 | CFBundleSignature
19 | ????
20 | CFBundleVersion
21 | $(CURRENT_PROJECT_VERSION)
22 | NSPrincipalClass
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPIUsingHeroku/TaskAPI.xcodeproj/Node_Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | CFBundleDevelopmentRegion
5 | en
6 | CFBundleExecutable
7 | $(EXECUTABLE_NAME)
8 | CFBundleIdentifier
9 | $(PRODUCT_BUNDLE_IDENTIFIER)
10 | CFBundleInfoDictionaryVersion
11 | 6.0
12 | CFBundleName
13 | $(PRODUCT_NAME)
14 | CFBundlePackageType
15 | FMWK
16 | CFBundleShortVersionString
17 | 1.0
18 | CFBundleSignature
19 | ????
20 | CFBundleVersion
21 | $(CURRENT_PROJECT_VERSION)
22 | NSPrincipalClass
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPIUsingHeroku/TaskAPI.xcodeproj/PathIndexable_Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | CFBundleDevelopmentRegion
5 | en
6 | CFBundleExecutable
7 | $(EXECUTABLE_NAME)
8 | CFBundleIdentifier
9 | $(PRODUCT_BUNDLE_IDENTIFIER)
10 | CFBundleInfoDictionaryVersion
11 | 6.0
12 | CFBundleName
13 | $(PRODUCT_NAME)
14 | CFBundlePackageType
15 | FMWK
16 | CFBundleShortVersionString
17 | 1.0
18 | CFBundleSignature
19 | ????
20 | CFBundleVersion
21 | $(CURRENT_PROJECT_VERSION)
22 | NSPrincipalClass
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPIUsingHeroku/TaskAPI.xcodeproj/PostgreSQL_Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | CFBundleDevelopmentRegion
5 | en
6 | CFBundleExecutable
7 | $(EXECUTABLE_NAME)
8 | CFBundleIdentifier
9 | $(PRODUCT_BUNDLE_IDENTIFIER)
10 | CFBundleInfoDictionaryVersion
11 | 6.0
12 | CFBundleName
13 | $(PRODUCT_NAME)
14 | CFBundlePackageType
15 | FMWK
16 | CFBundleShortVersionString
17 | 1.0
18 | CFBundleSignature
19 | ????
20 | CFBundleVersion
21 | $(CURRENT_PROJECT_VERSION)
22 | NSPrincipalClass
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPIUsingHeroku/TaskAPI.xcodeproj/Random_Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | CFBundleDevelopmentRegion
5 | en
6 | CFBundleExecutable
7 | $(EXECUTABLE_NAME)
8 | CFBundleIdentifier
9 | $(PRODUCT_BUNDLE_IDENTIFIER)
10 | CFBundleInfoDictionaryVersion
11 | 6.0
12 | CFBundleName
13 | $(PRODUCT_NAME)
14 | CFBundlePackageType
15 | FMWK
16 | CFBundleShortVersionString
17 | 1.0
18 | CFBundleSignature
19 | ????
20 | CFBundleVersion
21 | $(CURRENT_PROJECT_VERSION)
22 | NSPrincipalClass
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPIUsingHeroku/TaskAPI.xcodeproj/Routing_Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | CFBundleDevelopmentRegion
5 | en
6 | CFBundleExecutable
7 | $(EXECUTABLE_NAME)
8 | CFBundleIdentifier
9 | $(PRODUCT_BUNDLE_IDENTIFIER)
10 | CFBundleInfoDictionaryVersion
11 | 6.0
12 | CFBundleName
13 | $(PRODUCT_NAME)
14 | CFBundlePackageType
15 | FMWK
16 | CFBundleShortVersionString
17 | 1.0
18 | CFBundleSignature
19 | ????
20 | CFBundleVersion
21 | $(CURRENT_PROJECT_VERSION)
22 | NSPrincipalClass
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPIUsingHeroku/TaskAPI.xcodeproj/SMTP_Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | CFBundleDevelopmentRegion
5 | en
6 | CFBundleExecutable
7 | $(EXECUTABLE_NAME)
8 | CFBundleIdentifier
9 | $(PRODUCT_BUNDLE_IDENTIFIER)
10 | CFBundleInfoDictionaryVersion
11 | 6.0
12 | CFBundleName
13 | $(PRODUCT_NAME)
14 | CFBundlePackageType
15 | FMWK
16 | CFBundleShortVersionString
17 | 1.0
18 | CFBundleSignature
19 | ????
20 | CFBundleVersion
21 | $(CURRENT_PROJECT_VERSION)
22 | NSPrincipalClass
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPIUsingHeroku/TaskAPI.xcodeproj/SQLite_Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | CFBundleDevelopmentRegion
5 | en
6 | CFBundleExecutable
7 | $(EXECUTABLE_NAME)
8 | CFBundleIdentifier
9 | $(PRODUCT_BUNDLE_IDENTIFIER)
10 | CFBundleInfoDictionaryVersion
11 | 6.0
12 | CFBundleName
13 | $(PRODUCT_NAME)
14 | CFBundlePackageType
15 | FMWK
16 | CFBundleShortVersionString
17 | 1.0
18 | CFBundleSignature
19 | ????
20 | CFBundleVersion
21 | $(CURRENT_PROJECT_VERSION)
22 | NSPrincipalClass
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPIUsingHeroku/TaskAPI.xcodeproj/Sessions_Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | CFBundleDevelopmentRegion
5 | en
6 | CFBundleExecutable
7 | $(EXECUTABLE_NAME)
8 | CFBundleIdentifier
9 | $(PRODUCT_BUNDLE_IDENTIFIER)
10 | CFBundleInfoDictionaryVersion
11 | 6.0
12 | CFBundleName
13 | $(PRODUCT_NAME)
14 | CFBundlePackageType
15 | FMWK
16 | CFBundleShortVersionString
17 | 1.0
18 | CFBundleSignature
19 | ????
20 | CFBundleVersion
21 | $(CURRENT_PROJECT_VERSION)
22 | NSPrincipalClass
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPIUsingHeroku/TaskAPI.xcodeproj/Sockets_Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | CFBundleDevelopmentRegion
5 | en
6 | CFBundleExecutable
7 | $(EXECUTABLE_NAME)
8 | CFBundleIdentifier
9 | $(PRODUCT_BUNDLE_IDENTIFIER)
10 | CFBundleInfoDictionaryVersion
11 | 6.0
12 | CFBundleName
13 | $(PRODUCT_NAME)
14 | CFBundlePackageType
15 | FMWK
16 | CFBundleShortVersionString
17 | 1.0
18 | CFBundleSignature
19 | ????
20 | CFBundleVersion
21 | $(CURRENT_PROJECT_VERSION)
22 | NSPrincipalClass
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPIUsingHeroku/TaskAPI.xcodeproj/TLS_Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | CFBundleDevelopmentRegion
5 | en
6 | CFBundleExecutable
7 | $(EXECUTABLE_NAME)
8 | CFBundleIdentifier
9 | $(PRODUCT_BUNDLE_IDENTIFIER)
10 | CFBundleInfoDictionaryVersion
11 | 6.0
12 | CFBundleName
13 | $(PRODUCT_NAME)
14 | CFBundlePackageType
15 | FMWK
16 | CFBundleShortVersionString
17 | 1.0
18 | CFBundleSignature
19 | ????
20 | CFBundleVersion
21 | $(CURRENT_PROJECT_VERSION)
22 | NSPrincipalClass
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPIUsingHeroku/TaskAPI.xcodeproj/Testing_Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | CFBundleDevelopmentRegion
5 | en
6 | CFBundleExecutable
7 | $(EXECUTABLE_NAME)
8 | CFBundleIdentifier
9 | $(PRODUCT_BUNDLE_IDENTIFIER)
10 | CFBundleInfoDictionaryVersion
11 | 6.0
12 | CFBundleName
13 | $(PRODUCT_NAME)
14 | CFBundlePackageType
15 | FMWK
16 | CFBundleShortVersionString
17 | 1.0
18 | CFBundleSignature
19 | ????
20 | CFBundleVersion
21 | $(CURRENT_PROJECT_VERSION)
22 | NSPrincipalClass
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPIUsingHeroku/TaskAPI.xcodeproj/Transport_Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | CFBundleDevelopmentRegion
5 | en
6 | CFBundleExecutable
7 | $(EXECUTABLE_NAME)
8 | CFBundleIdentifier
9 | $(PRODUCT_BUNDLE_IDENTIFIER)
10 | CFBundleInfoDictionaryVersion
11 | 6.0
12 | CFBundleName
13 | $(PRODUCT_NAME)
14 | CFBundlePackageType
15 | FMWK
16 | CFBundleShortVersionString
17 | 1.0
18 | CFBundleSignature
19 | ????
20 | CFBundleVersion
21 | $(CURRENT_PROJECT_VERSION)
22 | NSPrincipalClass
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPIUsingHeroku/TaskAPI.xcodeproj/URI_Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | CFBundleDevelopmentRegion
5 | en
6 | CFBundleExecutable
7 | $(EXECUTABLE_NAME)
8 | CFBundleIdentifier
9 | $(PRODUCT_BUNDLE_IDENTIFIER)
10 | CFBundleInfoDictionaryVersion
11 | 6.0
12 | CFBundleName
13 | $(PRODUCT_NAME)
14 | CFBundlePackageType
15 | FMWK
16 | CFBundleShortVersionString
17 | 1.0
18 | CFBundleSignature
19 | ????
20 | CFBundleVersion
21 | $(CURRENT_PROJECT_VERSION)
22 | NSPrincipalClass
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPIUsingHeroku/TaskAPI.xcodeproj/Vapor_Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | CFBundleDevelopmentRegion
5 | en
6 | CFBundleExecutable
7 | $(EXECUTABLE_NAME)
8 | CFBundleIdentifier
9 | $(PRODUCT_BUNDLE_IDENTIFIER)
10 | CFBundleInfoDictionaryVersion
11 | 6.0
12 | CFBundleName
13 | $(PRODUCT_NAME)
14 | CFBundlePackageType
15 | FMWK
16 | CFBundleShortVersionString
17 | 1.0
18 | CFBundleSignature
19 | ????
20 | CFBundleVersion
21 | $(CURRENT_PROJECT_VERSION)
22 | NSPrincipalClass
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPIUsingHeroku/TaskAPI.xcodeproj/WebSockets_Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | CFBundleDevelopmentRegion
5 | en
6 | CFBundleExecutable
7 | $(EXECUTABLE_NAME)
8 | CFBundleIdentifier
9 | $(PRODUCT_BUNDLE_IDENTIFIER)
10 | CFBundleInfoDictionaryVersion
11 | 6.0
12 | CFBundleName
13 | $(PRODUCT_NAME)
14 | CFBundlePackageType
15 | FMWK
16 | CFBundleShortVersionString
17 | 1.0
18 | CFBundleSignature
19 | ????
20 | CFBundleVersion
21 | $(CURRENT_PROJECT_VERSION)
22 | NSPrincipalClass
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPIUsingHeroku/TaskAPI.xcodeproj/libc_Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | CFBundleDevelopmentRegion
5 | en
6 | CFBundleExecutable
7 | $(EXECUTABLE_NAME)
8 | CFBundleIdentifier
9 | $(PRODUCT_BUNDLE_IDENTIFIER)
10 | CFBundleInfoDictionaryVersion
11 | 6.0
12 | CFBundleName
13 | $(PRODUCT_NAME)
14 | CFBundlePackageType
15 | FMWK
16 | CFBundleShortVersionString
17 | 1.0
18 | CFBundleSignature
19 | ????
20 | CFBundleVersion
21 | $(CURRENT_PROJECT_VERSION)
22 | NSPrincipalClass
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPIUsingHeroku/TaskAPI.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPIUsingHeroku/TaskAPI.xcodeproj/xcshareddata/xcschemes/xcschememanagement.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | SchemeUserState
5 |
6 | TaskAPI-Package.xcscheme
7 |
8 |
9 | SuppressBuildableAutocreation
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPIUsingHeroku/Tests/AppTests/Utilities.swift:
--------------------------------------------------------------------------------
1 | import Foundation
2 | @testable import App
3 | @testable import Vapor
4 | import XCTest
5 | import Testing
6 | import FluentProvider
7 |
8 | extension Droplet {
9 | static func testable() throws -> Droplet {
10 | let config = try Config(arguments: ["vapor", "--env=test"])
11 | try config.setup()
12 | let drop = try Droplet(config)
13 | try drop.setup()
14 | return drop
15 | }
16 | func serveInBackground() throws {
17 | background {
18 | try! self.run()
19 | }
20 | console.wait(seconds: 0.5)
21 | }
22 | }
23 |
24 | class TestCase: XCTestCase {
25 | override func setUp() {
26 | Node.fuzzy = [Row.self, JSON.self, Node.self]
27 | Testing.onFail = XCTFail
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPIUsingHeroku/Tests/LinuxMain.swift:
--------------------------------------------------------------------------------
1 | #if os(Linux)
2 |
3 | import XCTest
4 | @testable import AppTests
5 |
6 | XCTMain([
7 | // AppTests
8 | testCase(PostControllerTests.allTests),
9 | testCase(RouteTests.allTests)
10 | ])
11 |
12 | #endif
13 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPIUsingHeroku/circle.yml:
--------------------------------------------------------------------------------
1 | dependencies:
2 | override:
3 | - eval "$(curl -sL https://apt.vapor.sh)"
4 | - sudo apt-get install vapor
5 | - sudo chmod -R a+rx /usr/
6 | test:
7 | override:
8 | - swift build
9 | - swift build -c release
10 | - swift test
11 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPIUsingPostgres/.travis.yml:
--------------------------------------------------------------------------------
1 | os:
2 | - linux
3 | - osx
4 | language: generic
5 | sudo: required
6 | dist: trusty
7 |
8 | osx_image: xcode8.3
9 | before_install:
10 | - if [ $TRAVIS_OS_NAME == "osx" ]; then
11 | brew tap vapor/tap;
12 | brew update;
13 | brew install vapor;
14 | else
15 | eval "$(curl -sL https://apt.vapor.sh)";
16 | sudo apt-get install vapor;
17 | sudo chmod -R a+rx /usr/;
18 | fi
19 |
20 | script:
21 | - swift build
22 | - swift build -c release
23 | - swift test
24 |
25 | after_success:
26 | - eval "$(curl -sL https://swift.vapor.sh/codecov)"
27 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPIUsingPostgres/Config/app.json:
--------------------------------------------------------------------------------
1 | {
2 | "foo": "foo-bar"
3 | }
4 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPIUsingPostgres/Config/crypto.json:
--------------------------------------------------------------------------------
1 | {
2 | "hash": {
3 | "method": "sha256",
4 | "encoding": "hex",
5 | "key": "0000000000000000"
6 | },
7 |
8 | "cipher": {
9 | "method": "aes256",
10 | "encoding": "base64",
11 | "key": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA="
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPIUsingPostgres/Config/secrets/postgresql.json:
--------------------------------------------------------------------------------
1 | {
2 | "hostname": "127.0.0.1",
3 | "user": "keefmoon",
4 | "password": "",
5 | "database": "TaskAPI",
6 | "port": 5432
7 | }
8 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPIUsingPostgres/Config/server.json:
--------------------------------------------------------------------------------
1 | {
2 | "//": "The $PORT:8080 call tells the json file to see if there",
3 | "//": "is any value at the 'PORT' environment variable.",
4 | "//": "If there is no value there, it will fallback to '8080'",
5 | "port": "$PORT:8080",
6 |
7 | "host": "0.0.0.0",
8 |
9 | "//": "It's very rare that a server manages its own TLS.",
10 | "//": "More commonly, vapor is served behind a proxy like nginx.",
11 | "securityLayer": "none"
12 | }
13 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPIUsingPostgres/Package.swift:
--------------------------------------------------------------------------------
1 | import PackageDescription
2 |
3 | let package = Package(
4 | name: "TaskAPI",
5 | targets: [
6 | Target(name: "App"),
7 | Target(name: "Run", dependencies: ["App"]),
8 | ],
9 | dependencies: [
10 | .Package(url: "https://github.com/vapor/vapor.git", majorVersion: 2),
11 | .Package(url: "https://github.com/vapor/fluent-provider.git", majorVersion: 1),
12 | .Package(url: "https://github.com/vapor-community/postgresql-provider.git", majorVersion: 2, minor: 0)
13 | ],
14 | exclude: [
15 | "Config",
16 | "Database",
17 | "Localization",
18 | "Public",
19 | "Resources",
20 | ]
21 | )
22 |
23 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPIUsingPostgres/Public/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PacktPublishing/Swift-4-Programming-Cookbook/145d868a918517d0eaed55a1fd7a18ce25667e3d/Chapter07/ServerSideSwift-master/TaskAPIUsingPostgres/Public/.gitkeep
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPIUsingPostgres/Sources/App/Config+Setup.swift:
--------------------------------------------------------------------------------
1 | import PostgreSQLProvider
2 |
3 | extension Config {
4 | public func setup() throws {
5 | // allow fuzzy conversions for these types
6 | // (add your own types here)
7 | Node.fuzzy = [Row.self, JSON.self, Node.self]
8 |
9 | try setupProviders()
10 | try setupPreparations()
11 | }
12 |
13 | /// Configure providers
14 | private func setupProviders() throws {
15 | try addProvider(PostgreSQLProvider.Provider.self)
16 | }
17 |
18 | /// Add all models that should have their
19 | /// schemas prepared before the app boots
20 | private func setupPreparations() throws {
21 | preparations.append(Task.self)
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPIUsingPostgres/Sources/App/Droplet+Setup.swift:
--------------------------------------------------------------------------------
1 | @_exported import Vapor
2 |
3 | extension Droplet {
4 | public func setup() throws {
5 | try setupRoutes()
6 | // Do any additional droplet setup
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPIUsingPostgres/Sources/Run/main.swift:
--------------------------------------------------------------------------------
1 | import App
2 |
3 | /// We have isolated all of our App's logic into
4 | /// the App module because it makes our app
5 | /// more testable.
6 | ///
7 | /// In general, the executable portion of our App
8 | /// shouldn't include much more code than is presented
9 | /// here.
10 | ///
11 | /// We simply initialize our Droplet, optionally
12 | /// passing in values if necessary
13 | /// Then, we pass it to our App's setup function
14 | /// this should setup all the routes and special
15 | /// features of our app
16 | ///
17 | /// .run() runs the Droplet's commands,
18 | /// if no command is given, it will default to "serve"
19 | let config = try Config()
20 | try config.setup()
21 |
22 | let drop = try Droplet(config)
23 | try drop.setup()
24 |
25 | try drop.run()
26 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPIUsingPostgres/TaskAPI.xcodeproj/AppTests_Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | CFBundleDevelopmentRegion
5 | en
6 | CFBundleExecutable
7 | $(EXECUTABLE_NAME)
8 | CFBundleIdentifier
9 | $(PRODUCT_BUNDLE_IDENTIFIER)
10 | CFBundleInfoDictionaryVersion
11 | 6.0
12 | CFBundleName
13 | $(PRODUCT_NAME)
14 | CFBundlePackageType
15 | BNDL
16 | CFBundleShortVersionString
17 | 1.0
18 | CFBundleSignature
19 | ????
20 | CFBundleVersion
21 | $(CURRENT_PROJECT_VERSION)
22 | NSPrincipalClass
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPIUsingPostgres/TaskAPI.xcodeproj/App_Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | CFBundleDevelopmentRegion
5 | en
6 | CFBundleExecutable
7 | $(EXECUTABLE_NAME)
8 | CFBundleIdentifier
9 | $(PRODUCT_BUNDLE_IDENTIFIER)
10 | CFBundleInfoDictionaryVersion
11 | 6.0
12 | CFBundleName
13 | $(PRODUCT_NAME)
14 | CFBundlePackageType
15 | FMWK
16 | CFBundleShortVersionString
17 | 1.0
18 | CFBundleSignature
19 | ????
20 | CFBundleVersion
21 | $(CURRENT_PROJECT_VERSION)
22 | NSPrincipalClass
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPIUsingPostgres/TaskAPI.xcodeproj/BCrypt_Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | CFBundleDevelopmentRegion
5 | en
6 | CFBundleExecutable
7 | $(EXECUTABLE_NAME)
8 | CFBundleIdentifier
9 | $(PRODUCT_BUNDLE_IDENTIFIER)
10 | CFBundleInfoDictionaryVersion
11 | 6.0
12 | CFBundleName
13 | $(PRODUCT_NAME)
14 | CFBundlePackageType
15 | FMWK
16 | CFBundleShortVersionString
17 | 1.0
18 | CFBundleSignature
19 | ????
20 | CFBundleVersion
21 | $(CURRENT_PROJECT_VERSION)
22 | NSPrincipalClass
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPIUsingPostgres/TaskAPI.xcodeproj/Bits_Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | CFBundleDevelopmentRegion
5 | en
6 | CFBundleExecutable
7 | $(EXECUTABLE_NAME)
8 | CFBundleIdentifier
9 | $(PRODUCT_BUNDLE_IDENTIFIER)
10 | CFBundleInfoDictionaryVersion
11 | 6.0
12 | CFBundleName
13 | $(PRODUCT_NAME)
14 | CFBundlePackageType
15 | FMWK
16 | CFBundleShortVersionString
17 | 1.0
18 | CFBundleSignature
19 | ????
20 | CFBundleVersion
21 | $(CURRENT_PROJECT_VERSION)
22 | NSPrincipalClass
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPIUsingPostgres/TaskAPI.xcodeproj/Branches_Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | CFBundleDevelopmentRegion
5 | en
6 | CFBundleExecutable
7 | $(EXECUTABLE_NAME)
8 | CFBundleIdentifier
9 | $(PRODUCT_BUNDLE_IDENTIFIER)
10 | CFBundleInfoDictionaryVersion
11 | 6.0
12 | CFBundleName
13 | $(PRODUCT_NAME)
14 | CFBundlePackageType
15 | FMWK
16 | CFBundleShortVersionString
17 | 1.0
18 | CFBundleSignature
19 | ????
20 | CFBundleVersion
21 | $(CURRENT_PROJECT_VERSION)
22 | NSPrincipalClass
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPIUsingPostgres/TaskAPI.xcodeproj/CHTTP_Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | CFBundleDevelopmentRegion
5 | en
6 | CFBundleExecutable
7 | $(EXECUTABLE_NAME)
8 | CFBundleIdentifier
9 | $(PRODUCT_BUNDLE_IDENTIFIER)
10 | CFBundleInfoDictionaryVersion
11 | 6.0
12 | CFBundleName
13 | $(PRODUCT_NAME)
14 | CFBundlePackageType
15 | FMWK
16 | CFBundleShortVersionString
17 | 1.0
18 | CFBundleSignature
19 | ????
20 | CFBundleVersion
21 | $(CURRENT_PROJECT_VERSION)
22 | NSPrincipalClass
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPIUsingPostgres/TaskAPI.xcodeproj/CSQLite_Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | CFBundleDevelopmentRegion
5 | en
6 | CFBundleExecutable
7 | $(EXECUTABLE_NAME)
8 | CFBundleIdentifier
9 | $(PRODUCT_BUNDLE_IDENTIFIER)
10 | CFBundleInfoDictionaryVersion
11 | 6.0
12 | CFBundleName
13 | $(PRODUCT_NAME)
14 | CFBundlePackageType
15 | FMWK
16 | CFBundleShortVersionString
17 | 1.0
18 | CFBundleSignature
19 | ????
20 | CFBundleVersion
21 | $(CURRENT_PROJECT_VERSION)
22 | NSPrincipalClass
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPIUsingPostgres/TaskAPI.xcodeproj/Cache_Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | CFBundleDevelopmentRegion
5 | en
6 | CFBundleExecutable
7 | $(EXECUTABLE_NAME)
8 | CFBundleIdentifier
9 | $(PRODUCT_BUNDLE_IDENTIFIER)
10 | CFBundleInfoDictionaryVersion
11 | 6.0
12 | CFBundleName
13 | $(PRODUCT_NAME)
14 | CFBundlePackageType
15 | FMWK
16 | CFBundleShortVersionString
17 | 1.0
18 | CFBundleSignature
19 | ????
20 | CFBundleVersion
21 | $(CURRENT_PROJECT_VERSION)
22 | NSPrincipalClass
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPIUsingPostgres/TaskAPI.xcodeproj/Configs_Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | CFBundleDevelopmentRegion
5 | en
6 | CFBundleExecutable
7 | $(EXECUTABLE_NAME)
8 | CFBundleIdentifier
9 | $(PRODUCT_BUNDLE_IDENTIFIER)
10 | CFBundleInfoDictionaryVersion
11 | 6.0
12 | CFBundleName
13 | $(PRODUCT_NAME)
14 | CFBundlePackageType
15 | FMWK
16 | CFBundleShortVersionString
17 | 1.0
18 | CFBundleSignature
19 | ????
20 | CFBundleVersion
21 | $(CURRENT_PROJECT_VERSION)
22 | NSPrincipalClass
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPIUsingPostgres/TaskAPI.xcodeproj/Console_Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | CFBundleDevelopmentRegion
5 | en
6 | CFBundleExecutable
7 | $(EXECUTABLE_NAME)
8 | CFBundleIdentifier
9 | $(PRODUCT_BUNDLE_IDENTIFIER)
10 | CFBundleInfoDictionaryVersion
11 | 6.0
12 | CFBundleName
13 | $(PRODUCT_NAME)
14 | CFBundlePackageType
15 | FMWK
16 | CFBundleShortVersionString
17 | 1.0
18 | CFBundleSignature
19 | ????
20 | CFBundleVersion
21 | $(CURRENT_PROJECT_VERSION)
22 | NSPrincipalClass
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPIUsingPostgres/TaskAPI.xcodeproj/Cookies_Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | CFBundleDevelopmentRegion
5 | en
6 | CFBundleExecutable
7 | $(EXECUTABLE_NAME)
8 | CFBundleIdentifier
9 | $(PRODUCT_BUNDLE_IDENTIFIER)
10 | CFBundleInfoDictionaryVersion
11 | 6.0
12 | CFBundleName
13 | $(PRODUCT_NAME)
14 | CFBundlePackageType
15 | FMWK
16 | CFBundleShortVersionString
17 | 1.0
18 | CFBundleSignature
19 | ????
20 | CFBundleVersion
21 | $(CURRENT_PROJECT_VERSION)
22 | NSPrincipalClass
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPIUsingPostgres/TaskAPI.xcodeproj/Core_Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | CFBundleDevelopmentRegion
5 | en
6 | CFBundleExecutable
7 | $(EXECUTABLE_NAME)
8 | CFBundleIdentifier
9 | $(PRODUCT_BUNDLE_IDENTIFIER)
10 | CFBundleInfoDictionaryVersion
11 | 6.0
12 | CFBundleName
13 | $(PRODUCT_NAME)
14 | CFBundlePackageType
15 | FMWK
16 | CFBundleShortVersionString
17 | 1.0
18 | CFBundleSignature
19 | ????
20 | CFBundleVersion
21 | $(CURRENT_PROJECT_VERSION)
22 | NSPrincipalClass
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPIUsingPostgres/TaskAPI.xcodeproj/Crypto_Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | CFBundleDevelopmentRegion
5 | en
6 | CFBundleExecutable
7 | $(EXECUTABLE_NAME)
8 | CFBundleIdentifier
9 | $(PRODUCT_BUNDLE_IDENTIFIER)
10 | CFBundleInfoDictionaryVersion
11 | 6.0
12 | CFBundleName
13 | $(PRODUCT_NAME)
14 | CFBundlePackageType
15 | FMWK
16 | CFBundleShortVersionString
17 | 1.0
18 | CFBundleSignature
19 | ????
20 | CFBundleVersion
21 | $(CURRENT_PROJECT_VERSION)
22 | NSPrincipalClass
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPIUsingPostgres/TaskAPI.xcodeproj/Debugging_Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | CFBundleDevelopmentRegion
5 | en
6 | CFBundleExecutable
7 | $(EXECUTABLE_NAME)
8 | CFBundleIdentifier
9 | $(PRODUCT_BUNDLE_IDENTIFIER)
10 | CFBundleInfoDictionaryVersion
11 | 6.0
12 | CFBundleName
13 | $(PRODUCT_NAME)
14 | CFBundlePackageType
15 | FMWK
16 | CFBundleShortVersionString
17 | 1.0
18 | CFBundleSignature
19 | ????
20 | CFBundleVersion
21 | $(CURRENT_PROJECT_VERSION)
22 | NSPrincipalClass
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPIUsingPostgres/TaskAPI.xcodeproj/Fluent_Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | CFBundleDevelopmentRegion
5 | en
6 | CFBundleExecutable
7 | $(EXECUTABLE_NAME)
8 | CFBundleIdentifier
9 | $(PRODUCT_BUNDLE_IDENTIFIER)
10 | CFBundleInfoDictionaryVersion
11 | 6.0
12 | CFBundleName
13 | $(PRODUCT_NAME)
14 | CFBundlePackageType
15 | FMWK
16 | CFBundleShortVersionString
17 | 1.0
18 | CFBundleSignature
19 | ????
20 | CFBundleVersion
21 | $(CURRENT_PROJECT_VERSION)
22 | NSPrincipalClass
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPIUsingPostgres/TaskAPI.xcodeproj/FormData_Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | CFBundleDevelopmentRegion
5 | en
6 | CFBundleExecutable
7 | $(EXECUTABLE_NAME)
8 | CFBundleIdentifier
9 | $(PRODUCT_BUNDLE_IDENTIFIER)
10 | CFBundleInfoDictionaryVersion
11 | 6.0
12 | CFBundleName
13 | $(PRODUCT_NAME)
14 | CFBundlePackageType
15 | FMWK
16 | CFBundleShortVersionString
17 | 1.0
18 | CFBundleSignature
19 | ????
20 | CFBundleVersion
21 | $(CURRENT_PROJECT_VERSION)
22 | NSPrincipalClass
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPIUsingPostgres/TaskAPI.xcodeproj/GeneratedModuleMap/CHTTP/module.modulemap:
--------------------------------------------------------------------------------
1 | module CHTTP {
2 | umbrella "/Users/keefmoon/Dropbox/Projects/Swift Programming Cookbook/sourcecode/ServerSideSwift/TaskAPIUsingPostgres/.build/checkouts/engine.git-3311994267206676365/Sources/CHTTP/include"
3 | export *
4 | }
5 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPIUsingPostgres/TaskAPI.xcodeproj/GeneratedModuleMap/CSQLite/module.modulemap:
--------------------------------------------------------------------------------
1 | module CSQLite {
2 | umbrella "/Users/keefmoon/Dropbox/Projects/Swift Programming Cookbook/sourcecode/ServerSideSwift/TaskAPIUsingPostgres/.build/checkouts/sqlite.git--8232814251736334455/Sources/CSQLite/include"
3 | export *
4 | }
5 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPIUsingPostgres/TaskAPI.xcodeproj/HTTP_Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | CFBundleDevelopmentRegion
5 | en
6 | CFBundleExecutable
7 | $(EXECUTABLE_NAME)
8 | CFBundleIdentifier
9 | $(PRODUCT_BUNDLE_IDENTIFIER)
10 | CFBundleInfoDictionaryVersion
11 | 6.0
12 | CFBundleName
13 | $(PRODUCT_NAME)
14 | CFBundlePackageType
15 | FMWK
16 | CFBundleShortVersionString
17 | 1.0
18 | CFBundleSignature
19 | ????
20 | CFBundleVersion
21 | $(CURRENT_PROJECT_VERSION)
22 | NSPrincipalClass
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPIUsingPostgres/TaskAPI.xcodeproj/JSON_Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | CFBundleDevelopmentRegion
5 | en
6 | CFBundleExecutable
7 | $(EXECUTABLE_NAME)
8 | CFBundleIdentifier
9 | $(PRODUCT_BUNDLE_IDENTIFIER)
10 | CFBundleInfoDictionaryVersion
11 | 6.0
12 | CFBundleName
13 | $(PRODUCT_NAME)
14 | CFBundlePackageType
15 | FMWK
16 | CFBundleShortVersionString
17 | 1.0
18 | CFBundleSignature
19 | ????
20 | CFBundleVersion
21 | $(CURRENT_PROJECT_VERSION)
22 | NSPrincipalClass
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPIUsingPostgres/TaskAPI.xcodeproj/Multipart_Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | CFBundleDevelopmentRegion
5 | en
6 | CFBundleExecutable
7 | $(EXECUTABLE_NAME)
8 | CFBundleIdentifier
9 | $(PRODUCT_BUNDLE_IDENTIFIER)
10 | CFBundleInfoDictionaryVersion
11 | 6.0
12 | CFBundleName
13 | $(PRODUCT_NAME)
14 | CFBundlePackageType
15 | FMWK
16 | CFBundleShortVersionString
17 | 1.0
18 | CFBundleSignature
19 | ????
20 | CFBundleVersion
21 | $(CURRENT_PROJECT_VERSION)
22 | NSPrincipalClass
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPIUsingPostgres/TaskAPI.xcodeproj/Node_Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | CFBundleDevelopmentRegion
5 | en
6 | CFBundleExecutable
7 | $(EXECUTABLE_NAME)
8 | CFBundleIdentifier
9 | $(PRODUCT_BUNDLE_IDENTIFIER)
10 | CFBundleInfoDictionaryVersion
11 | 6.0
12 | CFBundleName
13 | $(PRODUCT_NAME)
14 | CFBundlePackageType
15 | FMWK
16 | CFBundleShortVersionString
17 | 1.0
18 | CFBundleSignature
19 | ????
20 | CFBundleVersion
21 | $(CURRENT_PROJECT_VERSION)
22 | NSPrincipalClass
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPIUsingPostgres/TaskAPI.xcodeproj/PostgreSQL_Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | CFBundleDevelopmentRegion
5 | en
6 | CFBundleExecutable
7 | $(EXECUTABLE_NAME)
8 | CFBundleIdentifier
9 | $(PRODUCT_BUNDLE_IDENTIFIER)
10 | CFBundleInfoDictionaryVersion
11 | 6.0
12 | CFBundleName
13 | $(PRODUCT_NAME)
14 | CFBundlePackageType
15 | FMWK
16 | CFBundleShortVersionString
17 | 1.0
18 | CFBundleSignature
19 | ????
20 | CFBundleVersion
21 | $(CURRENT_PROJECT_VERSION)
22 | NSPrincipalClass
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPIUsingPostgres/TaskAPI.xcodeproj/Random_Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | CFBundleDevelopmentRegion
5 | en
6 | CFBundleExecutable
7 | $(EXECUTABLE_NAME)
8 | CFBundleIdentifier
9 | $(PRODUCT_BUNDLE_IDENTIFIER)
10 | CFBundleInfoDictionaryVersion
11 | 6.0
12 | CFBundleName
13 | $(PRODUCT_NAME)
14 | CFBundlePackageType
15 | FMWK
16 | CFBundleShortVersionString
17 | 1.0
18 | CFBundleSignature
19 | ????
20 | CFBundleVersion
21 | $(CURRENT_PROJECT_VERSION)
22 | NSPrincipalClass
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPIUsingPostgres/TaskAPI.xcodeproj/Routing_Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | CFBundleDevelopmentRegion
5 | en
6 | CFBundleExecutable
7 | $(EXECUTABLE_NAME)
8 | CFBundleIdentifier
9 | $(PRODUCT_BUNDLE_IDENTIFIER)
10 | CFBundleInfoDictionaryVersion
11 | 6.0
12 | CFBundleName
13 | $(PRODUCT_NAME)
14 | CFBundlePackageType
15 | FMWK
16 | CFBundleShortVersionString
17 | 1.0
18 | CFBundleSignature
19 | ????
20 | CFBundleVersion
21 | $(CURRENT_PROJECT_VERSION)
22 | NSPrincipalClass
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPIUsingPostgres/TaskAPI.xcodeproj/SMTP_Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | CFBundleDevelopmentRegion
5 | en
6 | CFBundleExecutable
7 | $(EXECUTABLE_NAME)
8 | CFBundleIdentifier
9 | $(PRODUCT_BUNDLE_IDENTIFIER)
10 | CFBundleInfoDictionaryVersion
11 | 6.0
12 | CFBundleName
13 | $(PRODUCT_NAME)
14 | CFBundlePackageType
15 | FMWK
16 | CFBundleShortVersionString
17 | 1.0
18 | CFBundleSignature
19 | ????
20 | CFBundleVersion
21 | $(CURRENT_PROJECT_VERSION)
22 | NSPrincipalClass
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPIUsingPostgres/TaskAPI.xcodeproj/SQLite_Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | CFBundleDevelopmentRegion
5 | en
6 | CFBundleExecutable
7 | $(EXECUTABLE_NAME)
8 | CFBundleIdentifier
9 | $(PRODUCT_BUNDLE_IDENTIFIER)
10 | CFBundleInfoDictionaryVersion
11 | 6.0
12 | CFBundleName
13 | $(PRODUCT_NAME)
14 | CFBundlePackageType
15 | FMWK
16 | CFBundleShortVersionString
17 | 1.0
18 | CFBundleSignature
19 | ????
20 | CFBundleVersion
21 | $(CURRENT_PROJECT_VERSION)
22 | NSPrincipalClass
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPIUsingPostgres/TaskAPI.xcodeproj/Sessions_Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | CFBundleDevelopmentRegion
5 | en
6 | CFBundleExecutable
7 | $(EXECUTABLE_NAME)
8 | CFBundleIdentifier
9 | $(PRODUCT_BUNDLE_IDENTIFIER)
10 | CFBundleInfoDictionaryVersion
11 | 6.0
12 | CFBundleName
13 | $(PRODUCT_NAME)
14 | CFBundlePackageType
15 | FMWK
16 | CFBundleShortVersionString
17 | 1.0
18 | CFBundleSignature
19 | ????
20 | CFBundleVersion
21 | $(CURRENT_PROJECT_VERSION)
22 | NSPrincipalClass
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPIUsingPostgres/TaskAPI.xcodeproj/Sockets_Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | CFBundleDevelopmentRegion
5 | en
6 | CFBundleExecutable
7 | $(EXECUTABLE_NAME)
8 | CFBundleIdentifier
9 | $(PRODUCT_BUNDLE_IDENTIFIER)
10 | CFBundleInfoDictionaryVersion
11 | 6.0
12 | CFBundleName
13 | $(PRODUCT_NAME)
14 | CFBundlePackageType
15 | FMWK
16 | CFBundleShortVersionString
17 | 1.0
18 | CFBundleSignature
19 | ????
20 | CFBundleVersion
21 | $(CURRENT_PROJECT_VERSION)
22 | NSPrincipalClass
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPIUsingPostgres/TaskAPI.xcodeproj/TLS_Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | CFBundleDevelopmentRegion
5 | en
6 | CFBundleExecutable
7 | $(EXECUTABLE_NAME)
8 | CFBundleIdentifier
9 | $(PRODUCT_BUNDLE_IDENTIFIER)
10 | CFBundleInfoDictionaryVersion
11 | 6.0
12 | CFBundleName
13 | $(PRODUCT_NAME)
14 | CFBundlePackageType
15 | FMWK
16 | CFBundleShortVersionString
17 | 1.0
18 | CFBundleSignature
19 | ????
20 | CFBundleVersion
21 | $(CURRENT_PROJECT_VERSION)
22 | NSPrincipalClass
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPIUsingPostgres/TaskAPI.xcodeproj/Testing_Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | CFBundleDevelopmentRegion
5 | en
6 | CFBundleExecutable
7 | $(EXECUTABLE_NAME)
8 | CFBundleIdentifier
9 | $(PRODUCT_BUNDLE_IDENTIFIER)
10 | CFBundleInfoDictionaryVersion
11 | 6.0
12 | CFBundleName
13 | $(PRODUCT_NAME)
14 | CFBundlePackageType
15 | FMWK
16 | CFBundleShortVersionString
17 | 1.0
18 | CFBundleSignature
19 | ????
20 | CFBundleVersion
21 | $(CURRENT_PROJECT_VERSION)
22 | NSPrincipalClass
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPIUsingPostgres/TaskAPI.xcodeproj/Transport_Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | CFBundleDevelopmentRegion
5 | en
6 | CFBundleExecutable
7 | $(EXECUTABLE_NAME)
8 | CFBundleIdentifier
9 | $(PRODUCT_BUNDLE_IDENTIFIER)
10 | CFBundleInfoDictionaryVersion
11 | 6.0
12 | CFBundleName
13 | $(PRODUCT_NAME)
14 | CFBundlePackageType
15 | FMWK
16 | CFBundleShortVersionString
17 | 1.0
18 | CFBundleSignature
19 | ????
20 | CFBundleVersion
21 | $(CURRENT_PROJECT_VERSION)
22 | NSPrincipalClass
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPIUsingPostgres/TaskAPI.xcodeproj/URI_Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | CFBundleDevelopmentRegion
5 | en
6 | CFBundleExecutable
7 | $(EXECUTABLE_NAME)
8 | CFBundleIdentifier
9 | $(PRODUCT_BUNDLE_IDENTIFIER)
10 | CFBundleInfoDictionaryVersion
11 | 6.0
12 | CFBundleName
13 | $(PRODUCT_NAME)
14 | CFBundlePackageType
15 | FMWK
16 | CFBundleShortVersionString
17 | 1.0
18 | CFBundleSignature
19 | ????
20 | CFBundleVersion
21 | $(CURRENT_PROJECT_VERSION)
22 | NSPrincipalClass
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPIUsingPostgres/TaskAPI.xcodeproj/Vapor_Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | CFBundleDevelopmentRegion
5 | en
6 | CFBundleExecutable
7 | $(EXECUTABLE_NAME)
8 | CFBundleIdentifier
9 | $(PRODUCT_BUNDLE_IDENTIFIER)
10 | CFBundleInfoDictionaryVersion
11 | 6.0
12 | CFBundleName
13 | $(PRODUCT_NAME)
14 | CFBundlePackageType
15 | FMWK
16 | CFBundleShortVersionString
17 | 1.0
18 | CFBundleSignature
19 | ????
20 | CFBundleVersion
21 | $(CURRENT_PROJECT_VERSION)
22 | NSPrincipalClass
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPIUsingPostgres/TaskAPI.xcodeproj/WebSockets_Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | CFBundleDevelopmentRegion
5 | en
6 | CFBundleExecutable
7 | $(EXECUTABLE_NAME)
8 | CFBundleIdentifier
9 | $(PRODUCT_BUNDLE_IDENTIFIER)
10 | CFBundleInfoDictionaryVersion
11 | 6.0
12 | CFBundleName
13 | $(PRODUCT_NAME)
14 | CFBundlePackageType
15 | FMWK
16 | CFBundleShortVersionString
17 | 1.0
18 | CFBundleSignature
19 | ????
20 | CFBundleVersion
21 | $(CURRENT_PROJECT_VERSION)
22 | NSPrincipalClass
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPIUsingPostgres/TaskAPI.xcodeproj/libc_Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | CFBundleDevelopmentRegion
5 | en
6 | CFBundleExecutable
7 | $(EXECUTABLE_NAME)
8 | CFBundleIdentifier
9 | $(PRODUCT_BUNDLE_IDENTIFIER)
10 | CFBundleInfoDictionaryVersion
11 | 6.0
12 | CFBundleName
13 | $(PRODUCT_NAME)
14 | CFBundlePackageType
15 | FMWK
16 | CFBundleShortVersionString
17 | 1.0
18 | CFBundleSignature
19 | ????
20 | CFBundleVersion
21 | $(CURRENT_PROJECT_VERSION)
22 | NSPrincipalClass
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPIUsingPostgres/TaskAPI.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPIUsingPostgres/TaskAPI.xcodeproj/xcshareddata/xcschemes/xcschememanagement.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | SchemeUserState
5 |
6 | TaskAPI-Package.xcscheme
7 |
8 |
9 | SuppressBuildableAutocreation
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPIUsingPostgres/Tests/AppTests/Utilities.swift:
--------------------------------------------------------------------------------
1 | import Foundation
2 | @testable import App
3 | @testable import Vapor
4 | import XCTest
5 | import Testing
6 | import FluentProvider
7 |
8 | extension Droplet {
9 | static func testable() throws -> Droplet {
10 | let config = try Config(arguments: ["vapor", "--env=test"])
11 | try config.setup()
12 | let drop = try Droplet(config)
13 | try drop.setup()
14 | return drop
15 | }
16 | func serveInBackground() throws {
17 | background {
18 | try! self.run()
19 | }
20 | console.wait(seconds: 0.5)
21 | }
22 | }
23 |
24 | class TestCase: XCTestCase {
25 | override func setUp() {
26 | Node.fuzzy = [Row.self, JSON.self, Node.self]
27 | Testing.onFail = XCTFail
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPIUsingPostgres/Tests/LinuxMain.swift:
--------------------------------------------------------------------------------
1 | #if os(Linux)
2 |
3 | import XCTest
4 | @testable import AppTests
5 |
6 | XCTMain([
7 | // AppTests
8 | testCase(PostControllerTests.allTests),
9 | testCase(RouteTests.allTests)
10 | ])
11 |
12 | #endif
13 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPIUsingPostgres/circle.yml:
--------------------------------------------------------------------------------
1 | dependencies:
2 | override:
3 | - eval "$(curl -sL https://apt.vapor.sh)"
4 | - sudo apt-get install vapor
5 | - sudo chmod -R a+rx /usr/
6 | test:
7 | override:
8 | - swift build
9 | - swift build -c release
10 | - swift test
11 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPIUsingResources/.travis.yml:
--------------------------------------------------------------------------------
1 | os:
2 | - linux
3 | - osx
4 | language: generic
5 | sudo: required
6 | dist: trusty
7 |
8 | osx_image: xcode8.3
9 | before_install:
10 | - if [ $TRAVIS_OS_NAME == "osx" ]; then
11 | brew tap vapor/tap;
12 | brew update;
13 | brew install vapor;
14 | else
15 | eval "$(curl -sL https://apt.vapor.sh)";
16 | sudo apt-get install vapor;
17 | sudo chmod -R a+rx /usr/;
18 | fi
19 |
20 | script:
21 | - swift build
22 | - swift build -c release
23 | - swift test
24 |
25 | after_success:
26 | - eval "$(curl -sL https://swift.vapor.sh/codecov)"
27 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPIUsingResources/Config/app.json:
--------------------------------------------------------------------------------
1 | {
2 | "foo": "foo-bar"
3 | }
4 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPIUsingResources/Config/crypto.json:
--------------------------------------------------------------------------------
1 | {
2 | "hash": {
3 | "method": "sha256",
4 | "encoding": "hex",
5 | "key": "0000000000000000"
6 | },
7 |
8 | "cipher": {
9 | "method": "aes256",
10 | "encoding": "base64",
11 | "key": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA="
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPIUsingResources/Config/server.json:
--------------------------------------------------------------------------------
1 | {
2 | "//": "The $PORT:8080 call tells the json file to see if there",
3 | "//": "is any value at the 'PORT' environment variable.",
4 | "//": "If there is no value there, it will fallback to '8080'",
5 | "port": "$PORT:8080",
6 |
7 | "host": "0.0.0.0",
8 |
9 | "//": "It's very rare that a server manages its own TLS.",
10 | "//": "More commonly, vapor is served behind a proxy like nginx.",
11 | "securityLayer": "none"
12 | }
13 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPIUsingResources/Package.swift:
--------------------------------------------------------------------------------
1 | import PackageDescription
2 |
3 | let package = Package(
4 | name: "TaskAPI",
5 | targets: [
6 | Target(name: "App"),
7 | Target(name: "Run", dependencies: ["App"]),
8 | ],
9 | dependencies: [
10 | .Package(url: "https://github.com/vapor/vapor.git", majorVersion: 2),
11 | .Package(url: "https://github.com/vapor/fluent-provider.git", majorVersion: 1)
12 | ],
13 | exclude: [
14 | "Config",
15 | "Database",
16 | "Localization",
17 | "Public",
18 | "Resources",
19 | ]
20 | )
21 |
22 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPIUsingResources/Public/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PacktPublishing/Swift-4-Programming-Cookbook/145d868a918517d0eaed55a1fd7a18ce25667e3d/Chapter07/ServerSideSwift-master/TaskAPIUsingResources/Public/.gitkeep
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPIUsingResources/Sources/App/Config+Setup.swift:
--------------------------------------------------------------------------------
1 | import FluentProvider
2 |
3 | extension Config {
4 | public func setup() throws {
5 | // allow fuzzy conversions for these types
6 | // (add your own types here)
7 | Node.fuzzy = [Row.self, JSON.self, Node.self]
8 |
9 | try setupProviders()
10 | try setupPreparations()
11 | }
12 |
13 | /// Configure providers
14 | private func setupProviders() throws {
15 | try addProvider(FluentProvider.Provider.self)
16 | }
17 |
18 | /// Add all models that should have their
19 | /// schemas prepared before the app boots
20 | private func setupPreparations() throws {
21 | preparations.append(Post.self)
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPIUsingResources/Sources/App/Droplet+Setup.swift:
--------------------------------------------------------------------------------
1 | @_exported import Vapor
2 |
3 | extension Droplet {
4 | public func setup() throws {
5 | try setupRoutes()
6 | // Do any additional droplet setup
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPIUsingResources/Sources/Run/main.swift:
--------------------------------------------------------------------------------
1 | import App
2 |
3 | /// We have isolated all of our App's logic into
4 | /// the App module because it makes our app
5 | /// more testable.
6 | ///
7 | /// In general, the executable portion of our App
8 | /// shouldn't include much more code than is presented
9 | /// here.
10 | ///
11 | /// We simply initialize our Droplet, optionally
12 | /// passing in values if necessary
13 | /// Then, we pass it to our App's setup function
14 | /// this should setup all the routes and special
15 | /// features of our app
16 | ///
17 | /// .run() runs the Droplet's commands,
18 | /// if no command is given, it will default to "serve"
19 | let config = try Config()
20 | try config.setup()
21 |
22 | let drop = try Droplet(config)
23 | try drop.setup()
24 |
25 | try drop.run()
26 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPIUsingResources/TaskAPI.xcodeproj/AppTests_Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | CFBundleDevelopmentRegion
5 | en
6 | CFBundleExecutable
7 | $(EXECUTABLE_NAME)
8 | CFBundleIdentifier
9 | $(PRODUCT_BUNDLE_IDENTIFIER)
10 | CFBundleInfoDictionaryVersion
11 | 6.0
12 | CFBundleName
13 | $(PRODUCT_NAME)
14 | CFBundlePackageType
15 | BNDL
16 | CFBundleShortVersionString
17 | 1.0
18 | CFBundleSignature
19 | ????
20 | CFBundleVersion
21 | $(CURRENT_PROJECT_VERSION)
22 | NSPrincipalClass
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPIUsingResources/TaskAPI.xcodeproj/App_Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | CFBundleDevelopmentRegion
5 | en
6 | CFBundleExecutable
7 | $(EXECUTABLE_NAME)
8 | CFBundleIdentifier
9 | $(PRODUCT_BUNDLE_IDENTIFIER)
10 | CFBundleInfoDictionaryVersion
11 | 6.0
12 | CFBundleName
13 | $(PRODUCT_NAME)
14 | CFBundlePackageType
15 | FMWK
16 | CFBundleShortVersionString
17 | 1.0
18 | CFBundleSignature
19 | ????
20 | CFBundleVersion
21 | $(CURRENT_PROJECT_VERSION)
22 | NSPrincipalClass
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPIUsingResources/TaskAPI.xcodeproj/BCrypt_Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | CFBundleDevelopmentRegion
5 | en
6 | CFBundleExecutable
7 | $(EXECUTABLE_NAME)
8 | CFBundleIdentifier
9 | $(PRODUCT_BUNDLE_IDENTIFIER)
10 | CFBundleInfoDictionaryVersion
11 | 6.0
12 | CFBundleName
13 | $(PRODUCT_NAME)
14 | CFBundlePackageType
15 | FMWK
16 | CFBundleShortVersionString
17 | 1.0
18 | CFBundleSignature
19 | ????
20 | CFBundleVersion
21 | $(CURRENT_PROJECT_VERSION)
22 | NSPrincipalClass
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPIUsingResources/TaskAPI.xcodeproj/Bits_Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | CFBundleDevelopmentRegion
5 | en
6 | CFBundleExecutable
7 | $(EXECUTABLE_NAME)
8 | CFBundleIdentifier
9 | $(PRODUCT_BUNDLE_IDENTIFIER)
10 | CFBundleInfoDictionaryVersion
11 | 6.0
12 | CFBundleName
13 | $(PRODUCT_NAME)
14 | CFBundlePackageType
15 | FMWK
16 | CFBundleShortVersionString
17 | 1.0
18 | CFBundleSignature
19 | ????
20 | CFBundleVersion
21 | $(CURRENT_PROJECT_VERSION)
22 | NSPrincipalClass
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPIUsingResources/TaskAPI.xcodeproj/Branches_Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | CFBundleDevelopmentRegion
5 | en
6 | CFBundleExecutable
7 | $(EXECUTABLE_NAME)
8 | CFBundleIdentifier
9 | $(PRODUCT_BUNDLE_IDENTIFIER)
10 | CFBundleInfoDictionaryVersion
11 | 6.0
12 | CFBundleName
13 | $(PRODUCT_NAME)
14 | CFBundlePackageType
15 | FMWK
16 | CFBundleShortVersionString
17 | 1.0
18 | CFBundleSignature
19 | ????
20 | CFBundleVersion
21 | $(CURRENT_PROJECT_VERSION)
22 | NSPrincipalClass
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPIUsingResources/TaskAPI.xcodeproj/CHTTP_Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | CFBundleDevelopmentRegion
5 | en
6 | CFBundleExecutable
7 | $(EXECUTABLE_NAME)
8 | CFBundleIdentifier
9 | $(PRODUCT_BUNDLE_IDENTIFIER)
10 | CFBundleInfoDictionaryVersion
11 | 6.0
12 | CFBundleName
13 | $(PRODUCT_NAME)
14 | CFBundlePackageType
15 | FMWK
16 | CFBundleShortVersionString
17 | 1.0
18 | CFBundleSignature
19 | ????
20 | CFBundleVersion
21 | $(CURRENT_PROJECT_VERSION)
22 | NSPrincipalClass
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPIUsingResources/TaskAPI.xcodeproj/Cache_Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | CFBundleDevelopmentRegion
5 | en
6 | CFBundleExecutable
7 | $(EXECUTABLE_NAME)
8 | CFBundleIdentifier
9 | $(PRODUCT_BUNDLE_IDENTIFIER)
10 | CFBundleInfoDictionaryVersion
11 | 6.0
12 | CFBundleName
13 | $(PRODUCT_NAME)
14 | CFBundlePackageType
15 | FMWK
16 | CFBundleShortVersionString
17 | 1.0
18 | CFBundleSignature
19 | ????
20 | CFBundleVersion
21 | $(CURRENT_PROJECT_VERSION)
22 | NSPrincipalClass
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPIUsingResources/TaskAPI.xcodeproj/Core_Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | CFBundleDevelopmentRegion
5 | en
6 | CFBundleExecutable
7 | $(EXECUTABLE_NAME)
8 | CFBundleIdentifier
9 | $(PRODUCT_BUNDLE_IDENTIFIER)
10 | CFBundleInfoDictionaryVersion
11 | 6.0
12 | CFBundleName
13 | $(PRODUCT_NAME)
14 | CFBundlePackageType
15 | FMWK
16 | CFBundleShortVersionString
17 | 1.0
18 | CFBundleSignature
19 | ????
20 | CFBundleVersion
21 | $(CURRENT_PROJECT_VERSION)
22 | NSPrincipalClass
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPIUsingResources/TaskAPI.xcodeproj/GeneratedModuleMap/CHTTP/module.modulemap:
--------------------------------------------------------------------------------
1 | module CHTTP {
2 | umbrella "/Users/keefmoon/Dropbox/Projects/Swift Programming Cookbook/sourcecode/ServerSideSwift/TaskAPI/.build/checkouts/engine.git-3311994267206676365/Sources/CHTTP/include"
3 | export *
4 | }
5 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPIUsingResources/TaskAPI.xcodeproj/GeneratedModuleMap/CSQLite/module.modulemap:
--------------------------------------------------------------------------------
1 | module CSQLite {
2 | umbrella "/Users/keefmoon/Dropbox/Projects/Swift Programming Cookbook/sourcecode/ServerSideSwift/TaskAPI/.build/checkouts/sqlite.git--8232814251736334455/Sources/CSQLite/include"
3 | export *
4 | }
5 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPIUsingResources/TaskAPI.xcodeproj/HTTP_Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | CFBundleDevelopmentRegion
5 | en
6 | CFBundleExecutable
7 | $(EXECUTABLE_NAME)
8 | CFBundleIdentifier
9 | $(PRODUCT_BUNDLE_IDENTIFIER)
10 | CFBundleInfoDictionaryVersion
11 | 6.0
12 | CFBundleName
13 | $(PRODUCT_NAME)
14 | CFBundlePackageType
15 | FMWK
16 | CFBundleShortVersionString
17 | 1.0
18 | CFBundleSignature
19 | ????
20 | CFBundleVersion
21 | $(CURRENT_PROJECT_VERSION)
22 | NSPrincipalClass
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPIUsingResources/TaskAPI.xcodeproj/JSON_Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | CFBundleDevelopmentRegion
5 | en
6 | CFBundleExecutable
7 | $(EXECUTABLE_NAME)
8 | CFBundleIdentifier
9 | $(PRODUCT_BUNDLE_IDENTIFIER)
10 | CFBundleInfoDictionaryVersion
11 | 6.0
12 | CFBundleName
13 | $(PRODUCT_NAME)
14 | CFBundlePackageType
15 | FMWK
16 | CFBundleShortVersionString
17 | 1.0
18 | CFBundleSignature
19 | ????
20 | CFBundleVersion
21 | $(CURRENT_PROJECT_VERSION)
22 | NSPrincipalClass
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPIUsingResources/TaskAPI.xcodeproj/Node_Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | CFBundleDevelopmentRegion
5 | en
6 | CFBundleExecutable
7 | $(EXECUTABLE_NAME)
8 | CFBundleIdentifier
9 | $(PRODUCT_BUNDLE_IDENTIFIER)
10 | CFBundleInfoDictionaryVersion
11 | 6.0
12 | CFBundleName
13 | $(PRODUCT_NAME)
14 | CFBundlePackageType
15 | FMWK
16 | CFBundleShortVersionString
17 | 1.0
18 | CFBundleSignature
19 | ????
20 | CFBundleVersion
21 | $(CURRENT_PROJECT_VERSION)
22 | NSPrincipalClass
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPIUsingResources/TaskAPI.xcodeproj/SMTP_Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | CFBundleDevelopmentRegion
5 | en
6 | CFBundleExecutable
7 | $(EXECUTABLE_NAME)
8 | CFBundleIdentifier
9 | $(PRODUCT_BUNDLE_IDENTIFIER)
10 | CFBundleInfoDictionaryVersion
11 | 6.0
12 | CFBundleName
13 | $(PRODUCT_NAME)
14 | CFBundlePackageType
15 | FMWK
16 | CFBundleShortVersionString
17 | 1.0
18 | CFBundleSignature
19 | ????
20 | CFBundleVersion
21 | $(CURRENT_PROJECT_VERSION)
22 | NSPrincipalClass
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPIUsingResources/TaskAPI.xcodeproj/TLS_Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | CFBundleDevelopmentRegion
5 | en
6 | CFBundleExecutable
7 | $(EXECUTABLE_NAME)
8 | CFBundleIdentifier
9 | $(PRODUCT_BUNDLE_IDENTIFIER)
10 | CFBundleInfoDictionaryVersion
11 | 6.0
12 | CFBundleName
13 | $(PRODUCT_NAME)
14 | CFBundlePackageType
15 | FMWK
16 | CFBundleShortVersionString
17 | 1.0
18 | CFBundleSignature
19 | ????
20 | CFBundleVersion
21 | $(CURRENT_PROJECT_VERSION)
22 | NSPrincipalClass
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPIUsingResources/TaskAPI.xcodeproj/URI_Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | CFBundleDevelopmentRegion
5 | en
6 | CFBundleExecutable
7 | $(EXECUTABLE_NAME)
8 | CFBundleIdentifier
9 | $(PRODUCT_BUNDLE_IDENTIFIER)
10 | CFBundleInfoDictionaryVersion
11 | 6.0
12 | CFBundleName
13 | $(PRODUCT_NAME)
14 | CFBundlePackageType
15 | FMWK
16 | CFBundleShortVersionString
17 | 1.0
18 | CFBundleSignature
19 | ????
20 | CFBundleVersion
21 | $(CURRENT_PROJECT_VERSION)
22 | NSPrincipalClass
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPIUsingResources/TaskAPI.xcodeproj/Vapor_Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | CFBundleDevelopmentRegion
5 | en
6 | CFBundleExecutable
7 | $(EXECUTABLE_NAME)
8 | CFBundleIdentifier
9 | $(PRODUCT_BUNDLE_IDENTIFIER)
10 | CFBundleInfoDictionaryVersion
11 | 6.0
12 | CFBundleName
13 | $(PRODUCT_NAME)
14 | CFBundlePackageType
15 | FMWK
16 | CFBundleShortVersionString
17 | 1.0
18 | CFBundleSignature
19 | ????
20 | CFBundleVersion
21 | $(CURRENT_PROJECT_VERSION)
22 | NSPrincipalClass
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPIUsingResources/TaskAPI.xcodeproj/libc_Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | CFBundleDevelopmentRegion
5 | en
6 | CFBundleExecutable
7 | $(EXECUTABLE_NAME)
8 | CFBundleIdentifier
9 | $(PRODUCT_BUNDLE_IDENTIFIER)
10 | CFBundleInfoDictionaryVersion
11 | 6.0
12 | CFBundleName
13 | $(PRODUCT_NAME)
14 | CFBundlePackageType
15 | FMWK
16 | CFBundleShortVersionString
17 | 1.0
18 | CFBundleSignature
19 | ????
20 | CFBundleVersion
21 | $(CURRENT_PROJECT_VERSION)
22 | NSPrincipalClass
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPIUsingResources/TaskAPI.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPIUsingResources/TaskAPI.xcodeproj/xcshareddata/xcschemes/xcschememanagement.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | SchemeUserState
5 |
6 | TaskAPI.xcscheme
7 |
8 |
9 | SuppressBuildableAutocreation
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPIUsingResources/Tests/AppTests/Utilities.swift:
--------------------------------------------------------------------------------
1 | import Foundation
2 | @testable import App
3 | @testable import Vapor
4 | import XCTest
5 | import Testing
6 | import FluentProvider
7 |
8 | extension Droplet {
9 | static func testable() throws -> Droplet {
10 | let config = try Config(arguments: ["vapor", "--env=test"])
11 | try config.setup()
12 | let drop = try Droplet(config)
13 | try drop.setup()
14 | return drop
15 | }
16 | func serveInBackground() throws {
17 | background {
18 | try! self.run()
19 | }
20 | console.wait(seconds: 0.5)
21 | }
22 | }
23 |
24 | class TestCase: XCTestCase {
25 | override func setUp() {
26 | Node.fuzzy = [Row.self, JSON.self, Node.self]
27 | Testing.onFail = XCTFail
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPIUsingResources/Tests/LinuxMain.swift:
--------------------------------------------------------------------------------
1 | #if os(Linux)
2 |
3 | import XCTest
4 | @testable import AppTests
5 |
6 | XCTMain([
7 | // AppTests
8 | testCase(PostControllerTests.allTests),
9 | testCase(RouteTests.allTests)
10 | ])
11 |
12 | #endif
13 |
--------------------------------------------------------------------------------
/Chapter07/ServerSideSwift-master/TaskAPIUsingResources/circle.yml:
--------------------------------------------------------------------------------
1 | dependencies:
2 | override:
3 | - eval "$(curl -sL https://apt.vapor.sh)"
4 | - sudo apt-get install vapor
5 | - sudo chmod -R a+rx /usr/
6 | test:
7 | override:
8 | - swift build
9 | - swift build -c release
10 | - swift test
11 |
--------------------------------------------------------------------------------
/Chapter08/PhotobookCreator-master/PhotobookCreator.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Chapter08/PhotobookCreator-master/PhotobookCreator/AppDelegate.swift:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.swift
3 | // PhotobookCreator
4 | //
5 | // Created by Keith Moon on 5/4/17.
6 | // Copyright © 2017 Keith Moon. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | @UIApplicationMain
12 | class AppDelegate: UIResponder, UIApplicationDelegate {
13 |
14 | var window: UIWindow?
15 |
16 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
17 | // Override point for customization after application launch.
18 | return true
19 | }
20 | }
21 |
22 |
--------------------------------------------------------------------------------
/Chapter08/PhotobookCreator-master/PhotobookCreator/Assets.xcassets/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | }
6 | }
--------------------------------------------------------------------------------
/Chapter08/PhotobookCreator-master/PhotobookCreator/Resources/SamplePhotos/2971575403_a95793f8d6_o.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PacktPublishing/Swift-4-Programming-Cookbook/145d868a918517d0eaed55a1fd7a18ce25667e3d/Chapter08/PhotobookCreator-master/PhotobookCreator/Resources/SamplePhotos/2971575403_a95793f8d6_o.jpg
--------------------------------------------------------------------------------
/Chapter08/PhotobookCreator-master/PhotobookCreator/Resources/SamplePhotos/318497346_bf7a36cbcd_o.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PacktPublishing/Swift-4-Programming-Cookbook/145d868a918517d0eaed55a1fd7a18ce25667e3d/Chapter08/PhotobookCreator-master/PhotobookCreator/Resources/SamplePhotos/318497346_bf7a36cbcd_o.jpg
--------------------------------------------------------------------------------
/Chapter08/PhotobookCreator-master/PhotobookCreator/Resources/SamplePhotos/33489304834_202dcc7b05_o.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PacktPublishing/Swift-4-Programming-Cookbook/145d868a918517d0eaed55a1fd7a18ce25667e3d/Chapter08/PhotobookCreator-master/PhotobookCreator/Resources/SamplePhotos/33489304834_202dcc7b05_o.jpg
--------------------------------------------------------------------------------
/Chapter08/PhotobookCreator-master/PhotobookCreator/Resources/SamplePhotos/7290640736_80e28c782e_o.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PacktPublishing/Swift-4-Programming-Cookbook/145d868a918517d0eaed55a1fd7a18ce25667e3d/Chapter08/PhotobookCreator-master/PhotobookCreator/Resources/SamplePhotos/7290640736_80e28c782e_o.jpg
--------------------------------------------------------------------------------