Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikibooksThe Free Textbook Project
Search

Programming Fundamentals/Introduction Examples Swift

From Wikibooks, open books for an open world
<Programming Fundamentals
Thelatest reviewed version waschecked on3 November 2022. There aretemplate/file changes awaiting review.

Overview

[edit |edit source]

Swift is a general-purpose, multi-paradigm, compiled programming language developed by Apple Inc. for iOS, macOS, watchOS, tvOS, and Linux. Apple intended Swift to support many core concepts associated with Objective-C, but in a “safer” way, making it easier to catch software bugs. Swift was introduced in 2014.[1]

Swift is a popular programming language for the Apple platforms it supports, but it lacks support for Microsoft Windows environments.TIOBE: Index.

Example

[edit |edit source]

Hello World

[edit |edit source]
// This program displays "Hello world!"//// References:// https://developer.apple.com/library/content/documentation/Swift/Conceptual/Swift_Programming_Language/GuidedTour.htmlprint("Hello world!")

Output

[edit |edit source]
Hello world!

Discussion

[edit |edit source]

Each code element represents:Programming Fundamentals/Hello World

  • // begins a comment
  • print() calls the print function
  • "Hello world!" is the literal string to be displayed

Swift IDEs

[edit |edit source]

There are several free cloud-based and local IDEs available to begin coding in Swift. Check with your instructor or do your own research for recommendations.

Cloud-Based IDEs

[edit |edit source]

Local IDEs

[edit |edit source]

References

[edit |edit source]
  1. Wikipedia: Swift (programming language)
← Introduction Examples Python
Programming Fundamentals
Practice: Introduction to Programming →
Retrieved from "https://en.wikibooks.org/w/index.php?title=Programming_Fundamentals/Introduction_Examples_Swift&oldid=4199075"
Category:
Hidden category:

[8]ページ先頭

©2009-2025 Movatter.jp