برچسب: Apprentice

  • Swift Apprentice: Beyond the Basics

    Swift Apprentice: Beyond the Basics


    This section tells you a few things you need to know before you get started, such as what you’ll need for hardware and software, where to find the project files for this book, and more.

    The section is a list of the expanded areas of Swift programming. It systematically navigates a variety of important topics, from the principles of Access Control, Code Organization, and Testing to custom Operators, Subscripts, and Keypaths. It presents in-depth coverage of Swift’s powerful idioms, like Result Builders and Pattern Matching, and ensures your proficiency in handling real-world errors.

    The section further covers advanced concepts such as Encoding & Decoding Types, Memory Management, and takes you through the subtelties of value semantics. It presents a thorough discussion on Property Wrappers, the driving force behind popular frameworks like SwiftUI, and explores Protocol-Oriented Programming, underscoring Swift’s protocol-based design.

    Finally, it covers Advanced Protocols, Generics, and Concurrency, giving you a solid understanding of Swift’s language-level concurrency mechanisms. Each topic provides a robust foundation for advanced Swift programming, ensuring your grasp of these concepts is both thorough and practical.

    Swift gives you powerful tools for hiding complexity and organizing your code into easier-to-digest units. As your codebase grows,
    ensuring correctness with automated tests becomes more critical in your projects.

    You’ll learn how to define your own operators and use subscripts to make your types feel even more like built-in language constructs.
    Keypaths provide references to properties, and together with subscripts and dynamic member lookup, you can do amazing things.

    Swift is a concise, powerful language but can be verbose for certain tasks. Result builders allow you to create a domain-specific language and compactly express complex values. In this chapter, you will implement a result builder for making fancy attributed strings.

    With pattern matching, you can accomplish more with less typing, and it helps give Swift its modern language feel. This chapter picks up where “Swift Apprentice: Fundamentals – Chapter 4: Advanced Flow Control” left off and shows you powerful Swift idioms that let you work with switch statements, tuples, optionals and more.

    In the real world, you can’t avoid some errors. Gracefully handling errors is what sets mediocre code apart from great code. From handling missing values and simple initialization failure with optionals to providing greater diagnostic detail using full-featured error types, Swift provides language features to make your code robust and informative in the face of errors.

    Swift has a powerful system for saving and loading your types to and from, for example, a file system, over the internet or some other communication channel. Swift has exceptional out-of-the-box support for the JSON format you will become familiar with in this chapter.

    This chapter digs into the details of Swift’s automatic reference counting and memory management. It shows you how to avoid memory leaks when object relationships result in reference cycles.

    Value semantics have a clear advantage over reference semantics regarding local reasoning but can lead to inefficiency for large objects. This chapter shows you how to get the best of both worlds.

    Used widely in frameworks like Apple’s SwiftUI and Vapor, property wrappers are a general-purpose language feature for building reusable, custom logic that defines how a property behaves. This chapter highlights some pitfalls and develops an advanced example implementing the copy-on-write optimization.

    From the standard library to user-authored generics, Swift is a protocol-based language.
    In this chapter, you’ll see how to get all of the benefits associated
    with object-oriented programming while being able to avoid most of the difficulties.

    Learn how to use constraints to make generic code more useful
    and how to hide implementation details with type erasure and
    opaque return types.

    Swift concurrency is a new way to handle asynchronous and concurrent code. It implements structured concurrency and provides language features that check many aspects of your code at compile time. You’ll learn about these mechanisms and how actors protect the shared mutable state of your objects without needing a lot of error-prone, boilerplate code.



    Source link

  • UIKit Apprentice | Kodeco

    UIKit Apprentice | Kodeco


    This book is for anyone completely new to Swift and iOS development — or for those that
    just need a little brushing-up!

    • Working with Xcode
    • Coding in Swift
    • Building user interfaces
    • Modelling and persisting data
    • GPS and image data
    • Accessing remote APIs
    • iPad development
    • Publishing to the App Store

    For Complete Beginners!

    If you’re completely new to Swift and iOS development (or need a brush-up), this is the series for you.
    The UIKit Apprentice is a series of epic-length tutorials for beginners where you’ll learn how to build four complete apps from scratch.
    Each new app will be a…


    more

    This section tells you a few things you need to know before you get started, such as what you’ll need for hardware and software, where to find the project files for this book and more.

    This section introduces you to the first of the four apps you’ll build over the course of this book — Bull’s Eye.

    As you progress through building the Bull’s Eye app, the section will teach you how to think like a programmer and how to plan your programming tasks. In addition, you’ll also learn how to use Xcode, Interface Builder, and even the basics of coding for iOS.

    While some of the concepts in this section might seem a bit basic, please do not skip this section if you are new to iOS development – you will learn some fundamentals which act as the building blocks for what you learn later.

    Welcome to The UIKit Apprentice! In this book, you’re about to deep dive into the latest and greatest Swift and iOS best practices. You will build four iOS projects using Swift and UIKit. Good luck!

    In this chapter, you will start building the initial screen for the Bull’s Eye game.

    Congratulations, you have a UIButton on the screen! It’s time to start adding the UISlider which will be fundamental to the game.

    In this chapter you will deal with random numbers, starting a new round of the game, and calculating the points scored.

    It’s time to calculate and display the score and the number of rounds played in this chapter.

    Add some polish to the game so that it actually looks like a game. Also, allow the user to re-start the game so that two people can play the game.

    Let’s spruce up the game UI with some fancy artwork and make your game stand out from the pack. Also, let’s add an About screen with information about the game.

    Phew! You have successfully created Bull’s Eye. In the final chapter of this section you will learn about supporting different device sizes and add some beautiful animations.

    This section builds upon what you learnt in the previous section by introducing you to your second app. Checklists takes you from a single-screen app to a multi-screen app where you learn the concepts of navigation flow, displaying data lists, and the idea of modeling and persisting your data.

    If you want to build any sort of list-based iOS app, this section is a good starting point for learning the basics. Of course, even if you aren’t building a list-based app, this section has some basic concepts such as handling the navigation flow from one screen to another (and back again) that would be very useful to an apprentice iOS developer.

    Add a table view to show a list of to-do items and in the process learn about how to code navigation controllers and table views for iOS.

    In this chapter, we’ll set up a data model to represent our checklist items and then use the data model to display our to-do items.

    All about navigation controllers — how to add them, configure them, and use them. Also learn how add a new screen to your to-do app and how to add the ability to delete to-do items.

    Create the Add Item screen for your app and in the process, learn how to create custom table view cells, get user input, and add polish to data entry screens.

    You’ll learn about delegates and protocols, and how to use them to complete the add items functionality for your Checklists app.

    Now that you can add items, learn how to edit added items. Also, refactor your code to optimize it.

    Checklists works great but we can’t persist our data — our to-do items are reset each time the app is re-launched. Let’s learn how to persist our data between app sessions.

    From one list to many – Checklists manages a single list of items at the moment. That’s not very useful. Let’s add the ability to have multiple lists of items.

    Let’s improve our data model so that we can have different to-do items for each checklist. We’ll also implement a new saving strategy in the process.

    Learn how to save application settings and other useful information between app sessions. Also, how to guard against possible crashes and to improve the first-run experience of the app so that your app looks more polished and user-friendly.

    With the basic functionality for your Checklists app done, it’s time to add some polish and functionality that makes your app stand out from the herd.

    Learn how to add local notifications to Checklists so that you can be notified when a to-do item is due and how to manage notifications through the lifecycle of a to-do item.

    With this third section and the MyLocations app, you get into Swift programming in earnest.

    Sure, you’ve already coded apps in the previous two sections, but this section starts off with a good review of all the Swift coding principles you’ve learned so far and adds to it by introducing some new concepts too.

    In addition to that, you learn about using GPS coordinates, displaying data on maps, and using the iOS image picker to take photos using your camera or to pick existing images from your photo album. There’s a lot of valuable general information on Swift development as well as specific information about building location-aware apps.

    This section also introduces you to building apps for Dark mode – a subject that you’ll do a deep-dive into in the next section.

    You have made great progress! You’ve learnt the basics of Swift programming and created two applications from scratch. Now let’s add some more Swift theory to strengthen the foundations we’ve built while creting those two apps.

    This is the first chapter in this section which teaches you how to create a “location album” app. Take the first steps for creating this new app by learning how to use the Core Location framework to get your location and to display it.

    You were able to access location data and display it in the last chapter. In this chapter, you will improve upon that code by handling GPS errors and improving the GPS accuracy. You’ll also set up the app to handle different screen sizes.

    Time for some more theory! You’ll learn all about objects, classes, inheritance, and a few other object oriented principles from Swift that you need to be familiar with.

    Time to get back to coding again. You’ll learn how to build the Tag Location screen and how to set up another data entry screen for an iOS app.

    The MyLocations app functionality is slowly taking shape now. So it’s time to polish things up a bit by improving the user experience and adding some UI flourishes.

    Learn all about how to save your locations on the device using Core Data, the object persistence framework for iOS.

    Let’s show the data that you’re now able to save via Core Data as a list of locations. Learn about TableView sections, NSFetchedResults and deleting tagged locations.

    Let’s get visual! Show your tagged location on a map view using MapKit so that you can see where in the world each location is.

    Learn how to use the built-in image picker in iOS to add images from either the camera or the photo album to your tagged locations.

    It’s time to give MyLocations a complete visual makeover! You’ll change the styling for the app, add buttons for action items, add sounds, icons, and launch images.

    The final section of the book covers building an app which supports both Light and Dark appearances from scratch via the StoreSearch app. StoreSearch shows you how to have separate custom assets and colors for each type of iOS appearance.

    But that’s not all! The app also shows you how to do custom screens both for specific orientations (landscape vs. portrait) as well as for specific platforms (iPhone vs. iPad). This section covers networking, working with remote API endpoints to fetch data needed by your app, and how to parse the fetched data, how to work with Stack Views, and how to add iPad support to your app.

    If that wasn’t enough, this section also takes you through the full application life cycle – from developing the code, testing it, and all the way to submitting to Apple. So don’t skip this section thinking that you know all about iOS development after the last few sections!

    Most iOS job listings say that you need to have worked with a REST API. Well, this chapter starts you on a new app which will teach you all about how to fetch data from a remote server and get you on the path to REST API mastery.

    Learn how to display your data in a table view using custom table cells. Also change the appearnace of the app and do a bit of debugging.

    Learn the ins and outs of making network requests to remote servers. Then, when you get a response to your request, learn how to parse the JSON response.

    Learn why synchronous networking is bad and how to make things better by switching to asynchronous networking.

    Learn about the powerful networking features provided by URLSession to make network requests that can be cancelled and how to download the image assets for your search results.

    Learn how to add a detail pop-up to show more information about selected search results.

    The detail pop-up works well but it can do with some more spit and polish to make it really shine. Learn all about adding dynamic type support, gradient backgrounds and more animations.

    You’ve only dealt with a single orientation up to now. But your apps need to support both portrait and landscape orientations. Learn how to add landscape support to StoreSearch and by adding a custom interface.

    You’ve made great progress with StoreSearch, but now it’s time to refactor the code to smooth out a few of the rough edges. Knowing how to improve your code by refactoring it is an important skill to learn.

    StoreSearch works great when the display language is English. But what if you wanted to support other languages? Learn all about internationalization and how to update your app to suppport multiple languages.

    Learn how to optimize StoreSearch for iPad and to add iPad specific UI features such as split view conrollers and menu popovers.

    After all that work, your app is finally ready. You just have one more gauntlet to run – the App Store submission process. Learn about the Apple Developer program, beta testing via TestFlight and how to submit your app for Apple approval.



    Source link

  • Swift Apprentice: Fundamentals | Kodeco

    Swift Apprentice: Fundamentals | Kodeco


    This is a book for complete beginners to Apple’s modern programming language — Swift.

    All the code in the book works inside of Xcode’s easy-to-use playgrounds.
    That means you can focus on core Swift language concepts, such as classes, protocols,
    and generics, instead of getting bogged down in the details of building apps.

    This is a companion book to the SwiftUI Apprentice;
    the SwiftUI Apprentice focuses on building apps, while Swift Apprentice focuses
    on the Swift language itself.

    This is a book for complete beginners to Apple’s modern programming language — Swift.

    All the code in the book works inside of Xcode’s easy-to-use playgrounds. That means you can focus on core Swift language concepts, such as classes, protocols, and generics without getting bogged down by extraneous details.

    This…


    more

    This section tells you a few things you need to know before you get started, such as what you’ll need for hardware and software, where to find the project files for this book and more.

    The chapters in this section will introduce you to the very basics of programming in Swift. From the fundamentals of how computers work up to language structures, you’ll cover enough of the language to be able to work with data and organize your code’s behavior.

    The section begins with some groundwork to get you started.
    Once you have the basic data types in your head, it’ll be time to do things with that data, and finally, you’ll learn about an essential data type, optionals, that let you express potentially missing data.

    These fundamentals will get you Swiftly on your way, and before you know it, you’ll be ready for the more advanced topics that follow. Let’s get started!

    This is it, your whirlwind introduction to the world of programming! You’ll begin with an overview of computers and programming and then say hello to Swift playgrounds, where you’ll spend your coding time for the rest of this book.
    You’ll learn some basics, such as code comments, arithmetic operations, constants and variables. These are some of the fundamental building blocks of any language, and Swift is no different.

    You’ll learn about handling different types, including strings that allow you to represent text.
    You’ll learn about converting between types and get an introduction to type inference, which simplifies your life as a programmer.
    You’ll learn about tuple types which allow you to group values of any type together.

    You’ll learn how to make decisions and repeat tasks in your programs using syntax to control the flow.
    You’ll also learn about Booleans, which represent true and false values, and how you can use these to compare data.

    Continuing the theme of code not running in a straight line, you’ll learn about another loop known as the `for` loop. You’ll also learn about switch statements that are particularly powerful in Swift.

    Functions are the basic building blocks you use to structure your code in Swift. You’ll learn how to define functions to group your code into reusable units.

    This chapter covers optionals, a special type in Swift representing either a value or the absence of a value. By the end of this chapter, you’ll know why you need optionals and how to use them safely.

    So far, you’ve mostly seen data in the form of single elements. Although tuples can have multiple pieces of data, you have to specify the size upfront; a tuple with three strings is a completely different type from a tuple with two strings, and converting between them isn’t trivial. In this section, you’ll learn about collection types in Swift. Collections are flexible “containers” that let you store any number of values together.

    There are several collection types in Swift, but three important ones are arrays, dictionaries and sets. You’ll learn to apply custom operations and loop over collection types. Finally, you’ll revisit strings, which are collections of characters.

    All the collection types share similar interfaces but have very different use cases. As you read through these chapters, keep the differences in mind, and you’ll begin to develop a feel for which type you should use when.

    Arrays are the most common collection type you’ll run into in Swift that keep an ordered list of elements of the same type. On the other hand, Dictionaries let you look up elements efficiently using a key. Finally, Sets maintain an unordered collection of unique elements. You’ll learn all about these three types in this chapter.

    Once you have collections of items, you will want to perform operations with them.
    For example, sort them, filter them, add them up, etc. Swift gives you a powerful
    language construct, the closure, that lets you infinitely customize the behavior
    of such operations. In this chapter, you will learn about Swift’s most common
    collection algorithms and customize them with closures.

    Text processing is an essential application for any computer language, and String is Swift’s powerhouse type for text handling. Strings are bi-directional collections of Character types that balance correctness, performance and ease of use.

    Searching for patterns in text is a common task you’ll encounter in your programming travels. Swift provides a power type called Regex to perform that task. Using standard syntax, you can express complicated matching patterns to extract information from text. You can use an all-new regex builder syntax for improved compile-time support, which maximizes clarity and readability.

    You can create your own type by combining variables and functions into a new type definition. When you create a new type, you give it a name; thus, these custom types are known as named types. Structures are a powerful tool for modeling real-world concepts. You can encapsulate related concepts, properties and methods into a single, cohesive model.

    Swift includes four kinds of named types: structures, classes, enumerations and protocols. You’ll learn here how other named types use the concepts of methods and properties, how they differ, and where you want to use each.

    You’ll also learn about protocols & generics, which are types and methods that take as input other types instead of just methods, as well as custom types to build larger and complex things!

    The standard library has many useful types like Int, Double and String. However, it sadly does not include a Pizza type. Structures are types that can store named properties and define actions and behaviors. In this chapter, you will define your custom structure types and begin building a Pizza empire.

    In this chapter, you’ll learn about stored and computed properties, along with some tricks, such as how to monitor changes in a property’s value and delay the initialization of a stored property.

    Methods are merely functions that reside in a structure. You’ll look closely at how methods and initializers help you build full-featured, custom types.

    Structures let you define your own named types with custom properties and methods. In this chapter, you’ll get acquainted with classes, which are much like structures but have important differences that make them an invaluable addition to your toolbox.

    This chapter continues with class types describing how Swift supports the traditional concepts of inheritance and polymorphism. You will also learn about two-phase class initialization that you will need to build proper class hierarchies. This discussion will lay the foundation for using these concepts with Swift’s value types.

    In this chapter, you’ll learn about enumerations, a type that groups related, mutually exclusive case values. You’ll also learn about uninhabited types and finally discover what an optional is under the hood.

    Protocols are a type that can bridge common behaviors between structs,
    classes, and enums by defining an interface or template for an actual concrete type. Protocols enable polymorphism across all types and overcome the single inheritance limitation you saw with classes.

    In this chapter, you’ll learn what generics are, how to write generic code, and loop back and look at the generic types in Swift – dictionaries, arrays, and optionals – from this new perspective.



    Source link

  • SwiftUI Apprentice | Kodeco

    SwiftUI Apprentice | Kodeco


    SwiftUI Apprentice is a series of epic-length tutorials where you’ll learn to build three complete apps from scratch,
    using Apple’s new user interface technology: SwiftUI! Each app is more advanced than the one before, and together,
    they cover everything to make your own apps using SwiftUI. By the end of the book, you’ll be experienced enough
    to turn your ideas into real apps you can sell on the App Store. These tutorials have easy to follow step-by-step
    instructions and consist of more than pages and illustrations! You also get full
    source code, image files, and other resources you can re-use for your own projects.

    If you’re new to iOS and Swift, or to programming in general, learning how to write an app can seem incredibly overwhelming.
    That’s why you need a guide that:

    • Shows you how to write an app step-by-step.
    • Uses tons of illustrations and screenshots to make everything clear.
    • Guides you in a fun and easy-going manner.

    You’ll start at the very beginning. The first section assumes you have little to no knowledge of programming in Swift for iOS but still
    shows you how to build an entire fitness app from scratch using SwiftUI.
    SwiftUI Apprentice doesn’t cover every single feature of iOS; it focuses on the absolutely essential ones.
    Instead of just covering a list of features, SwiftUI Apprentice does something much more important: It explains how all the
    building blocks fit together and what is involved in building real apps. You’re not going to create quick example programs that
    demonstrate how to accomplish a single feature. Instead, you’ll develop complete, fully-formed apps, with beautiful,
    professionally-designed user interfaces, that are good enough to submit to the App Store!

    How is this book different than SwiftUI by Tutorials?

    Our other book on building apps with SwiftUI, SwiftUI by Tutorials, is designed for developers who have a solid background in iOS development and are looking to make the leap from building apps with UIKit, to building apps with SwiftUI.

    This book, SwiftUI Apprentice, is designed to teach new developers how to build iOS apps, using a SwiftUI-first approach. Its goal is to teach you fundamental development practices as you build out some fully-functional and great-looking apps!



    Source link

  • macOS Apprentice | Kodeco

    macOS Apprentice | Kodeco


    macOS Apprentice is a series of multi-chapter tutorials where you’ll learn about developing native
    macOS apps in Swift, using both SwiftUI — Apple’s newest user interface technology — and AppKit — the
    venerable UI framework. Along the way, you’ll learn several ways to execute Swift code and you’ll build
    two fully featured apps from scratch.

    If you’re new to macOS and Swift, or to programming in general, learning how to write an app can seem
    incredibly overwhelming.

    That’s why you need a guide that:

    • Shows you how to write an app step-by-step.
    • Uses tons of illustrations and screenshots to make everything clear.
    • Guides you in a fun and easy-going manner.

    You’ll start at the very beginning. The first section assumes you have little to no knowledge of programming in Swift.
    It walks you through installing Xcode and then teaches you the basics of the Swift programming language. Along the way,
    you’ll explore several different ways to run Swift code, taking advantage of the fact that you’re developing natively
    on macOS.

    macOS Apprentice doesn’t cover every single feature of macOS; it focuses on the absolutely essential ones.
    Instead of just covering a list of features, macOS Apprentice does something much more important: It explains how all the
    building blocks fit together and what is involved in building real apps. You’re not going to create quick example programs that
    demonstrate how to accomplish a single feature. Instead, you’ll develop complete, fully-formed apps, while exploring many of
    the complexities and joys of programming macOS.

    How is this book different than macOS by Tutorials?

    Our other book on building apps for macOS, macOS by Tutorials, is designed
    for developers who have a solid background in iOS development and are looking to make the leap to developing native macOS apps.

    This book, macOS Apprentice, is designed to teach new developers how to build macOS apps while assuming they have little to
    no experience with Swift or any other part of the Apple development ecosystem.



    Source link

  • Git Apprentice [SUBSCRIBER]

    Git Apprentice [SUBSCRIBER]



    <h2>Learn Git!</h2>
    <p>Chances are if you’re involved with software development you’ve heard of and have used <a href="https://git-scm.com/">Git</a> at some point in your life. Version control systems are critical for any successful collaborative software project. Git is both simple to start using and accommodating for the most complex tasks with version control. Even seasoned Git users hit roadblocks on how to handle common situations.</p>
    <p>Git Apprentice is here to help! This book is the easiest and fastest way to get hands-on experience with using Git for version control of your projects.</p>
    <h3>Who This Book Is For</h3>
    <p>This book is for anyone who would like to leverage the power of version control with Git in their software development process. The book starts with a gentle introduction to Git. It then moves on to walk you through creating a new repository, cloning an existing one, merging in changes, and all of the bits in between.</p>
    <h3>Topics Covered in Git Apprentice</h3>
    <ul>
    <li>A Crash Course in Git: Learn how to get started with Git, the differences between platforms, and a quick overview of the typical Git workflow.</li>
    <li>Cloning a Repo: Discover how to clone a remote repo to your local machine, and what constitutes “forking” a repository.</li>
    <li>Git Log &amp; History: You’ll discover the versatility of the git log command—displaying branches, graphs and even filtering the history.</li>
    <li>Creating a Repository: If you are starting a new project, and want to use Git for source control, you first need to create a new repository.</li>
    <li>And more!</li>
    </ul>
    <p>One thing you can count on: after reading this book, you’ll be well-prepared to use Git in your own software development workflow!</p>



    Source link