Swift

Swift
Photo by Jessy Smith / Unsplash

Swift is a powerful and intuitive programming language created by Apple for building apps across all Apple platforms (iOS, macOS, watchOS, and tvOS) and beyond. It was introduced in 2014 as an open-source replacement for Objective-C, offering modern features which are safer, faster, and more efficient.

Technology

I will cover these technologies from Swift frameworks with examples on how I use them in my application integration efforts.

  • Foundation: I will highlight key data types and operations in the core Foundation framework that I use in my applications.
  • User interface: I will be developing SwiftUI user interfaces for applications on macOS, iOS, iPadOS, and watchOS. These are the preferred technologies over traditional UIKit (iOS) and AppKit (macOS) user interface frameworks.
  • Databases: I will use SwiftData to provide database persistence in Swift applications. This integrates the existing Core Data framework for SwiftUI apps.
  • Networking: Using the built-in networking framework for URLSession, as well as the popular Alamofire library package.
  • Data formats: I will cover parsing JSON data with the native Codable protocol, as well as popular packages like SwiftyJSON. Also, I will include examples to import/export other data formats like CSV.

Tools

I will cover useful tips and techniques that I have found helpful while developing applications with Apple technologies.

  • Testing: I include the Apple native testing framework (XCTest) test case examples in various application examples to demonstrate and test functions.
  • Xcode: Apple's integrated development environment (IDE) for Swift development.
  • Swift Playgrounds: Interactive environment for learning and experimenting with Swift code.

Packages

Swift uses the Swift Package Manager (SPM) for distributing libraries and code. It allows developers to easily share and reuse code across projects.

Extensions

While primarily used for applications on Apple platforms, Swift can also be used for developing Windows apps, Swift servers, or commands.

  • Windows: The Browser Company extended the open-source Swift language for Windows development, which is used as the foundation for Arc browser on macOS, iOS. and now Windows.
  • Server-side development: Frameworks like Vapor enable server-side Swift programming.
  • Cross-platform command-line tools: Swift can be used to create tools that run on multiple platforms.

Shortcuts

These are some topics for my Swift efforts.

  • Shortcuts: Create Shortcuts that integrate actions from multiple applications to streamline and automate my workflows.
  • App Intents: Create shortcut actions with the App Intents framework that expose selected functionality for integration with other applications.
  • Commands: Develop Swift command-line tools for integration in Shortcuts and shell scripts.
  • Widgets: Using widgets for my shortcuts on macOS and iOS.

Reader API

I am developing a Swift application for macOS and iOS with a SwiftUI user interface and SwiftData database that uses the Reader API.

This will provide an interesting way to explore various Swift features while demonstrating how it can be applied to integrating Reader with Obsidian along with Shortcuts and Actions for Obsidian.