Beginning Swift Programming

個数:
電子版価格
¥4,175
  • 電子版あり

Beginning Swift Programming

  • 在庫がございません。海外の書籍取次会社を通じて出版社等からお取り寄せいたします。
    通常6~9週間ほどで発送の見込みですが、商品によってはさらに時間がかかることもございます。
    重要ご説明事項
    1. 納期遅延や、ご入手不能となる場合がございます。
    2. 複数冊ご注文の場合、分割発送となる場合がございます。
    3. 美品のご指定は承りかねます。

    ●3Dセキュア導入とクレジットカードによるお支払いについて
  • 【入荷遅延について】
    世界情勢の影響により、海外からお取り寄せとなる洋書・洋古書の入荷が、表示している標準的な納期よりも遅延する場合がございます。
    おそれいりますが、あらかじめご了承くださいますようお願い申し上げます。
  • ◆画像の表紙や帯等は実物とは異なる場合があります。
  • ◆ウェブストアでの洋書販売価格は、弊社店舗等での販売価格とは異なります。
    また、洋書販売価格は、ご注文確定時点での日本円価格となります。
    ご注文確定後に、同じ洋書の販売価格が変動しても、それは反映されません。
  • 製本 Paperback:紙装版/ペーパーバック版/ページ数 257 p.
  • 言語 ENG
  • 商品コード 9781119009313
  • DDC分類 005.133

Full Description


Enter the Swift future of iOS and OS X programming Beginning Swift Programming is your ideal starting point for creating Mac, iPhone, and iPad apps using Apple's new Swift programming language. Written by an experienced Apple developer and trainer, this comprehensive guide explains everything you need to know to jumpstart the creation of your app idea. Coverage includes data types, strings and characters, operators and functions, arrays and dictionaries, control flow, and looping, with expert guidance on classes, objects, class inheritance, closures, protocols, and generics. This succinct yet complete overview provides a detailed introduction to the core features of Swift.Apple developed Swift to address the limitations of Objective-C, and add features found in more complex languages like Python. The results is simpler, cleaner, more expressive code with automatic memory management, functional programming patterns, and more, including built-in features that make Swift apps faster, scalable, and more secure. This book explains it all, helping developers master Apple's new language.Become fluent with syntax that's easier to read and maintainUnderstand inferred types for cleaner, less mistake-prone codeLearn the key features that make Swift more expressive than Objective-CLearn the new optional types in Swift that make your code more resilientUnderstand the key design patterns in iOS and Mac OS programming using protocols and delegatesLearn how to use generics to create highly reusable codeLearn the new access controls mechanism in SwiftGet up to speed quickly to remain relevant and ahead of the curve.

Contents

