万本电子书0元读

万本电子书0元读

顶部广告

Hands-On Full-Stack Development with Swift电子书

售       价:¥

2人正在读 | 0人评论 9.8

作       者:Ankur Patel

出  版  社:Packt Publishing

出版时间:2018-03-30

字       数:33.3万

所属分类: 进口书 > 外文原版书 > 电脑/网络

温馨提示:数字商品不支持退换货,不提供源文件,不支持导出打印

为你推荐

  • 读书简介
  • 目录
  • 累计评论(0条)
  • 读书简介
  • 目录
  • 累计评论(0条)
Build full-stack shopping list applications from scratch for web and mobile platforms using Xcode, Vapor, and Swift About This Book ? Build, package, and deploy an end-to-end app solution for mobile and web with Swift 4 ? Increase developer productivity by creating reusable client and server components ? Develop backend services for your apps and websites using Vapor framework Who This Book Is For This book is for developers who are looking to build full-stack web and native mobile applications using Swift. An understanding of HTML, CSS, and JavaScript would be beneficial when building server-rendered pages with Vapor. What You Will Learn ? Get accustomed to server-side programming as well as the Vapor framework ? Learn how to build a RESTful API ? Make network requests from your app and handle error states when a network request fails ? Deploy your app to Heroku using the CLI command ? Write a test for the Vapor backend ? Create a tvOS version of your shopping list app and explore code-sharing with an iOS platform ? Add registration and authentication so that users can have their own shopping lists In Detail Making Swift an open-source language enabled it to share code between a native app and a server. Building a scalable and secure server backend opens up new possibilities, such as building an entire application written in one language—Swift. This book gives you a detailed walk-through of tasks such as developing a native shopping list app with Swift and creating a full-stack backend using Vapor (which serves as an API server for the mobile app). You'll also discover how to build a web server to support dynamic web pages in browsers, thereby creating a rich application experience. You’ll begin by planning and then building a native iOS app using Swift. Then, you'll get to grips with building web pages and creating web views of your native app using Vapor. To put things into perspective, you'll learn how to build an entire full-stack web application and an API server for your native mobile app, followed by learning how to deploy the app to the cloud, and add registration and authentication to it. Once you get acquainted with creating applications, you'll build a tvOS version of the shopping list app and explore how easy is it to create an app for a different platform with maximum code shareability. Towards the end, you’ll also learn how to create an entire app for different platforms in Swift, thus enhancing your productivity. Style and approach A step-by-step tutorial-based approach that teaches you full-stack Swift through the development of a single application on several platforms.
目录展开

Title Page

Copyright and Credits

Hands-On Full-Stack Development with Swift

Dedication

Packt Upsell

Why subscribe?

PacktPub.com

Contributors

About the author

About the reviewers

Packt is searching for authors like you

Preface

Who this book is for

What this book covers

To get the most out of this book

Download the example code files

Conventions used

Get in touch

Reviews

Getting Started with Server Swift

Modern app development

Swift's evolution

Open source

Server-side Swift

Benefits of server-side Swift

Getting started with Swift package manager

Building a Swift package

Publishing a Swift package

Consuming a Swift package

Installing the package's executable

How do the web servers work?

User requesting a web page

Mobile application requesting data

HTTP request and response

Building a web server in Swift

Server-side web frameworks

Vapor

Book roadmap

Summary

Creating the Native App

Features of our Shopping List app

Creating an app

Blueprinting the Shopping List Item model

Exercise

Exercise answer

Controlling the flow of our application using View Controller

Wiring up the view

Table View Controller

Adding items to the list

Editing the list

Loading and auto-saving the Shopping List

Multiple lists

Refactoring to share code

Blueprinting the Shopping List Model

The Shopping List Table View Controller

Summary

Getting Started with Vapor

What is Vapor?

Building servers using Vapor's engine

Building a basic HTTP server

Building a static file server

Building a WebSocket server

Building a Vapor application from scratch

Vapor toolbox

Installing the Vapor toolbox

Vapor toolbox commands

Creating a Vapor application using the toolbox

Vapor folder structure

Vapor config

Vapor droplet

Views

Controllers

Summary

Configuring Providers, Fluent, and Databases

Shopping List API Vapor app

What are Providers?

Building your first Provider

Exercise time

Adding a Provider

Getting started with databases

What is MongoDB?

How to install and run MongoDB

What are ORM and Fluent?

Fluent in action

Creating an item

Updating an item

Getting all items

Finding an item

Finding items using filter

Deleting an item

Counting items

Relations in Fluent

One to one (parent-child relation)

One to many

Many to many

Connecting with MongoDB

Configuring Fluent config

Mongo config - mongo.json

Adding MongoProvider

Summary

Building a REST API using Vapor

Routing in Vapor

HTTP methods

Routers

Nested routing

Dynamic routing

Wildcard routing

Routing parameters

Vapor Models

The Shopping List Model

Preparation protocol

JSONConvertible protocol

ResponseRepresentable protocol

Updateable protocol

Item Model

Controllers in Vapor

RESTful Controller

Shopping List controller

REST API in action

Creating the Shopping List

Getting the Shopping List

Updating the Shopping List

Deleting the Shopping List

Creating items

Exercise

Summary

Consuming API in App

Xcode Workspace

Making network requests

Network configuration

Request helper

Fetching data from the server

Debugging the app and server side by side

Adding a Shopping List

Deleting a Shopping List

Exercise

Adding a Shopping List Item

Deleting an item

Checking and unchecking an item

Summary

Creating Web Views and Middleware

View rendering in Vapor app

What is Leaf?

Adding Leaf Provider

Serving JSON and HTML formats

Creating a middleware

Creating a BaseResourceController

Adding JavaScript

Creating a new Shopping List

Deleting a Shopping List

Adding an Item

Deleting an Item

Checking and unchecking an Item

Summary

Testing and CI

Testing the Vapor application

Setting up the test environment

Running tests

Testing RESTful routes

Fetching all Shopping Lists

Creating a Shopping List

Deleting the Shopping List

Updating the Shopping List

Exercise

Automated testing pipeline

Enabling Travis build check on Pull request

Summary

Deploying the App

Where can we deploy a Vapor App?

Deploying to Heroku

Priming the app for deployment

Configuring and deploying Vapor to Heroku

Adding the MongoDB Heroku addon

Setting up Continuous Deployment

Exercise

Summary

Adding Authentication

Creating a User model

Best practices for storing password

Getting started with the User model

User has many Shopping Lists

Adding Registration and Login

Showing user specific Shopping Lists

Adding token-based authentication for app

Testing the token-based authentication

Adding authentication flow to iOS app

Bringing it all together in the Storyboard

Summary

Building a tvOS App

Shopping List app on tvOS

Sharing code between iOS and tvOS

Making code work with both iOS and tvOS apps

Configuring the tvOS storyboard

Summary

Other Books You May Enjoy

Leave a review - let other readers know what you think

累计评论(0条) 0个书友正在讨论这本书 发表评论

发表评论

发表评论,分享你的想法吧!

买过这本书的人还买过

读了这本书的人还在读

回顶部