Swift Language

Total Page:16

File Type:pdf, Size:1020Kb

Swift Language Swift Language #swift 1 1: Swift 2 2 2 2 Examples 2 Swift 2 Swift 4 MacSwift 4 iPadSwift Playgrounds 9 10 2: 11 11 11 Examples 11 UnsafeMutablePointer 11 12 3: AES 14 Examples 14 IVSwift 3.0CBCAES 14 CBCAESIVSwift 2.3 16 PKCS7ECBAES 18 4: KituraSwift HTTP 20 20 Examples 20 20 5: OptionSet 23 Examples 23 OptionSet 23 6: PBKDF2 24 Examples 24 2Swift 3 24 2Swift 2.3 25 Swift 2.3 26 Swift 3 26 7: RxSwift 28 Examples 28 RxSwift 28 28 29 30 RxCocoaControlEvents 30 8: Swift Advance 32 32 Examples 32 32 33 9: SwiftNSRegularExpression 34 34 Examples 34 String 34 35 35 36 36 NSRegularExpression 36 10: Swift 38 Examples 38 38 38 38 39 40 11: Swift 42 Examples 42 Swift 42 12: Swift 44 44 Examples 44 44 44 47 47 - On log n 47 48 48 56 58 13: Typealias 62 Examples 62 62 62 62 14: StringUIImage 63 63 Examples 63 InitialsImageFactory 63 15: Swift 64 64 Examples 64 64 64 65 16: CObjective-C 66 66 Examples 66 Objective-CSwift 66 66 67 SwiftObjective-C 67 67 68 swiftc 68 C 69 Objective-CSwift 69 C 70 17: 72 Examples 72 72 Dependenct 72 DI 72 73 75 DI 75 76 77 77 18: 78 78 78 Examples 78 78 78 79 typealias 79 79 2 80 4 80 Switch 80 19: 82 82 82 Examples 82 82 83 83 83 @noescape 84 3 84 throwsrethrows 84 / 85 86 86 87 20: 88 88 88 weak-keyword 88 unowned-keyword 88 88 Examples 88 88 89 89 21: 91 Examples 91 91 91 92 94 init 94 initotherStringString 94 94 init 95 95 22: 96 Examples 96 96 96 97 97 98 98 98 Inout 98 98 99 99 100 100 100 101 101 23: 103 103 103 Examples 103 103 103 104 106 107 RawRepresentable 108 108 109 109 Hashable 109 24: 111 111 111 Examples 111 111 112 25: 115 115 Examples 115 115 115 115 116 116 117 117 26: 119 119 Examples 119 119 119 27: 120 120 Examples 120 120 120 120 Key 121 121 121 28: 123 123 123 Examples 123 123 123 124 124 125 125 125 126 126 126 126 127 127 String 127 129 Set 129 129 129 129 129 130 Swift 130 130 WhiteSpaceNewLine 132 Data / NSData 132 133 29: 134 134 Examples 134 134 134 30: 136 Examples 136 MD2MD4MD5SHA1SHA224SHA256SHA384SHA512Swift 3 136 HMACMD5SHA1SHA224SHA256SHA384SHA512Swift 3 137 31: 140 Examples 140 Bool 140 Bool 140 140 141 32: 142 142 Examples 142 Grand Central DispatchGCD 142 Grand Central DispatchGCD 143 144 OperationQueue 145 146 33: 149 Examples 149 149 149 34: 150 150 150 Examples 150 150 150 150 where 151 151 151 152 153 153 153 - prepareForSegue 154 35: 156 156 Examples 156 For-in 156 156 156 157 157 158 158 158 159 For-in 159 160 36: 161 Examples 161 161 161 37: 162 162 Examples 162 162 162 162 163 163 163 164 38: 166 Examples 166 166 166 166 166 167 167 167 167 168 168 168 168 168 169 169 39: 170 170 170 170 Examples 170 170 170 170 170 171 171 171 171 172 172 172 172 173 173 map_ :) 174 flatMap_ :)Array 174 174 flatMap_ :)nil 175 175 176 flatMap_ :) 176 176 177 177 flatten 178 Arrayreduce_combine :) 178 178 Swift3 178 179 179 180 2 180 40: 181 Examples 181 181 181 41: 186 186 186 Examples 186 UIViewControllerSwizzling viewDidLoad 186 Swift Swizzling 187 Swizzling - Objective-C 188 42: 189 189 189 Examples 189 Guard 189 if 189 AND 190 OR 190 NOT 190 “where” 190 192 Nil-Coalescing 192 43: 194 194 Examples 194 194 195 195 196 197 198 199 44: 200 200 Examples 200 200 200 200 201 201 201 202 203 203 204 204 45: Swift 206 206 Examples 206 206 206 207 printvs dump 208 vs NSLog 208 46: 210 Examples 210 210 47: 213 213 Examples 213 213 213 214 214 DEINIT 215 48: 216 216 Examples 216 216 216 217 217 Swift 217 217 218 IntFloat - 218 218 218 218 String 218 StringInt 219 JSON 219 Optional JSON 219 JSON 219 219 Empty Dictionary 220 49: 221 Examples 221 221 221 221 221 222 222 struct 222 50: 223 223 Examples 223 223 223 51: - 224 224 Examples 224 224 224 225 226 227 228 228 231 52: - 235 235 Examples 235 235 235 53: 237 237 237 Examples 237 Struct 237 Car.make 238 Car.model 238 Car.otherNamefileprivate 238 Car.fullName 238 238 GettersSetters 238 54: 240 240 240 240 Examples 240 240 241 241 242 - 243 55: 244 244 Examples 244 244 245 246 247 247 56: JSON 249 249 Examples 249 Apple FoundationSwiftJSON 249 JSON 249 JSON 249 250 JSON 250 JSON 251 251 251 SwiftyJSON 251 253 JSON 253 254 254 254 255 255 JSON 256 JSONSwift 3 257 57: 260 Examples 260 260 260 260 260 Set 261 CountedSet 261 58: 263 263 Examples 263 263 264 59: 268 268 Examples 268 268 268 268 268 269 269 269 269 269 269 269 270 270 270 270 270 ...... 271 271 271 60: 272 Examples 272 272 + 272 273 274 275 Swift 275 277 You can share this PDF with anyone you feel could benefit from it, downloaded the latest version from: swift-language It is an unofficial and free Swift Language ebook created for educational purposes. All the content is extracted from Stack Overflow Documentation, which is written by many hardworking individuals at Stack Overflow. It is neither affiliated with Stack Overflow nor official Swift Language. The content is released under Creative Commons BY-SA, and the list of contributors to each chapter are provided in the credits section at the end of this book. Images may be copyright of their respective owners unless otherwise specified. All trademarks and registered trademarks are the property of their respective company owners. Use the content presented in this book at your own risk; it is not guaranteed to be correct nor accurate, please send your feedback and corrections to [email protected] https://riptutorial.com/zh-CN/home 1 1: Swift SwiftApple 。 SwiftApplemacOSiOStvOSwatchOSObjective-CCocoa / CocoaAPI。 SwiftmacOS Linux。AndroidWindows。 SwiftGitHub ;。 bugs.swift.org。 SwiftSwift 。 • Swift • Swift • Swift • API • Swift iBooks • ...developer.apple.com 。 Swift Xcode - 2010-07-17 1.0 Xcode 6 201462 1.1 Xcode 6.1 20141016 1.2 Xcode 6.3 201529 2.0 Xcode 7 2015-06-08 2.1 Xcode 7.1 2015923 - 2015123 2.2 Xcode 7.3 2016321 2.3 Xcode 8 2016913 3.0 Xcode 8 2016913 3.1 Xcode 8.3 2017327 Examples https://riptutorial.com/zh-CN/home 2 Swift hello.swift print("Hello, world!") • swift LinuxCTRL + ALT + T macOS Launchpad。cd directory_name cd .. $ swift hello.swift Hello, world! 。 • swiftc $ swiftc hello.swift hello。./ 。 $ ./hello Hello, world! • swift REPLRead-Eval-Print-Loopswift func greet(name: String, surname: String) { print("Greetings \(name) \(surname)") } let myName = "Homer" let mySurname = "Simpson" greet(name: myName, surname: mySurname) • func greet(name: String, surname: String) { // function body } - namesurname 。 • print("Greetings \(name) \(surname)") - “Greetings”name surname 。\( variable_name )。 • let myName = "Homer"let mySurname = "Simpson" - let myName mySurnamevalues "Homer" "Simpson" 。 • greet(name: myName, surname: mySurname) - myName mySurname。 REPL $ swift Welcome to Apple Swift. Type :help for assistance. 1> func greet(name: String, surname: String) { https://riptutorial.com/zh-CN/home 3 2. print("Greetings \(name) \(surname)") 3. } 4> 5> let myName = "Homer" myName: String = "Homer" 6> let mySurname = "Simpson" mySurname: String = "Simpson" 7> greet(name: myName, surname: mySurname) Greetings Homer Simpson 8> ^D CTRL + DREPL。 Swift 。 Swift。macOS/ Library / Developer / Toolchains。 export PATH=/Library/Developer/Toolchains/swift-latest.xctoolchain/usr/bin:"${PATH}" Linuxclang $ sudo apt-get install clang SwiftSwift $ export PATH=/path/to/Swift/usr/bin:"${PATH}" Swift $ swift --version MacSwift MacMac App StoreXcode。 XcodePlayground https://riptutorial.com/zh-CN/home 4 PlaygroundMyPlayground “ ” https://riptutorial.com/zh-CN/home 5 PlaygroundCreate https://riptutorial.com/zh-CN/home 6 Playground https://riptutorial.com/zh-CN/home 7 Playground + cmd + Y 。 Playground print("Hello world") “Hello world”“Hello world \ n” https://riptutorial.com/zh-CN/home 8 Swift iPadSwift Playgrounds Swift PlaygroundsSwift。 1-App StoreiPadSwift Playgrounds 。 https://riptutorial.com/zh-CN/home 9 https://riptutorial.com/zh-CN/home2-。 10 3-“ ”+ 。 4-。 5-。 6-。。 7-“”。 。 Optionals“x”“”。 OptionalSwift。 NoneSome(T) TSwift。 let x: String? = "Hello World" print(x.dynamicType) Optional<String> OptionalOptional。 OptionalXcodeOptional enum Optional<Wrapped> { Wrapped。 .none.someWrapped。 String?StringOptional<String> 。OptionalmapflatMap 。 Swift https://riptutorial.com/zh-CN/swift/topic/202/swift 2: “。。“ Apple Inc.“SwiftCocoaObjective-CSwift 3.1。”iBooks。 https://itun.es/us/utTW7.l 。 BufferPointers。 • MemoryLayout 。 • Unmanaged 。 • UnsafeBufferPointer 。 • UnsafeBufferPointerIterator UnsafeBufferPointerUnsafeMutableBufferPointer 。 • UnsafeMutableBufferPointer 。 • UnsafeMutablePointer 。 • UnsafeMutableRawBufferPointer nonowning。 • UnsafeMutableRawBufferPointer.Iterator 。 • UnsafeMutableRawPointer 。 • UnsafePointer 。 • UnsafeRawBufferPointer 。 • UnsafeRawBufferPointer.Iterator 。 • UnsafeRawPointer 。 Swiftdoc.org Examples UnsafeMutablePointer struct UnsafeMutablePointer<Pointee> 。 UnsafeMutablePointer。Pointee。 UnsafeMutablePointer。。 。UnsafeMutablePointer。 import Foundation let arr = [1,5,7,8] let pointer = UnsafeMutablePointer<[Int]>.allocate(capacity: 4) pointer.initialize(to: arr) let x = pointer.pointee[3] https://riptutorial.com/zh-CN/home 11 print(x) pointer.deinitialize() pointer.deallocate(capacity: 4) class A { var x: String? convenience init (_ x: String) { self.init() self.x = x } func description() -> String { return x ?? "" } } let arr2 = [A("OK"), A("OK 2")] let pointer2 = UnsafeMutablePointer<[A]>.allocate(capacity: 2) pointer2.initialize(to: arr2) pointer2.pointee let y = pointer2.pointee[1] print(y) pointer2.deinitialize() pointer2.deallocate(capacity: 2) Swift 3.0 Swift; public init?(validatingUTF8 cString: UnsafePointer<CChar>) nullUTF-8。 UTF-8。nil 。CChar - UTF-8。 Source Apple Inc.Swift 3 For header accessIn PlaygroundCmd +Swift
Recommended publications
  • Analysis of Boundary Resources in B2B Software Platforms Maximilian Schreieck, Robert Finke, Manuel Wiesche, Helmut Krcmar EWSECO 2017, Darmstadt November 23, 2017
    Sandbox vs. Toolbox – Analysis of Boundary Resources in B2B Software Platforms Maximilian Schreieck, Robert Finke, Manuel Wiesche, Helmut Krcmar EWSECO 2017, Darmstadt November 23, 2017 Informatics 17 - Chair for Information SystemsTUM Faculty of Informatics Technische Universität München www.i17.in.tum.de Agenda 1 Motivation 2 Background & Method 3 Results & Interpretation © Prof. Dr. Helmut Krcmar 2 © Prof. Dr. Helmut Krcmar 3 Motivation Challenge • The interplay of boundary resources and value co-creation is not fully understood • Research is limited to B2C platforms although B2B platforms gain importance Goal • Identify concepts of boundary resources applied in practice by analyzing the use of boundary resources by IBM Bluemix and Salesforce • Improve our understanding of the influence of boundary resources on value co-creation © Prof. Dr. Helmut Krcmar 4 Research questions What boundary resources can be identified in literature and practice? How does the design of boundary resources impact value co- creation in B2B software platforms? © Prof. Dr. Helmut Krcmar 5 Agenda 1 Motivation 2 Background & Method 3 Results & Interpretation © Prof. Dr. Helmut Krcmar 6 Software platforms Complementor Complementor Complementor 1 2 3 Complement 1 Complement 2 Complement 3 Platform Complement 1 End User 1 Owner Complement 2 Complement 3 End User 2 Definition • Multisided (market and/or development) platform • Higher innovation rates and higher competitiveness than traditional business models • Ecosystem of third-party developers is leveraged Sources:
    [Show full text]
  • Powering an App with Swift Microservices
    Powering an App with Swift Microservices ~ Who: Jarrod Parkes What: Swift Cloud Workshop 2 When: Sept 30th, 2017 @ 2:10-2:40 PM CST Where: Amazon Inc, Austin, TX, USA Why: We Swift! Hey, I'm Jarrod I build iOS/Swift courses at Udacity I've been working on a "Server-Side Swift" course Course features "Game Night!" An iOS app powered by Swift microservices Talk Outline Developing Game Night! The ups and downs Future development Where It Started Course v1 launched @ IBM InterConnect 2017 Swift on Linux Swift Package Manager IBM Cloud Tools, ToDo app Built with Kitura We Can Do More! Course v1 was "ok", but missing a spark Let's build something compelling! Activities Microservice Student's first microservice from scratch CRUD microservice Uses MySQL client https://github.com/nicholasjackson/swift-mysql Supports pagination, transactions, and stored procedures Imperative style, easy to test MySQL Client: Init // Create connection pool var pool = MySQLConnectionPool( connectionString: connectionString, poolSize: 10, defaultCharset: "utf8mb4") // Create data accessor var dataAccessor = ActivityMySQLDataAccessor(pool: pool) MySQL Client: Querying // In data accessor... do { // Get connection let connection = try pool.getConnection() defer { pool.releaseConnection(connection!) } // Execute query let result = try connection!.execute(builder: query) let activities = result.toActivities() // Return results... } catch { /* Error */ } Activities: Data public struct Activity { public var id: Int? public var name: String? public var emoji: String? public
    [Show full text]
  • Copyrighted Material
    Contents Introduction . xxiii 1 Swift.org, the Open Source Project . 1 What’s Included . 1 Source Code Repositories . 2 How to Get Involved . 5 Mailing Lists . 7 Bug Tracking . 8 Swift Evolution and Roadmap . 12 Priorities for the Swift 4.0 Major Release . 14 Binary Downloads . 14 MacOS Binaries . 15 Linux Binaries . 16 Swiftenv, Swift Version Manager . 17 Summary . 17 2 A Swift Sandbox in the Cloud . 19 The IBM Cloud Platform . 19 Getting Started . 26 Sign Me Up!. 26 Saving and Sharing Code Samples . 28 Selecting Swift Versions and More . 30 Have You RunCOPYRIGHTED on a Mainframe Lately? . .MATERIAL . 30 IBM Swift Package Catalog and Sandbox . 32 Summary . 33 xviii Contents 3 A Basic Introduction to Swift . 35 Background . 35 Let’s Get Coding! . 35 Swift Standard Library . 35 Swift Foundation Library . 37 C Library Interoperability . 39 Concurrency Library . 41 Memory Management . 43 The Language Landscape . 48 Language Groupings . 48 Language Timeline . 50 Summary . 51 4 The IBM Bluemix Buildpack for Swift . 53 Cloud Foundry Buildpacks . 53 Buildpack Phases . 54 Working with the IBM Bluemix Buildpack for Swift . 55 Where Is the Source Code Hosted? . 55 What Version of the Buildpack Is Currently Installed? . 56 File Artifacts Required for Provisioning Your Application on Bluemix . .58 Installing Additional System-Level Dependencies . 61 Downloading Closed Source Dependencies . 68 Examples of Using the IBM Bluemix Buildpack for Swift . 69 Swift HelloWorld . 69 Kitura Starterr . 74 BluePic . 77 Using the Latest Code of the IBM Bluemix Buildpack for Swift . 87 Summary . 88 ftoc.indd 07/25/17 Page xviii Contents xix 5 Using Containers on Bluemix to Run Swift Code .
    [Show full text]
  • Ibm Cloud Service Agreement Diasend
    Ibm Cloud Service Agreement Loopy Stillman resiles or criminate some lineation pithy, however synonymical Scotty hoe possessively or strafing. Marathi and runed Tait spree her burplibertinism some swingingironers practically. torridly or resurfacing post-free, is Wilmar barelegged? Arizonian and balked Derby advertized her spruce popularise while Jephthah Manager that provides the ibm cloud service description number of service Programmers to cloud agreement with ibm cloud platform for build steps in a cloud solutions offered via the right to modernize your language. Amounts of cloud service agreement reduces duplication for build artifacts and portals have any right or discontinue features of the language. Helper chat is ibm cloud out of tones from vendor to cloud assets and maintaining system for which the preview cloud service is an easy it. Making claims against you: suitable for cloud infrastructure for resellers where prohibited, and medium businesses and to. Partners to run, service credits will treat such as paragraphs, it is the google cloud service, immediately cease using the eclipse orion web applications. Match any time a cloud service agreement, the business and licenses granted under the usage term in violation of text, along the software services or any particular purpose. License fees for either procure for open service credits will not to run your agreement, the public cloud? Governmental regulation or modify or the service or grants data for failure to build on a region go or applications. Students to help software service agreement to build your next go or implied, they can be added on the expectations. Obd error free operation of a global corporations use of binary resources as they will now! Science tools for service includes user is a real time to add a private instances.
    [Show full text]
  • IBM Cloud Paks and Red Hat Openshift on IBM Power Systems
    IBM Cloud Paks and Red Hat OpenShift on IBM Power Systems OHIO LINUXFEST 2019 November 1-2 at the Hyatt Regency Columbus, Ohio Jim Smith IBM Cloud / Cognitive Infrastructure Client Technical Specialist IBM Systems IBM Systems / November 2nd / © 2019 IBM Corporation Hybrid Cloud A hybrid cloud is a computing environment that combines a private cloud and a public cloud by allowing applications and data to be shared between them. What is Multicloud Multicloud is a cloud approach made up of more than one Hybrid cloud service, from more than one cloud vendor—public Multicloud? or private. Hybrid Multicloud = Hybrid Cloud + Multicloud A hybrid multicloud combines a private cloud, a public cloud and more than one cloud service, from more than one cloud vendor. 2 Enterprises are deploying on-premises clouds and containers as a foundation for hybrid cloud strategies 80% of organizations have migrated apps or data from public cloud to on-premises or private cloud Source: https://www.crn.com/businesses-moving-from-public- cloud-due-to-security-says-idc-survey IBM Systems / November 2nd / © 2019 IBM Corporation Digital transformation requires apps to be easy to develop and deploy anywhere at cloud scale Businesses uniquely evolve on their cloud and digital transformation journey. Clients often are forced to span multiple public and private clouds, which must be integrated to achieve the agility and speed that enterprise demands. Modernizing apps with micro-services and new software technologies to seamlessly run apps and access data from anywhere is painful without automating cloud infrastructure: • Agile DevOps require new applications built using the latest software approaches vs.
    [Show full text]
  • Structs 42 Getting Ready 43 How to Do It
    Swift 4 Programming Cookbook 50 task-oriented recipes to make you productive with Swift 4 Keith Moon BIRMINGHAM - MUMBAI Swift 4 Programming Cookbook Copyright © 2017 Packt Publishing All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews. Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book. Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information. First published: September 2017 Production reference: 1260917 Published by Packt Publishing Ltd. Livery Place 35 Livery Street Birmingham B3 2PB, UK. ISBN 978-1-78646-089-9 www.packtpub.com Credits Author Copy Editor Keith Moon Shaila Kusanale Reviewer Project Coordinator Giordano Scalzo Ulhas Kambali Commissioning Editor Proofreader Ashwin Nair Safis Editing Acquisition Editor Indexer Larissa Pinto Mariammal Chettiyar Content Development Editor Graphics Onkar Wani Abhinash Sahu Technical Editor Production Coordinator Akhil Nair Shraddha Falebhai About the Author Keith Moon is an award-winning iOS developer, author, and speaker based in London.
    [Show full text]
  • Swift Language
    Swift Language #swift Table of Contents About 1 Chapter 1: Getting started with Swift Language 2 Remarks 2 Other Resources 2 Versions 2 Examples 3 Your first Swift program 3 Installing Swift 4 Your first program in Swift on a Mac (using a Playground) 5 Your first program in Swift Playgrounds app on iPad 9 Optional Value and Optional enum 10 Chapter 2: (Unsafe) Buffer Pointers 12 Introduction 12 Remarks 12 Examples 12 UnsafeMutablePointer 12 Practical Use-Case for Buffer Pointers 13 Chapter 3: Access Control 15 Syntax 15 Remarks 15 Examples 15 Basic Example using a Struct 15 Car.make (public) 16 Car.model (internal) 16 Car.otherName (fileprivate) 16 Car.fullName (private) 16 Subclassing Example 17 Getters and Setters Example 17 Chapter 4: Advanced Operators 18 Examples 18 Custom Operators 18 Overloading + for Dictionaries 19 Commutative Operators 20 Bitwise Operators 20 Overflow Operators 21 Precedence of standard Swift operators 22 Chapter 5: AES encryption 24 Examples 24 AES encryption in CBC mode with a random IV (Swift 3.0) 24 AES encryption in CBC mode with a random IV (Swift 2.3) 27 AES encryption in ECB mode with PKCS7 padding 28 Chapter 6: Algorithms with Swift 30 Introduction 30 Examples 30 Insertion Sort 30 Sorting 30 Selection sort 33 Asymptotic analysis 34 Quick Sort - O(n log n) complexity time 35 Graph, Trie, Stack 36 Graph 36 Trie 43 Stack 46 Chapter 7: Arrays 50 Introduction 50 Syntax 50 Remarks 50 Examples 50 Value Semantics 50 Basics of Arrays 50 Empty arrays 51 Array literals 51 Arrays with repeated values 51 Creating
    [Show full text]
  • Swift & Bluepic Oct 25Th, 2017
    Swift & BluePic Oct 25th, 2017 Ricardo Olivieri 1 Agenda • Swift introduction • Benefits • Modern language constructs • Platforms • Why Swift on the server? • Provisioning Swift applications to the IBM Cloud • The IBM Cloud Buildpack for Swift • How to use the IBM Cloud Buildpack for Swift? • What is Kitura? • What is BluePic? • Architecture 2 • IBM Cloud Capabilities • Demo! • Resources Swift introduction • Before Swift, Objective-C was the programming language for developing iOS and macOS apps. • Swift provides a much simpler syntax than Objective-C. • As soon as Swift was released, developers started sharing their preference of Swift over Objective-C, given its support of many modern programming conventions (e.g. tuples, generics, closures, type inference, and optionals). 3 Swift introduction Objective-C: Person *person = ...; NSMutableString *description = [[NSMutableString alloc] init]; [description appendFormat:@"%@ is %i years old.", person.name, person.age]; if (person.employer) { [description appendFormat:@" They work for %@.", person.employer]; } else { [description appendString:@" They are unemployed."]; } Swift: var person = … var description = "" description += "\(person.name) is \(person.age) years old." if let employer = person.employer { description += " They work for \(employer)." } else { description += " They are unemployed." } 4 Swift introduction • Type inference • Optionals • Generics • Tuples • Extensions • … 5 The Case for Swift, a Powerful, Intuitive and Uncompromising Programming Language 600% One of the most
    [Show full text]
  • Java Magazine 2 2019
    Nummer 2 - 2019 MAGAZINE Onafhankelijk tijdschrift voor de Java-professional Een duik in Java events met de beste sprekers Scherp je veiligheid aan met Keystroke Dynamics Python voor Java developers? Word zelf een spreker Inclusief op meetups en events! vooruitblik J-spring 2019 TEQnation programmaboekje en plattegrond Features Java 12: upgraden Interview met Verslag: Uncle Bob of niet? Venkat Subramaniam in Nederland 01 COVER.indd 1 23-04-19 09:30 Powered by Foto: Frans van Bragt van Frans Foto: Bestel nu je tickets op: jspring.nl/tickets/ De line-up staat online! Uitgelichte sprekers Adam Bien Burr Sutter Peter Hilton Siren Hofvander Sven Peters Katherine Stanley JavaOne Director Independent CSO Lead Evangelist Software Engineer Rockstar @ Red Hat Consultant @ Docly @ K15t @ IBM Vind de volledige line-up op jspring.nl Main Sponsor Co-Sponsors Partners Adv J-Spring.indd 9 17-04-19 15:37 VOORWOORD Colofon Java Magazine 02-2019 Voorwoord Content manager: Stijn van de Blankevoort Java leeft in Nederland Eindredactie: Anne Camphuijsen-Wieleman Programmeertalen zijn constant in beweging en zo ook de aanverwan- Projectcoördinator: te technologieën. Dit zorgt ervoor dat je als developer continu je kennis Tedje van Gils up-to-date moet blijven houden. Auteurs: Koen Aerts, Jan-Hein Buhrman, Edwin Derks, Lennard Eijsackers, Gelukkig zijn er middelen om je hierbij te helpen: zo kun je tijdens eve- Erwin de Gier, Mathijs de Groot, Arno Koehler, Arjan Lamers, Joop nementen en meet-ups in één dag(deel) je kennis bijschaven Lanting, Philip Leonard, Sander Mak, Wouter Oet, Robert Scholte, in jouw vakgebied. Veelal gegeven door grootheden uit het vak.
    [Show full text]
  • Cloud Object Storage As a Service: IBM Cloud Object Storage from Theory to Practice
    Front cover Cloud Object Storage as a Service IBM Cloud Object Storage from Theory to Practice Anil Patil Deepak Rangarao Harald Seipp Maciej Lasota Reginaldo Marcelo dos Santos Rob Markovic Simon Casey Stephen Bollers Vasfi Gucer Andy Lin Casey Richardson Robert Rios Ryan VanAlstine Tim Medlin Redbooks International Technical Support Organization Cloud Object Storage as a Service: IBM Cloud Object Storage from Theory to Practice March 2017 SG24-8385-00 Note: Before using this information and the product it supports, read the information in “Notices” on page vii. First Edition (March 2017) This edition applies to IBM Cloud Object Storage public offering Version 1.0). © Copyright International Business Machines Corporation 2017. All rights reserved. Note to U.S. Government Users Restricted Rights -- Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. Contents Notices . vii Trademarks . viii Preface . ix Authors. .x Now you can become a published author, too! . xiv Comments welcome. .xv Stay connected to IBM Redbooks . .xv Part 1. IBM Cloud Object Storage concepts. 1 Chapter 1. Introduction to object storage. 3 1.1 What object storage is. 4 1.2 What storage business problems object storage can address . 6 1.3 What qualifies business problems for object storage . 6 1.4 Access methods for object storage . 7 1.4.1 Access to storage through the REST API. 7 1.4.2 Access to object storage through other methods . 8 1.5 Comparison and positioning to other storage models. 9 1.5.1 Block storage . 9 1.5.2 File storage . 10 1.6 Object storage key concepts.
    [Show full text]
  • Download Tech Beacon
    A Mindtree Publication I Volume 4 I 2018 ABOUT Technology is core to Mindtree. It is extremely important in building capability and capacity for us to keep a sharp focus on emerging technologies. We also make it a point to understand the application of these technologies in the context of our customers. In this effort, we constantly explore and experiment with emerging technologies and gauge their maturity levels for consumption by enterprises. We do this by comparing and contrasting them with similar tools already in use. Tech Beacon is an initiative to compile outcomes of our experimentation and technology adoption guidance for enterprises. We group technologies under three categories: Invest, Experiment and Watch. We explain these categories in detail in this report. Direction Tech Beacon provides direction to enterprises on various technologies by categorizing them as Invest, Experiment or Watch technologies. Invest These technologies have a high potential for generating business value in the near future. Mindtree intends to build capability internally or identify a partner who can help our project teams learn to bootstrap these technologies. We arrive at these technologies by observing customer demands, industry trends, opportunities and open source community support. Most of these technologies were either implemented in production-grade applications for customers, or in internal reference implementations. Experiment These technologies have not yet seen mainstream adoption but show huge promise for the near future. We arrive at these technologies by listening to our customers’ interests, following industry buzz, and noting indications of increased activity in various forums and analyst reports. We need to experiment and build capability in these technologies to have an early adopter edge.
    [Show full text]
  • Kitura Edition
    HACKING WITH SWIFT COMPLETE TUTORIAL COURSE Learn to make web E PL apps with real-worldAM S Swift projects EE FR Paul Hudson Chapter 1 Million Hairs www.hackingwithswift.com 2 Setting up The first project of any book is always difficult, because there’s a steep difficulty ramp as you learn all the basics required just to make something simple. I’ve tried to keep it as simple as possible while still teaching useful skills, so in this initial project you’re going to create a website for the Million Hairs veterinary clinic. Along the way you’re going to learn how to create and configure a project using the Swift package manager, how to route users to different parts of your code depending on the URL they enter, how to log information, and how to separate your code from your presentation – i.e., how to keep Swift separate from HTML. Now, it’s possible you think I’m already patronizing you: surely you already know how to create a new Swift project? You have to remember that server-side Swift is designed to work across platforms, which means that it relies on Xcode far less. In fact, by default Xcode isn’t involved at all: you create your project using the Swift package manager, which comes bundled with the open-source Swift distribution. If you’re using macOS with Xcode installed, you already have access to the Swift package manager. If you’re using Docker with IBM’s Kitura container, then that pre-installs the Swift distribution and gets the package manager that way.
    [Show full text]