Differences
This shows you the differences between two versions of the page.
Previous revision | |||
— | dev:swift [2023/05/01 17:29] (current) – [SwiftUI] Henrik Yllemo | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | <button type=" | ||
+ | <nav type=" | ||
+ | * [[: | ||
+ | * [[: | ||
+ | * [[: | ||
+ | * [[: | ||
+ | * [[:kb:ios]] | ||
+ | * [[: | ||
+ | </ | ||
+ | ====== Swift ====== | ||
+ | Swift is a general-purpose, | ||
+ | <data programminglanguage> | ||
+ | Full Name: Swift | ||
+ | Short Name: Swift | ||
+ | Description: | ||
+ | Company: Apple Inc | ||
+ | Web: Yes | ||
+ | Mobile: Yes | ||
+ | Enterprise: Yes | ||
+ | Embedded : Yes | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | <panel title=' | ||
+ | Swift is a programming language developed by Apple for building applications for iOS, macOS, watchOS, and tvOS. Swift was designed to be fast, safe, and easy to use, and it is intended to replace Objective-C as the primary programming language for Apple' | ||
+ | </ | ||
+ | Swift can be used to build applications for iOS, macOS, watchOS, and tvOS. In addition, Swift can also be used to build server-side applications using frameworks such as Vapor and Kitura. | ||
+ | </ | ||
+ | Some of the key features of Swift include: | ||
+ | * Optionals: a way of handling values that may be missing | ||
+ | * Generics: a way of writing reusable code that can work with different types | ||
+ | * Closures: a way of writing code that can be passed around and executed at a later time | ||
+ | * Type inference: a way of allowing the compiler to infer the type of a variable based on its value | ||
+ | * Automatic memory management: a way of managing memory automatically so that you don't have to worry about deallocating objects manually | ||
+ | </ | ||
+ | Yes, Swift was open sourced by Apple in 2015, and it is now maintained by the Swift community as well as Apple. The Swift source code is available on GitHub. | ||
+ | </ | ||
+ | Some popular frameworks and libraries for Swift include: | ||
+ | * SwiftUI: a framework for building user interfaces for iOS, macOS, watchOS, and tvOS | ||
+ | * Combine: a framework for handling asynchronous events and data streams | ||
+ | * Alamofire: a library for handling network requests and responses | ||
+ | * Kingfisher: a library for downloading and caching images | ||
+ | * Realm: a database framework for iOS, macOS, watchOS, and tvOS | ||
+ | </ | ||
+ | Yes, you can use Swift and Objective-C together in the same project, and you can call Objective-C code from Swift and vice versa. This makes it easy to adopt Swift gradually in existing projects that use Objective-C. | ||
+ | </ | ||
+ | |||
+ | |||
+ | |||
+ | {{wp> | ||
+ | <callout type="" | ||
+ | * https:// | ||
+ | |||
+ | Swift is a general-purpose programming language built using a modern approach to safety, performance, | ||
+ | </ | ||
+ | |||
+ | <callout type="" | ||
+ | * [[https:// | ||
+ | * [[https:// | ||
+ | * [[https:// | ||
+ | * [[https:// | ||
+ | * [[https:// | ||
+ | <WRAP column right>< | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | ===== Hello World ===== | ||
+ | |||
+ | <sxh > | ||
+ | | ||
+ | |||
+ | | ||
+ | </ | ||
+ | <WRAP column right>< | ||
+ | </ | ||
+ | |||
+ | |||
+ | ==== SwiftUI ==== | ||
+ | As of 2019, with Xcode 11, Apple has added a major new UI paradigm called **[[SwiftUI]]**. [[SwiftUI]] replaces the older Interface Builder paradigm with a new declarative development paradigm. | ||
+ | |||
+ | * https:// | ||
+ | |||
+ | See also: [[dev: | ||
+ | |||
+ | |||
+ | {{tag> | ||
+ | |||
+ | === ## ToDo ## === | ||
+ | * FIXME | ||
+ | * Optionals | ||
+ | * Control structures | ||
+ | * Functions | ||
+ | * Closures | ||
+ | * Object-oriented programming (OOP) | ||
+ | * Classes | ||
+ | * Inheritance | ||
+ | * Polymorphism | ||
+ | * Protocols | ||
+ | * Extensions | ||
+ | * Generics | ||
+ | * Error handling | ||
+ | * Defer statements | ||
+ | * Memory management | ||
+ | * ARC (Automatic Reference Counting) | ||
+ | * Properties | ||
+ | * Access control | ||
+ | * Structs | ||
+ | * Enums | ||
+ | * Initializers | ||
+ | * Control flow statements | ||
+ | * Collection types | ||
+ | * iOS development | ||
+ | * SwiftUI framework | ||
+ | * Combine framework | ||