Swift Development Learning (ii): Playground

Source: Internet
Author: User

http://blog.csdn.net/powerlly/article/details/29674253

Swift Development Learning: Playground

About

For software users, gamers, people have been advocating the user experience. In fact, the software developers themselves are users, is the user of various development tools, will also like the user experience to do a good tool software. This time, Apple wants developers to think of a playground--playground that can be played with Swift, which provides a convenient and fun development.

Please keep this link for the original power reprint.

What can playground do?

    1. Quick Practice Swift
      Do not need to compile, do not need to click to execute, write code directly see the effect
      Is it easier than scripting language?
      Developers can quickly get grammar experiments, API calls, and so on through Playgroud.

      Swift Tour Code GIT: Swifttour.playground

    2. Visual program Logic
      Playground not only provides static variables for immediate viewing, but also shows values that change over time.

      , with the two buttons in the upper right corner, you can switch between two edits of playground to try to
      • Standard Editor instantly displays variable values
      • Assistant Editor to display variable values on the timeline, or to customize the display
      Assistant mode is important for developers to verify program logic:
      • No longer need to step through breakpoint debugging
      • Output log check is no longer required
      • Not only can the numerical curve be displayed, but also the graphic image can be displayed
    3. Custom display
      Developers can expand the dynamic display interface as needed to display the program in their own way.
      As shown on the WWDC2014:

      Playgroundiconview code GIT: Playgroundiconview.playground

What are the shortcomings of playground

    1. Playground temporarily does not support interface interaction
      You can't play the game you developed in playground.
    2. Playground not emulator cannot execute app

Last question

Read the last Article Swift Development Study (a): the students in the initial chapter may still be thinking about my question.

As you may have learned from this article: Playground provides the ability to display results instantly, and is a development aid. But how to make playground in the development of debugging programs directly applied to the project, copy the code or other better way?

Question: So far I've been learning a little bit and haven't learned how to "include" another Swift in Main.swift. Who can tell me?

If this is solved, Playgroud can be reused once, there is a picture of the truth:

You know!

Please keep this link for the original power reprint.

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

Swift Development Learning (ii): Playground

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.