INTRODUCTION xxiiiWhat Is Swift? 2Why Swift Is Important 3Setting Up the Environment 3Creating a Playground Project 4Creating an iOS Project 6Swift Syntax 10Constants 10Variables 12String Interpolation: Including Values in Strings 14Statements 14Printing 15Comments 15Summary 17CHAPTER 2: DATA TYPES 19Basic Data Types 20Integers 20Types of Integers 21Integer Operations 22Integer Literals 22Floating?]Point Numbers 23Floating?]Point Operations 23Floating?]Point Literals 24Type Alias 25Boolean 25Tuples 26Optional Types 27Implicitly Unwrapped Optionals 28Optional Binding 29Unwrapping Optionals Using ? 30Enumerations 30Using Enumeration in Switch Statements 31Enumeration Raw Values 32Auto?]Increment for Raw Values 33Associated Values 34Enumeration Functions 35Summary 36CHAPTER 3: STRINGS AND CHARACTERS 39Strings 40Mutability of Strings 40Strings as Value Types 40Characters 41Concatenating Strings 43Special Characters 44Unicode 45Common String Functions 46Equality 46Prefi x and Suffi x 47Length 47Substrings 48Converting Strings to Arrays 51Type Conversion 51Interoperability with NSString 52Casting String to NSString 53Using NSString Directly 54String or NSString? 55Summary 56CHAPTER 4: BASIC OPERATORS 59Assignment Operator 60Arithmetic Operators 61Addition Operator 61Subtraction Operator 62Multiplication Operator 62Division Operator 63Modulus Operator 63Increment and Decrement Operator 63Compound Assignment Operators 65Nil Coalescing Operator 65Comparison Operators 66Equal To and Not Equal To 66Greater Than or Equal To 67Less Than or Equal To 67Range Operators 68Logical Operators 69NOT 69AND 70OR 71Combining Logical Operators 71Ternary Conditional Operator 72Summary 73CHAPTER 5: FUNCTIONS 75Defi ning and Calling a Function 76Input Parameters 76Returning a Value 76Returning Multiple Values 77Function Parameter Names 77External Parameter Names Shorthand 79Default Parameter Values 79Variadic (Variable) Parameters 80Constant and Variable Parameters 81In?]Out Parameters 82Function Types 83Defining a Function Type Variable 83Calling a Function Type Variable 84Returning Function Type in a Function 85Nested Functions 85Summary 86CHAPTER 6: COLLECTIONS 89Arrays 90Mutability of Arrays 90Array Data Types 90Retrieving Elements from an Array 91Inserting Elements into an Array 91Modifying Elements in an Array 92Appending Elements to an Array 92Checking the Size of an Array 93Removing Elements from an Array 93Iterating over an Array 93Creating an Empty Array 94Testing Arrays for Equality 95Dictionaries 96Mutability of Dictionaries 97Retrieving Elements from a Dictionary 97Checking the Size of a Dictionary 98Modifying an Item in the Dictionary 98Removing an Item from the Dictionary 99Iterating over a Dictionary 99Creating an Empty Dictionary 101Testing Dictionaries for Equality 101Copying the Behavior of Arrays and Dictionaries 102Summary 103CHAPTER 7: CONTROL FLOW AND LOOPING 107Flow Control 108If Statement 108If?]Else Statement 109Switch Statement 110Matching Numbers 111Matching Characters 112Fallthrough 112Matching a Range of Numbers 113Matching Tuples 114Value Bindings 115Where Clause 117Looping 118For?]In Loop 118Traditional For Loop 121While Loop 122Do?]While Loop 123Control Transfer Statements 124Break Statement 124Continue Statement 126Labeled Statement 126Summary 128CHAPTER 8: STRUCTURES AND CLASSES 131Structures 132Memberwise Initializers 132Structures as Value Types 133Comparing Structures 135Classes 135Defining a Class 136Properties 136Stored Properties 136Lazy Stored Properties 137Computed Properties 138Motivation Behind Computed Properties 139The newValue keyword 140Read?]Only Computed Properties 141Property Observers 141Typed Properties 143Initializers 144Initializers and External Parameter Names 145Initializing Variables and Constants During Initialization 147Classes as Reference Types 147Comparing Instances Identity Operators 149Comparing Instances Equivalence Operators 150Methods in Classes 151Instance Methods 151Local and External Parameter Names for Methods 152The self Property 154Type Methods 155Methods in Structures 155Summary 157CHAPTER 9: INHERITANCE 161Understanding Inheritance 162Defi ning a Base Class 162Instantiating a Base Class 162Creating an Abstract Class 163Inheriting from a Base Class 164Overriding Initializers 164Overloading Initializers 165Creating Abstract Methods 167Overloading Methods 169Preventing Subclassing 170Types of Initializers 171Default Initializer 171Designated Initializers 172Convenience Initializers and Initializer Chaining 174Calling Initializers in Subclasses 176Extensions 177Extending Methods 177Extending Properties 177Access Controls 178Internal 179Private 180Public 181Summary 181CHAPTER 10: CLOSURES 185Understanding Closures 186Functions as Closures 186Assigning Closures to Variables 187Writing Closures Inline 188Type Inference 188Shorthand Argument Names 189Operator Function 190Trailing Closures 190Using the Array s Three Closure Functions 190The map Function 191Example 1 191Example 2 192The filter Function 192Example 1 192Example 2 193The reduce Function 194Example 1 194Example 2 195Using Closures in Your Functions 196Summary 198CHAPTER 11: PROTOCOLS AND DELEGATES 201Understanding Protocols 202Defining and Using a Protocol 202Conforming to a Protocol 202Optional Methods 204Conforming to Multiple Protocols 206Property Requirements 206Initializer Requirements 207Understanding Delegates 207Delegates as Event Handlers 208A Practical Example of Protocols and Delegates 211Summary 213CHAPTER 12: GENERICS 217Understanding Generics 218Using Generic Functions 218Multiple Type Parameters 219Specifying Type Constraint 220Generic Types 221Generic Classes 221Generic Structures 223Generic Type Extension 224Using Generics in Protocols 225Specifying Requirements for Associated Types 228Summary 229APPENDIX: EXERCISE ANSWERS 233INDEX 247

最近チェックした商品