https://aws.amazon.com/blogs/developer/announcing-new-aws-sdk-for-swift-alpha-release/ Click here to return to Amazon Web Services homepage Contact Us Support English My Account Create an AWS Account * Products * Solutions * Pricing * Documentation * Learn * Partner Network * AWS Marketplace * Customer Enablement * Events * Explore More [ ] * `rby * Bahasa Indonesia * Deutsch * English * Espanol * Francais * Italiano * Portugues * Tieng Viet * Turkce * Russkii * aithy * Ri Ben Yu * hangugeo * Zhong Wen (Jian Ti ) * Zhong Wen (Fan Ti ) * AWS Management Console * Account Settings * Billing & Cost Management * Security Credentials * AWS Personal Health Dashboard * Support Center * Knowledge Center * AWS Support Overview Click here to return to Amazon Web Services homepage [ ] * Products * Solutions * Pricing * Introduction to AWS * Getting Started * Documentation * Training and Certification * Developer Center * Customer Success * Partner Network * AWS Marketplace * Support * Log into Console * Download the Mobile App Blog Home Category Edition Follow [ ] Architecture AWS Cost Management AWS Partner Network AWS Podcast AWS Marketplace AWS News Big Data Business Productivity Compute Contact Center Containers Database Desktop & Application Streaming Developer DevOps Enterprise Strategy Front-End Web & Mobile Game Tech HPC Infrastructure & Automation Industries Internet of Things Machine Learning Management & Governance Media Messaging & Targeting Networking & Content Delivery Open Source Public Sector Quantum Computing Robotics SAP Security, Identity, & Compliance Startups Storage Training & Certification Windows on AWS Zhong Guo Ban Edition Francaise Deutsche Edition Ri Ben Ban hangug edisyeon Edicao em Portugues Edicion en Espanol English Edition Versiia na russkom Edisi Bahasa Indonesia Mailing List AWS Developer Tools Blog Announcing new AWS SDK for Swift alpha release by Nicki Stone and John Woo | on 30 AUG 2021 | in Announcements, Developer Tools, Open Source | Permalink | Comments | Share * * * * * [https://aws.amazon.c] We're excited to announce the alpha release of the new AWS SDK for Swift. Since 2010, AWS Mobile has provided customers with an iOS SDK, written in Objective C. While this SDK has served the iOS community for over a decade, the Swift community has grown in size and expanded to other platforms such as Linux, macOS, Windows, tvOS, watchOS, etc. AWS customers developing in Swift have asked for a native Swift SDK so they can use the language constructs they are used to. Additionally, customers new to Swift and running Swift server side want an SDK that behaves similarly to SDKs they have used in other language environments. With this alpha release, customers can try clients for all of the supported AWS services and provide feedback on ergonomics and usability. Before we get into the details, it would be remiss of us not to acknowledge the enormous amount of work the community has put in to maintaining not one but two Swift AWS SDKs. On behalf of AWS, I'd like to thank all the maintainers and contributors to the Soto SDK and the AWS Smoke SDK. The AWS Smoke SDK was developed by the Amazon Prime Video Team and will be migrating to the new AWS SDK for Swift. Simon Pilkington, the lead maintainer of the AWS Smoke SDK and a Senior Software Engineer on the Amazon Prime Video Team, tried out the new AWS SDK for Swift and said "Using the Swift programming language has already given our team high developer velocity and strong compiler guarantees that eliminate common programming bugs before they hit production. By providing high quality, best-in-class clients -- with strong DNA from previous development -- out of the box and fully supported, this new AWS Swift SDK will allow us to focus on our business logic and go even faster." Our primary design goal for this SDK is to provide platform-agnostic idiomatic Swift interfaces to all supported AWS Service APIs and provide new AWS service APIs when they launch. Similar to other recently launched AWS SDKs, we used the Smithy toolchain and service models to build the new open source AWS SDK for Swift. In addition to enabling the use of new services on Day 1, this SDK contains features to create greater reliability and consistency in the developer experience. It already includes AWS standard retry logic and consistent credential provider support similar to other AWS SDKs. The AWS SDK for Swift alpha release we are launching today allows you to build clients for any of supported AWS Service. Some service clients require additional modification from the SDK team and we're working to identify and implement these as quickly as possible. We are releasing the alpha version of the SDK to get your feedback early and incorporate your input into the design and implementation of this SDK. We are sharing our roadmap, which outlines the plan for adding features and customizations for specific AWS services to improve functionality. We would love to hear your thoughts on what features and services are most important to you via GitHub Issues and Discussions. As the SDK approaches its General Availability launch, we will provide documentation for migrating from the iOS SDK, the Smoke SDK, or the Soto SDK to the new SDK. We will support the SDK following our standard maintenance policy at the GA launch. Without further ado, let's see the SDK in action! Getting Started with the SDK During the alpha, you can consume the SDK via tags using the Swift Package Manager. Here's an example of how to get started with the new AWS SDK for Swift, using Amazon CognitoIdentity to perform a common operation. This example assumes you already have the Swift toolchain or Xcode 12.5+ installed. As an example, we will walk you through how you can use Amazon CognitoIdentity as a dependency in the steps below. To use it, we will create a test project called "TestCognitoSdk". mkdir TestCognitoSdk cd TestCognitoSdk swift package init --type executable xed . Once Xcode is open, open Package.swift. Update the file to mirror the following based on the version of Swift you are using. For Swift 5.5+ users: // swift-tools-version:5.5 // The swift-tools-version declares the minimum version of Swift required to build this package. import PackageDescription let package = Package( name: "TestCognitoSdk", platforms: [.macOS("12"), .iOS("15")], dependencies: [ .package(name: "AWSSwiftSDK", url: "https://github.com/awslabs/aws-sdk-swift", from: "0.0.8"), ], targets: [ // Targets are the basic building blocks of a package. A target can define a module or a test suite. // Targets can depend on other targets in this package, and on products in packages this package depends on. .executableTarget( name: "TestCognitoSdk", dependencies: [.product(name: "CognitoIdentity", package: "AWSSwiftSDK")]), .testTarget( name: "TestCognitoSdkTests", dependencies: ["TestCognitoSdk"]), ] ) For Swift <5.5 users: // swift-tools-version:5.4 // The swift-tools-version declares the minimum version of Swift required to build this package. import PackageDescription let package = Package( name: "TestCognitoSdk", platforms: [.macOS(.v10_15), .iOS(.v13)], dependencies: [ .package(name: "AWSSwiftSDK", url: "https://github.com/awslabs/aws-sdk-swift", from: "0.0.8"), ], targets: [ // Targets are the basic building blocks of a package. A target can define a module or a test suite. // Targets can depend on other targets in this package, and on products in packages this package depends on. .target( name: "TestCognitoSdk", dependencies: [.product(name: "CognitoIdentity", package: "AWSSwiftSDK")]), .testTarget( name: "TestCognitoSdkTests", dependencies: ["TestCognitoSdk"]), ] ) In your main.swift you can now drop in the one of the following snippets below depending on which platform you are running on and which version of Swift. // For Swift 5.5+ users import CognitoIdentity func createIdentityPool() async throws -> CreateIdentityPoolOutputResponse { let cognitoIdentityClient = try CognitoIdentityClient(region: "us-east-1") let cognitoInputCall = CreateIdentityPoolInput(developerProviderName: "com.amazonaws.mytestapplication", identityPoolName: "identityPoolMadeWithSwiftSDK") let result = try await cognitoIdentityClient.createIdentityPool(input: cognitoInputCall) return result } //For Swift <5.5 import CognitoIdentity do { let cognitoIdentityClient = try CognitoIdentityClient(region: "us-east-1") let cognitoInputCall = CreateIdentityPoolInput(developerProviderName: "com.amazonaws.mytestapplication", identityPoolName: "identityPoolMadeWithSwiftSDK") cognitoIdentityClient.createIdentityPool(input: cognitoInputCall) { result in switch(result) { case .success(let output): print("\(output)") case .failure(let error): print("\(error)") } } } catch let err { print(err) } As a result, you should be able to: 1. Log into your AWS console, go to us-east-1 2. Click on Cognito 3. click on Cognito Identity Pools 4. Verify that you see the newly created identity pool name: identityPoolMadeWithSwiftSDK If you've made it this far... Congrats!? What's next? Try some other calls? Help us better understand what you think the most critical features are next. Run into any bugs? Open a Github issue and let us know. Contributing to the SDK's development Make sure to check out the contributing guide to get the latest information. Here's how you can help and provide feedback: * Try out the SDK and let us know what to improve. For the services the SDK supports, let us know if you run into any issues by submitting a GitHub Issue or starting a GitHub Discussion. Also, be sure to add your comments and "+1"s to GitHub Issues that have already been submitted to help us prioritize and plan effectively. * Report defects. Inevitably, we expect there to be bugs in this alpha release. If you find one, let us know by submitting a GitHub Issue. * Review the docs. The guide content is at a very early stage and more will be coming soon but it is essential the SDK docs are clear, accurate and up to date so everyone can successfully use the SDK. If you find an issue with the documentation, open an issue, or even better, submit a PR. * Request for Comments (RFCs). We are adding RFCs to the repo to propose major changes to the SDK. We will continually add more as we develop the SDK. Please review them, let us know what you think, and feel free to add your own! * Help us prioritize high level libraries. Beyond the core SDK, high level libraries built on top of the SDK (like the S3 Encryption Client or the DynamoDB Mapper) make some AWS services easier to use. Let us know which libraries are most important to you via a Github Discussion. The SDK's Public Roadmap The AWS SDK for Swift currently provides support for retries and credential providers and will be adding more features like pagination and waiters. You can find the complete list of the AWS services the SDK currently supports in our GitHub repository. You can follow our plans to add support for features and service customizations by reviewing our public roadmap on GitHub. The purpose of the roadmap is to keep the community informed about what's coming. We will keep this roadmap up to date with the team's progress. Please add a "+1" to features most important to you. Your votes will help us prioritize our roadmap. Give it a Try! The getting started guide is a great place to start using the SDK. Check it out and let us know what do you think! We're Hiring The AWS SDK for Swift team is hiring. If you'd like to join, please review the open positions on our team. Authors Nicki Stone: Nicki has worked at AWS since 2018, and most recently helped build Amplify Predictions for iOS prior to working on the AWS SDK for Swift. TAGS: aws-sdk, SDK, Swift View Comments Resources Developer Resources & Community Open Source Repos Twitch Live Coding Labs on Github --------------------------------------------------------------------- Follow Instagram Reddit Twitter Facebook LinkedIn Twitch Email Updates Sign In to the Console Learn About AWS * What Is AWS? * What Is Cloud Computing? * AWS Inclusion, Diversity & Equity * What Is DevOps? * What Is a Container? * What Is a Data Lake? * AWS Cloud Security * What's New * Blogs * Press Releases Resources for AWS * Getting Started * Training and Certification * AWS Solutions Portfolio * Architecture Center * Product and Technical FAQs * Analyst Reports * AWS Partner Network Developers on AWS * Developer Center * SDKs & Tools * .NET on AWS * Python on AWS * Java on AWS * PHP on AWS * Javascript on AWS Help * Contact Us * AWS Careers * File a Support Ticket * Knowledge Center * AWS Support Overview * Legal Create an AWS Account Amazon is an Equal Opportunity Employer: Minority / Women / Disability / Veteran / Gender Identity / Sexual Orientation / Age. * Language * `rby * Bahasa Indonesia * Deutsch * English * Espanol * Francais * Italiano * Portugues * Tieng Viet * Turkce * Russkii * aithy * Ri Ben Yu * hangugeo * Zhong Wen (Jian Ti ) * Zhong Wen (Fan Ti ) * Privacy * | * Site Terms * | * Cookie Preferences * | * (c) 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.