万本电子书0元读

万本电子书0元读

顶部广告

Swift 2 By Example电子书

售       价:¥

0人正在读 | 0人评论 9.8

作       者:Giordano Scalzo

出  版  社:Packt Publishing

出版时间:2016-03-14

字       数:186.8万

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

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

为你推荐

  • 读书简介
  • 目录
  • 累计评论(0条)
  • 读书简介
  • 目录
  • 累计评论(0条)
Create robust and extensible iOS apps using the advanced features of Swift 2 About This Book Get up to speed with the new features of Swift 2 by following the exhaustive examples in this book Specialize in developing real iOS apps, and 2D and 3D videogames using Swift and Cocoapods Learn how to build server API apps to feed your iOS client apps Who This Book Is For This book is ideal for those who want to learn to develop app in Swift, starting the right way. Whether you are an expert Objective-C programmer or are new to this platform, you’ll quickly grasp the code of real world apps, and discover how to use Swift effectively. Prior experience in development for Apple devices would be helpful, but is not mandatory. What You Will Learn Create a server in Swift to deliver JSON data to an iOS app Take advantage of Cocoapods to use third-party libraries Use a clean and effective architecture to decrease complexity and speed up development Take advantage of the most useful parts of the iOS SDK Build games with SpriteKit and SceneKit Develop an app running on the cloud to act as an API server for your client’s apps In Detail Swift is no longer the unripe language it was when launched by Apple at WWDC14, now it’s a powerful and ready-for-production programming language that has empowered most new released apps. Swift is a user-friendly language with a smooth learning curve; it is safe, robust, and really flexible. Swift 2 is more powerful than ever; it introduces new ways to solve old problems, more robust error handling, and a new programming paradigm that favours composition over inheritance. Swift 2 by Example is a fast-paced, practical guide to help you learn how to develop iOS apps using Swift. Through the development of seven different iOS apps and one server app, you’ll find out how to use either the right feature of the language or the right tool to solve a given problem. We begin by introducing you to the latest features of Swift 2, further kick-starting your app development journey by building a guessing game app, followed by a memory game. It doesn’t end there, with a few more apps in store for you: a to-do list, a beautiful weather app, two games: Flappy Swift and Cube Runner, and finally an ecommerce app to top everything off. By the end of the book, you’ll be able to build well-designed apps, effectively use AutoLayout, develop videogames, and build server apps. Style and approach These easy-to-follow tutorials show you how to build real-world apps. The difficulty and complexity level increases chapter by chapter. Each chapter is dedicated to build a new app, beginning from a basic and unstyled app through to a full 3D game. The last two chapters show you how to build a complete client-server ecommerce app right from scratch.
目录展开

Swift 2 By Example

Table of Contents

Swift 2 By Example

Credits

About the Author

About the Reviewer

www.PacktPub.com

eBooks, discount offers, and more

Why subscribe?

Preface

What this book covers

What you need for this book

Who this book is for

Conventions

Reader feedback

Customer support

Downloading the example code

Downloading the color images of this book

Errata

Piracy

Questions

1. Welcome to the World of Swift

The first look at Swift

Let's go to the playground

The building blocks – variables and constants

Collecting variables in containers

Controlling the flow

Transforming the values using functions

Structs – custom compound types

Classes – common behavior objects

Loose coupling with protocols

Composing objects using protocol extensions

Checking the existence of an optional value

Enumerations on steroids

Extended pattern matching

Catching errors

Swift functional programming patterns

Summary

2. Building a Guess the Number App

The app is…

Building a skeleton app

Adding the graphics components

Connecting the dots

Adding the code

Summary

3. A Memory Game in Swift

The app is…

Building the skeleton of the app

The menu screen

Implementing the basic menu screen

Creating a nice menu screen

The game screen

The structure

Adding a collection view

Sizing the components

Connecting the dataSource and the delegate

Implementing a deck of cards

What we are expecting

The card entity

Crafting the deck

Shuffling the deck

Finishing the deck

Put the cards on the table

Adding the assets

The CardCell structure

Handling touches

Finishing the game

Implementing the game logic

We got a pair

We made the wrong move

Et voilà! The game is completed

Summary

4. A TodoList App in Swift

The app is…

Building a skeleton app

Implementing an empty app

Adding third-party libraries with CocoaPods

Implementing the Todos view controller

Building the Todos screen

Adding entities

Implementing datastore

Connecting datastore and View Controller

Configuring tableView

Finishing touches

Swipe that cell!

Adding a Todo task

The add a Todo view

The add a Todo View Controller

Finishing TodoDatastore

List View Controller

Where do we go from here?

Summary

5. A Pretty Weather App

The app is…

Building the skeleton

Creating the project

Adding assets

Implementing the UI

The UI in blocks

Completing the UI

Implementing CurrentWeatherView

Building WeatherHourlyForecastView

Seeing the next day's forecast in WeatherDaysForecastView

Blurring the background

Downloading the background image

Searching in Flickr

Geolocalising the app

Using Core Location

Retrieving the actual forecast

Getting the forecast from OpenWeatherMap

Rendering CurrentWeatherView

Rendering WeatherHourlyForecastView

Rendering WeatherDaysForecastView

Connecting to the server

Where do we go from here?

Summary

6. Flappy Swift

The app is…

Building the skeleton of the app

Creating the project

Implementing the menu

A stage for a bird

SpriteKit in a nutshell

Explaining the code

Simulating a three-dimensional world using parallax

How to implement scrolling

A flying bird

Adding the Bird node

Making the bird flap

Pipes!

Implementing the pipes node

Making the components interact

Setting up the collision-detection engine

Completing the game

Colliding with pipes

Adding the score

Adding a restart pop-up

Summary

7. Polishing Flappy Swift

Adding juiciness

Let there be sounds!

Playing the soundtrack

Shaking the screen!

Integrating with Game Center

What Game Center provides

Setting up Game Center

Creating an app record on iTunes Connect

Enabling Game Center

Creating fake user accounts to test Game Center

Authenticating a player

Summary

8. Cube Runner

The app is…

Introduction to SceneKit

What is SceneKit?

Building an empty scene

Adding a green torus

Let there be light!

Let's make it move!

Implementing Cube Runner

The game skeleton

Implementing the menu

Flying in a 3D world

Setting up a scene

Adding a fighter

Texturing the world

Make it move

Adding cubes

Adding more obstacles

Adding a few touches

The score

Let's add music

Summary

9. Completing Cube Runner

Creating a real game

Detecting collisions

Game over!

Adding the juice

Game Center

Summary

10. ASAP – an E-commerce App in Swift

The app is…

The first requirement: login and registration

The second requirement: the products grid

The third requirement: the open cart

The skeleton app and register screen

The skeleton app

The ASAP e-commerce store

The e-commerce product list

The product cell

Parsing and storing products

The ASAP cart

Adding a product to the cart

Removing items from cart and checkout

Summary

11. ASAPServer, a Server in Swift

The interface of the ASAP Server

One skeleton server for two OSes

An OS X skeleton server

Preparing the OS X environment

The HelloWorld skeleton server

Preparing the Linux environment

The ASAPServer

The Products

The cart

The order

Connecting the ASAP app

The products

The Cart

The order

Summary

Index

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

发表评论

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

买过这本书的人还买过

读了这本书的人还在读

回顶部