Learn to Make Web Apps with Real-World Swift Projects Paul Hudson Contents

Total Page:16

File Type:pdf, Size:1020Kb

Learn to Make Web Apps with Real-World Swift Projects Paul Hudson Contents HACKING WITH SWIFT 4&37&34*%& 48*'5 COMPLETE TUTORIAL COURSE Learn to make web apps with real-world Swift projects Paul Hudson Contents Preface 6 About this book Why does Kitura exist? A note for existing Swift developers Configuring your machine Introduction: Swift for Complete Beginners 21 How to install Xcode and create a playground Variables and constants Types of Data Operators String interpolation Arrays Dictionaries Conditional statements Loops Switch case Functions Optionals Optional chaining Enumerations Structs Classes Properties Static properties and methods Access control Polymorphism and typecasting Closures Wrap up Million Hairs 101 Setting up Swift packages explained Starting a server Routing user requests Writing HTML Matching custom routes Making it look good www.hackingwithswift.com 2 Wrap up CouchDB Poll 139 Setting up CouchDB from scratch Designing a JSON API Bringing CouchDB and Kitura together Creating CouchDB documents Casting a vote Wrap up Routing 178 Setting up Chaining routes Reading user data Routing regular expressions Wrap up Swift Fan Club 191 Setting up Listing forums Querying with a key Closures within closures Users and sessions Posting messages and replies Wrap up Meme Machine 237 Setting up Reading files from disk Multi-part form encoding Wrap up Templates 251 Setting up Recap on the basics Filters and tags Wrap up Barkr 265 Setting up www.hackingwithswift.com 3 An SQL primer Integrating MySQL with Kitura Generating tokens Reading insert IDs Over to you: fuzzy search Wrap up ASCII art 300 Setting up Updating pages interactively Reading remote images Wrap up Databases 316 Setting up Indexing for performance Normalization for efficiency Referential integrity for organization Transactions for consistency Default values for safety Wrap up Instant Coder 333 Setting up Say hello with GitHub Rendering the basic UI Creating new accounts Routing to success Creating new projects Finding places to work Wrap up AppleFanatic 370 Setting up Bootstrapping our servers Fetching stories from a database IDs, slugs, and Markdown Stories and errors Browsing by category Creating an admin section Wrap up www.hackingwithswift.com 4 Testing 422 Setting up Bootstrapping XCTest Testing our routes Wrap up www.hackingwithswift.com 5 Preface www.hackingwithswift.com 6 About this book The Server-Side Swift tutorial series is designed to make it easy for beginners to get started building web apps and websites using the Swift programming language. My teaching method skips out a lot of theory. It skips out the smart techniques that transform 20 lines of easy-to-understand code into 1 line of near-magic. It ignores coding conventions by the dozen. And perhaps later on, once you've finished, you'll want to go back and learn all the theory I so blithely walked past. But let me tell you this: the problem with learning theory by itself is that your brain doesn't really have any interest in remembering stuff just for the sake of it. You see, here you'll be learning to code on a Need To Know basis. Nearly everything you learn from me will have a direct, practical application to something we're working on. That way, your brain can see exactly why a certain technique is helpful and you can start using it straight away. This book has been written on the back of my personal motto: "Programming is an art. Don't spend all your time sharpening your pencil when you should be drawing." We'll be doing some "sharpening" but a heck of a lot more "drawing" – if that doesn't suit your way of learning, you should exit now. The three golden rules The series is crafted around a few basic tenets, and it's important you understand them before continuing: 1. Follow the series: The tutorials are designed to be used in order, starting at the beginning and working through to the end. The reason for this is that concepts are introduced sequentially on a need-to-know basis – you only learn about something when you really have to in order to make the project work. 2. Don't skip the technique projects: The tutorials follow a sequence that places a technique project after every two app projects. That is, you develop two apps then we focus on a particular component to help make your code better. The apps are standalone projects that you can go on to develop as you wish, whereas the technique tutorials will often be used to improve or prepare you for other projects. www.hackingwithswift.com 7 3. Get ready to hack: This is not designed to be the one-stop learning solution for all your Swift needs. The goal of each project is to reach the end with as little complication as possible, while learning one or more things along the way. I can't re-iterate that last point enough. What I have found time and time again is that any tutorial, no matter how carefully written or what audience it's aimed at, will fail to fit the needs of many possible readers. And these people get angry, saying how the tutorial is wrong, how the tutorial is lame, how their tutorial would be much better if only they had the time to write it, and so on. Over the last 12 years of writing, I have learned to ignore minority whinging and move on, because what matters is that this tutorial is useful to you. You'd be surprised by how many people think the path to success is through reading books, attending classes or, well, doing pretty much anything except sitting down in front of a computer and typing. Not me. I believe the best way to learn something is to try to do it yourself and see how it goes. Sure, going to classes might re-enforce what you've learned, or it might teach you some time- saving techniques, but ultimately I've met too many people with computing degrees who stumble when asked to write simple programs. Don't believe me? Try doing a Google search for "fizz buzz test", and you'll be surprised too. So, dive in, make things, and please, please, please have fun – because if you're not enjoying yourself, Swift coding probably isn't for you. If you spot any errors in this book, either typos or technical mistakes, please do let me know so I can correct them as soon as possible. The best way to get in touch is on Twitter @twostraws, but you can also email [email protected]. Xcode, Swift and Kitura I'm not going to talk much, because I want to get straight into coding. However, there are some points you do need to know: www.hackingwithswift.com 8 • I’ve written these tutorials using Xcode 8.1, which is available for free from the Mac App Store. If you’re using an earlier version of Xcode you should upgrade before continuing otherwise you may encounter bugs. • If you’re using Linux or considering using Linux, please read the introductory chapter “A note on Linux”. • Swift is a relatively new language, and is evolving quickly. Every new release of Xcode seems to change something or other, and often that means code that used to work now no longer does. At the time of writing, Swift is mature enough that the changes are relatively minor, so hopefully you can make them yourself. If not, check to see if there's an update of the project files on hackingwithswift.com. • These projects are designed to work with Kitura 1.0 or later. Please upgrade your system otherwise you’ll find this book very confusing indeed! Important note: if any bugs are found in the project files, or if Swift updates come out that force syntax changes, I'm going to be updating this book as needed. You should follow me on Twitter @twostraws if you want to be notified of updates. I'm also happy to answer questions on Twitter if you encounter problems, so please feel free to get in touch! Swift, the Swift logo, Xcode, Instruments, Cocoa Touch, Touch ID, AirDrop, iBeacon, iMessage, iPhone, iPad, Safari, App Store, Mac, and macOS are trademarks of Apple Inc., registered in the U.S. and other countries. Server-Side Swift is copyright Paul Hudson. All rights reserved. No part of this book or corresponding materials (such as text, images, or source code) may be reproduced or distributed by any means without prior written permission of the copyright owner. Acknowledgements I'd like to thank Ankit Aggarwal for his invaluable help and advice with the Swift package manager. It's a fast-developing part of our ecosystem, but Ankit is doing a great job documenting all the changes and supporting everyone who has questions. I'm also grateful to Kyle Fuller for being so responsive with answers, features, and fixes to his www.hackingwithswift.com 9 Stencil template engine. His work made my life a great deal easier, and I look forward to seeing where Stencil goes next! Dedication This book is dedicated to IBM's Kitura team, who have patiently answered my many questions on their Slack channel. Chris Bailey, Shmuel Kallner, Youming Lin, Ian Partridge, and others – thank you! www.hackingwithswift.com 10 Why does Kitura exist? It doesn’t matter whether you’ve been using iOS, macOS, watchOS, or tvOS – they are all very different to working on the server. Taking iOS as an example, you’re already used to the idea that apps are built using multiple layers. Here are some of them: 1. The Swift programming language provides us with basic syntax and functionality like func, var, as well as closures, classes, and so on.
Recommended publications
  • Subject Module Project in Computer Science
    Subject Module Project in Computer Science Exam group number: S2026631-3 Project title: Server Liquid Dispenser Group Members: Andreas Work - 66712 - [email protected] Bastian Inuk Christensen - 66523 - [email protected] Frida Valles Kirkegaard - 65451 - [email protected] Simon Damtoft Bjergø - 66818 - [email protected] Supervisor: Sune Thomas Bernth Nielsen Date: 03/06-2020 4th semester - spring Number of characters: 58.600 Number of standard pages: 25 Bjergø – 66818 S2026631-3 03-06-2020 Christensen – 66523 Roskilde University 4th semester Kirkegaard – 65451 Subject Module Project - CS Work – 66712 1.0 Abstract This paper seeks to streamline the process of ordering and automate the creation of drinks. While a machine for creating drinks was proposed was not completed. The paper starts out exploring the project management methodology. Here the project made use of user stories, Kanban and a use case diagram. User stories were used to find the scope of the project. Kanban was used for time management and use case diagram was used to further develop the use for the app. Only an app for android and server is made. The server is made in the language Swift using Vapor as a framework. The server would be used by admins or owners of the machines and would contain the drinks available. The server also contains a database of the users who signed up using the app. The app was made in the IDE android studio in the language Java. The app would be used by customers to sign up and order. The app and server communicate using HTTP headers. The project concludes with a system with the quintessential parts of the streamlining, but further development and a machine to create the drinks are needed, before real life implementation is possible.
    [Show full text]
  • 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]
  • Vapor 3.0 and Kitura 2.5
    Hands-On Server-Side Web Development with Swift Build dynamic web apps by leveraging two popular Swift web frameworks: Vapor 3.0 and Kitura 2.5 Angus Yeung BIRMINGHAM - MUMBAI Hands-On Server-Side Web Development with Swift Copyright © 2018 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 or its dealers and distributors, will be held liable for any damages caused or alleged to have been 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. Commissioning Editor: Kunal Chaudhari Acquisition Editor: Karan Gupta Content Development Editor: Francis Carneiro Technical Editor: Akhil Nair Copy Editor: Safis Editing Project Coordinator: Pragati Shukla Proofreader: Safis Editing Indexer: Mariammal Chettiyar Graphics: Alishon Mendonsa Production Coordinator: Nilesh Mohite First published: November 2018 Production reference: 1301118 Published by Packt Publishing Ltd. Livery Place 35 Livery Street Birmingham B3 2PB, UK. ISBN 978-1-78934-117-1 www.packtpub.com mapt.io Mapt is an online digital library that gives you full access to over 5,000 books and videos, as well as industry leading tools to help you plan your personal development and advance your career.
    [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]
  • A Web Framework for Web Development Using C++ and Qt
    C++ Web Framework: A Web Framework for Web Development using C++ and Qt Herik Lima1;2 and Marcelo Medeiros Eler1 1University of Sao˜ Paulo (EACH-USP), Sao˜ Paulo, SP, Brazil 2XP Inc., Sao˜ Paulo, SP, Brazil Keywords: Web, Framework, Development, C++. Abstract: The entry barrier for web programming may be intimidating even for skilled developers since it usually in- volves dealing with heavy frameworks, libraries and lots of configuration files. Moreover, most web frame- works are based on interpreted languages and complex component interactions, which can hurt performance. Therefore, the purpose of this paper is to introduce a lightweight web framework called C++ Web Framework (CWF). It is easy to configure and combine the high performance of the C++ language, the flexibility of the Qt framework, and a tag library called CSTL (C++ Server Pages Standard Tag Library), which is used to handle dynamic web pages while keeping the presentation and the business layer separated. Preliminary evaluation gives evidence that CWF is easy to use and present good performance. In addition, this framework was used to develop real world applications that support some business operations of two private organizations. 1 INTRODUCTION configuration files; and writing glue code to make multiple layers inter-operate (Vuorimaa et al., 2016). Web Applications have been adopted as the de facto In addition, many web frameworks present poor doc- platform to support business operations of all sort of umentation (Constanzo and Casas, 2016; Constanzo organizations for a long time. This has been even and Casas, 2019). more stimulated by the availability of modern frame- Those peculiar characteristics of web devel- works and tools (Chaubey and Suresh, 2001) along opment environments have many practical conse- side with the growth of technologies related to Soft- quences.
    [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]
  • Parsing & Modeling Swift Systems
    Bachelor Thesis June 21, 2017 Parsing & Modeling Swift Systems Alessio Buratti Abstract Swift is an emerging programming language, mainly used to develop applications for Apple devices. It is widely used and its popularity is still increasing. We developed PMSS, a toolkit, written in Swift, that parses Swift applications and exports a model of their source code according to the FAMIX meta-modeling standard. These models can be analyzed using our iOS/macOS application or Moose, a language-independent platform for software and data analysis. Advisor Prof. Michele Lanza Assistant Roberto Minelli Advisor’s approval (Prof. Michele Lanza): Date: Contents 1 Introduction 2 1.1 Goal .............................................................2 1.2 Motivation . .2 2 State Of The Art 2 2.1 Related work . .2 3 Swift and the meta-modeling tools in a nutshell 3 3.1 The Swift Programming Language . .3 3.1.1 Some “Swifty” code examples . .3 3.2 FAMIX: a language independent meta-model . .5 3.3 MOOSE: a platform for software and data analysis . .6 4 PMSS: Parsing & Modeling Swift Systems 7 4.1 SourceKit: the core of Swift’s source code manipulation . .9 4.2 SourceKitten: high-level SourceKit interaction . .9 5 PMSS Model Visualizer: Our iOS and macOS Cocoa applications 14 5.1 iOS.............................................................. 14 5.2 macOS . 14 5.3 SceneKit: a high-level 3D graphics framework . 15 5.4 ARKit: augmented reality experience in any iOS application . 16 6 Conclusion 17 1 1 Introduction 1.1 Goal Software systems are constantly changing, old modules and components are being deprecated and replaced by more modern ones while new features are implemented and the existing ones are optimized.[7] Code maintenance is a complicated task, to be done, a deep knowledge and understanding of the system is necessary.[6] Reverse engineering is the process of analyze existing software systems and understand them.[3] Different tools can help the engineers to achieve this result.
    [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]
  • Vytvoření Serverové Aplikace V Programovacím Jazyce Swift Development of Server Application in Swift Programming Language
    VYSOKÉ UČENÍ TECHNICKÉ V BRNĚ Fakulta elektrotechniky a komunikačních technologií BAKALÁŘSKÁ PRÁCE Brno, 2018 Martin Střálka VYSOKÉ UČENÍ TECHNICKÉ V BRNĚ BRNO UNIVERSITY OF TECHNOLOGY FAKULTA ELEKTROTECHNIKY A KOMUNIKAČNÍCH TECHNOLOGIÍ FACULTY OF ELECTRICAL ENGINEERING AND COMMUNICATION ÚSTAV TELEKOMUNIKACÍ DEPARTMENT OF TELECOMMUNICATIONS VYTVOŘENÍ SERVEROVÉ APLIKACE V PROGRAMOVACÍM JAZYCE SWIFT DEVELOPMENT OF SERVER APPLICATION IN SWIFT PROGRAMMING LANGUAGE BAKALÁŘSKÁ PRÁCE BACHELOR'S THESIS AUTOR PRÁCE Martin Střálka AUTHOR VEDOUCÍ PRÁCE doc. Ing. Jiří Hošek, Ph.D. SUPERVISOR BRNO 2018 Bakalářská práce bakalářský studijní obor Teleinformatika Ústav telekomunikací Student: Martin Střálka ID: 174403 Ročník: 3 Akademický rok: 2017/18 NÁZEV TÉMATU: Vytvoření serverové aplikace v programovacím jazyce Swift POKYNY PRO VYPRACOVÁNÍ: V bakalářské práci se student bude zabývat nejprve analýzou možnosti použití jazyka Swift pro vývoj serverových aplikací. Následně v jazyce SWIFT navrhne a vytvoří aplikaci pro REST komunikaci. Jako podklad bude sloužit popis již existující aplikace pro měření kvality mobilního internetového připojení. Vytvořená aplikace bude schopna komunikovat s databází a dle uživatelských požadavků vyčítat potřebné informace a ukládat je do XML / CSV souborů s požadovanou strukturou. DOPORUČENÁ LITERATURA: [1]The Swift Programming Language [online]. Swift 4.0. Cupertino: Apple, 2014 [cit. 2017-09-15]. Dostupné z: https://itunes.apple.com/cz/book/the-swift-programming-language-swift-4/id881256329?mt=11 [2]FLEMING, Candace C.
    [Show full text]
  • Swift for Linux Documentation
    Swift for Linux Documentation Ryan Gonzalez May 22, 2018 Contents: 1 What’s wrong? 3 1.1 Installing Swift..............................................3 1.2 Navigating the Ecosystem........................................4 1.3 Distributing Swift Applications.....................................6 1.4 Extra Credit: Swift on Other Distros...................................7 2 Indices and tables 11 i ii Swift for Linux Documentation Swift for Linux is a project aiming at making the experience of using the Swift programming language from Linux easier. Contents: 1 Swift for Linux Documentation 2 Contents: CHAPTER 1 What’s wrong? A lot! Apple only provides Swift binaries that run well on Ubuntu, and users of other distros will have a fun time trying to get them to work. It’s hard to share Swift applications you’ve built, and the majority of the ecosystem, being Mac-and-iOS-focused, tends to create libraries that don’t work under Linux. This guide is trying to be a central point for people trying to get a great Swift experience on their Linux systems. If you have anything you’d like to add, or if you notice a problem in this guide, feel free to submit an issue. Also, if you need help, try stopping by the unofficial Swift Discord. 1.1 Installing Swift Unfortunately, the official Swift binaries only work on Ubuntu, and they’re standalone binaries independent of any package manager. Here are steps on getting it to work on various distros/package tools. 1.1.1 Flatpak The easiest way to get started using Swift is via the Flatpak repo. Make sure you’ve followed the official Flatpak setup instructions.
    [Show full text]