Questions Columns Rows
GitHub icon

Swift

Swift - Programming language

< >

Swift is an open source programming language created in 2014 by Chris Lattner.

Source code:
git clone https://github.com/apple/swift
#21on PLDB 9Years Old 1mRepos

Try now: RijuReplit

Swift is a general-purpose, multi-paradigm, compiled programming language developed by Apple Inc. for iOS, macOS, watchOS, tvOS, and Linux. Swift is designed to work with Apple's Cocoa and Cocoa Touch frameworks and the large body of existing Objective-C (ObjC) code written for Apple products. Read more on Wikipedia...


Example from Compiler Explorer:
// Type your code here, or load an example. func square(n: Int) -> Int { return n * n }
Example from Riju:
print("Hello, world!")
Example from hello-world:
print("Hello World")
// Hello world in Swift println("Hello, world!")
Example from Linguist:
println("Hello, world")
Example from Wikipedia:
var someSortOfPrintableObject: SupportsToString ... print(someSortOfPrintableObject.toString())
Swift Keywords
associatedtype class deinit enum extension func import init inout internal let operator private protocol public static struct subscript typealias var break case continue default defer do else fallthrough for guard if in repeat return switch where while as catch dynamicType false is nil rethrows super self Self throw throws true try #column #file #function #line #available #column #else#elseif #endif #file #function #if #line #selector associativity convenience dynamic didSet final get infix indirect lazy left mutating none nonmutating optional override postfix precedence prefix Protocol required right set Type unowned weak willSet

View source

- Build the next great programming language Search Add Language Features Creators Resources About Blog Acknowledgements Stats Sponsor Traffic Traffic Today Day 267 feedback@pldb.com Logout