Posted on Leave a comment

Developer Spotlight: Cone

As a student in India, Kushagra Agarwal’s favorite subject had always been art, until he started having difficulty identifying the color brown. By sixth grade, dark green, red, and brown became almost indistinguishable to him.

As he grew older, Agarwal was disappointed by the lack of tools for people with color-blindness, so he got to work: Coding with Swift, he built the app Cone, which uses the iPhone or iPad’s camera—and Apple’s AVFoundation framework—to identify colors in photos or any environment.

Agarwal designed *Cone* to serve as a guide for those with color-blindness.

Agarwal designed Cone to serve as a guide for those with color-blindness.

The App Store spoke to Agarwal about color temperatures, the design world, and picking ripe mangoes.

What inspired you to create Cone?
There were other options for color-blind people, but they never worked reliably for me. Some would read only limited hues. Some would read only the color of the exact pixel you were pointing to, which would result in inaccuracies. Individual pixels never tell the whole story—the colors you see, especially in high-resolution photos, are an average of all the colors in a small area.

When did you realize you were onto something?
I’d heard it’s possible to tell if a mango is ripe by its color. I could never do that because I have a hard time differentiating between yellow-orange and green. So one day I had the app look at a few mangoes in the kitchen and found some of them were green! To my eyes, they were different shades of the same color, but Cone told me the real story. I still use Cone to identify ripe mangoes!

What was the early response to your app?
Initially, people—mostly from Reddit’s r/colorblind community—were skeptical about Cone’s accuracy, mainly because of two problems in existing apps: inaccurate color readings in different lighting conditions and the tendency for apps to read only a single pixel value. I introduced a color-temperature control so Cone could read colors accurately in different lighting conditions. I also had Cone read every color around a point and show the average result. People enjoyed this attention to detail.

How has Cone evolved since launch?
Before Cone was released to the public, it was a simple color-identification tool for personal use. Once I started polishing it for release, I figured out another use case that would help me as a designer: the ability to store and manage colors in a library. So over time, Cone evolved to be a utility for designers. It’s now used by UI designers, interior designers, graphic designers, print designers, and more.

The app has become an invaluable tool for many people. What has it meant for you?
Now I make fewer mistakes seeing colors, so I am able to always wear matching clothes!


Learn more about Cone on the App Store

Learn more about the App Store Small Business Program

Posted on Leave a comment

Fine-tune your App Transport Security settings

Padlock symbol badged with a globe symbol

At Apple, we believe privacy is a fundamental human right. When people connect to a public Wi-Fi hotspot, they expect to use your app to send and receive data without worrying that someone in the vicinity could intercept their connection and gain access to unencrypted data. Allowing even seemingly-innocuous data to remain unencrypted can expose people to snooping and fingerprinting by anyone on the network.

Transport Layer Security (TLS) uses encryption to protect connections from prying eyes, and URLSession provides strong TLS connections by default with App Transport Security (ATS).

If you need to connect to older servers that don’t support TLS, however, you can now add ATS exceptions to your app. Ideally, exceptions should just carve out the specific domains or frameworks that make insecure connections, and you should limit any exceptions you do request. Avoid sending data unencrypted except when absolutely necessary for your app to function.

Identify necessary ATS exceptions

To make sure your app — and the data used within it — is as secure as possible, it’s important to identify whether your app is currently making insecure connections.

To check, disable all your active ATS exceptions by setting their values in your Info.plist to “NO.” From there, open your app or run your unit tests. If your app makes an insecure connection, Xcode will generate runtime errors for each one.

If your app is generating insecure connections, there are a few steps you can take to remove them.

Secure your servers

If your app connects to servers you control, make sure those servers support secure connections. This requires a TLS certificate. If you use a hosting service, check whether they offer certificates, and make sure those certificates meet the requirements detailed in “Preventing Insecure Network Connections.”

Preventing Insecure Network Connections

Use HTTPS

If your app connects to servers you don’t control, you should always attempt to connect to those servers over HTTPS instead of HTTP. You can identify whether a server supports HTTPS by simply changing “http://” to “https://” in your URL string and trying to load data from that website. You can check this manually in a browser, or run code as follows:

let request = URLRequest(url: URL(string: “https:

Many websites redirect HTTP connections to HTTPS. Connecting over HTTPS first can often improve the performance of your app. Note, however, that while a website may use HTTPS, that doesn’t mean it’s ATS-compatible. For instance, it may be using an outdated version of TLS, which, on Safari, displays a “This Connection Is Not Private” warning.

Remove unnecessary exceptions
On websites where you no longer receive ATS runtime errors, you can remove those exceptions. Locate “App Transport Security Settings” in your Info.plist and click the “-” icon to remove the exceptions in question.

Configure exception domains

If your app still needs to make insecure connections to specific domains, you can configure ATS exceptions for just those domains.

  • Add Exception Domains directly to your app’s Info.plist or in the project editor. Navigate to “Signing & Capabilities” and choose the “+ Capability” option.
  • Select “App Transport Security Exception” from the list.
  • This will add an “App Transport Security Exception” section to your capabilities:
  • Click the “+” icon to add domains that your app needs to connect to insecurely.
  • Enter a domain here to connect over HTTP to that domain and its subdomains. If you need to alter these settings, you can make changes directly in your Info.plist.

Configure framework and class exceptions

On rare occasion, you still may need to make an insecure connection to an unknown domain. In this case, there are two broader exceptions you can consider offering.

  • If your app needs to make insecure connections through WKWebView, add “Allows Arbitrary Loads In Web Content” to your Info.plist:
  • If your app needs to make insecure connections through AVFoundation, add “Allows Arbitrary Loads for Media”:

These exceptions will ensure that your app only makes insecure connections via AVFoundation or WKWebView, leaving the rest of your app protected by ATS. Because these are relatively broad exceptions, however, they will allow every part of your app that uses AVFoundation or WKWebView to make insecure connections which can be intercepted and inspected.

Keep your app secure

People want to trust your app, and ATS can help you build that trust by handling their data responsibly while in transit. To get the most out of ATS:

  • Make sure that your app connects to servers over HTTPS instead of HTTP.
  • Tailor your ATS exceptions to your app as closely as possible.
  • Periodically review your exceptions to check whether servers have started supporting HTTPS or your app no longer needs to connect those servers to make insecure connections.

Resources

Networking with NSURLSession

Learn about App Transport Security, HTTP/2 protocol support, new NSURLSession API, and best practices for networking in apps, extensions, and WatchKit apps.

NSAppTransportSecurity

Preventing Insecure Network Connections

NSExceptionDomains

NSAllowsArbitraryLoadsForMedia

NSAllowsArbitraryLoadsInWebContent

WKWebView

Learn more about App Transport Security on the Developer Forums

Posted on Leave a comment

Best of WWDC21

Explore Xcode Cloud workflows

Learn how Xcode Cloud workflows can help you and your team automate building, analyzing, testing, archiving, and distributing your apps and frameworks. They are flexible, extensible, and can be configured around your team’s development and distribution process. Find out the basics of Xcode Cloud…

Posted on Leave a comment

Challenge: Create an engaging tutorial

The DocC documentation compiler, available in Xcode 13, converts Markdown-based text into rich documentation for Swift frameworks and packages and displays it right in the Xcode documentation window. DocC also powers the interactive developer tutorials featured on developer.apple.com. In this challenge, we invite you to explore the tutorial functionality and design and build step-by-step instructions for an existing project you’ve created or an open source Swift package.

Begin the challenge

To get started writing a tutorial, add a Documentation Catalog to your existing project, or create a new framework project.

You’ll write your tutorial content in Markdown, and use directives to define specific types of pages and elements, like introductions, sections, steps, and assessments. Then, use the Build Documentation feature of Xcode — which runs the DocC compiler — to render your tutorial in a rich, interactive learning format.

diagram showing markdown translated to DocC tutorial format

Resources

Meet DocC documentation in Xcode

Discover how you can use DocC to build and share documentation for Swift packages and frameworks. We’ll show you how to begin generating documentation from your own code — or from third-party code you depend upon — and write and format it using Markdown. And we’ll also take you through the…

Create great documentation with DocC

Build interactive tutorials using DocC

Discover how you can author immersive tutorials from scratch with DocC. We’ll demonstrate how you can bring together rich instructions, example code, and images through the DocC syntax to showcase your Swift framework in action. And we’ll go over how to create progressive training that can…

Elevate your DocC documentation in Xcode

Great documentation can help people effectively and easily adopt your Swift framework. Discover how you can create rich, conceptual articles to accompany your API. You’ll learn best practices for writing articles, including how to structure your documentation, and find out how to create…

Visit the Apple Developer Forums

Building an Interactive Tutorial

SlothCreator: Building DocC Documentation in Xcode

Read the WWDC21 Challenges Terms and Conditions

Posted on Leave a comment

WWDC21 Daily Digest: Day 5

A Memoji staring into the screen of a MacBook Pro.

This is it! The final day of WWDC. (We can’t believe it, either.) Before we power down, however, we’ve got one more big day of events and activities for you.

Relive the week

It’s been a busy week — and we understand if you missed some of the action. Catch up quickly with our video recaps of Day 1, Day 2, Day 3, and Day 4.

Thursday@WWDC21

Wednesday@WWDC21

Tuesday@WWDC21

Monday@WWDC21

Day 5 in the WWDC pavilions

There’s still lots to explore in the pavilions. Discover how to design for Safari 15 in the Safari & Web pavilion. Learn how to practice audio haptic design in the Audio & Video pavilion. And find out how to build a research and care app in the Health & Fitness pavilion.

Design for Safari 15

Practice audio haptic design

Code-Along: Build a Research and Care app

Code-Along: Build a great Mac app in SwiftUI

Write a DSL in Swift using result builders

Explore advanced project configuration in Xcode

Create 3D workflows with USD

Accept these Friday challenges

The responses to the #WWDC21Challenges this week have been fantastic. You’ve captured 3D objects and designed SwiftUI interfaces for your apps in the style of old Apple design language. You’ve resolved pesky memory issues in code by capturing flags, and designed and created ShazamKit companion apps.

Developer Laurence Moroney built an app for the “Build an app using built-in Sound Classification” challenge that takes the built-in sound classes and renders them as emoji.

Developer Laurence Moroney built an app for the “Build an app using built-in Sound Classification” challenge that takes the built-in sound classes and renders them as emoji.

We’re wowed by the things you’ve created — and now, it’s the last day to show off your skills.

Explore #WWDC21Challenges on social media

Explore spatial audio soundscapes and learn how to craft compelling stories with multichannel audio. Build a prototype in SwiftUI. And solve a pitch-black maze entirely using VoiceOver.

Challenge: Prototype with SwiftUI

Challenge: Explore spatial audio soundscapes

Challenge: VoiceOver Maze

Drop in on the Digital Lounges

The WWDC21 Digital Lounges have been so much fun, but it’s almost time to say goodbye. The lounges will close at 5 p.m. PDT on Friday, but there’s still time to stop by SwiftUI Office Hours, meet the presenters in the Machine Learning lounge, and connect with the developer tools and accessibility teams. Don’t be shy — if you haven’t stopped by the Digital Lounges yet, we’d love to meet you still.

Explore the Accessibility Digital Lounge

Explore the Developer Tools Digital Lounge

Explore the Machine Learning Digital Lounge

Explore the SwiftUI Digital Lounge

Spotlight on accessibility

How do you approach creating apps for everyone? Learn from developers who are blind or deaf themselves as they discuss the process of making technology accessible. Discover how their unique perspectives have sparked innovation at their companies and helped make their apps even more inclusive.

Developer spotlight: Accessibility

Join our final Mindful Cooldown for Coding

There’s been so much excitement this week: At 3 p.m. PDT, wind down with one final Mindful Cooldown for Coding from our friends at Fitness+.

And that’s a wrap! Thank you for spending your week with us, watching sessions, participating in our Digital Lounges, asking questions in the Developer Forums and 1-to-1 labs, trying daily challenges, and having fun.

And remember: While WWDC21 may be over, our session and labs content will be available all year round in the Developer app for you to consult when you’re ready to start working on the next thing.

Posted on Leave a comment

Challenge: VoiceOver Maze

Speak bubble symbol with a pointing arrow location symbol inside

Can you escape from Castle Park using only VoiceOver? Challenge yourself to solve this puzzle while getting familiar with VoiceOver, an assistive technology for people who are blind and low-vision. VoiceOver is a screen reader that allows people who are blind and low-vision to completely operate Apple’s products. On iOS, people can touch and swipe on the screen in order to navigate items, with each item’s name and status spoken aloud using synthesized speech.

In this challenge, we invite you to escape the maze of Castle Park. But there’s a catch: There is no visual interface in this iOS app! You must rely completely on VoiceOver to navigate the maze and escape.

How to enable VoiceOver

You have a few options to enable or disable VoiceOver.

  • You can ask Siri to turn VoiceOver on or off for you at anytime.
  • You can use the Accessibility Shortcut in Settings > Accessibility and set the shortcut to VoiceOver. Now, when you triple click the side button (or Home button, depending on your device), you can quickly turn VoiceOver on or off.

Begin the challenge

To start this accessibility challenge, download the Xcode project linked below and run it on iPhone or iPad. Use VoiceOver to explore the app and make decisions to help you escape.

Tip:
Once you’ve enabled VoiceOver, there are three main gestures to help you navigate:

  • Touch to speak
  • Swipe left or right to move previous or next
  • Double-tap to activate

And once you complete this challenge, consider exploring how your own app behaves with VoiceOver. How can you make it better for people who rely on a screen reader to interact with their device?

SwiftUI Accessibility: Beyond the basics

Go beyond the basics to deliver an exceptional accessibility experience. Learn how to use the new SwiftUI Previews in Xcode to explore the latest accessibility APIs and create fantastic, accessible apps for everyone. Find out how you can customize the automatic accessibility built into SwiftUI to…

Tailor the VoiceOver experience in your data-rich apps

Learn how to present complex data through VoiceOver with the Accessibility Custom Content API. Discover how you can deliver accessibility information in a concise form, and only when someone wants it. We’ll show you how you can integrate AXCustomContent and help people who want VoiceOver enabled…

VoiceOver: App Testing Beyond The Visuals

VoiceOver provides spoken descriptions and braille output of onscreen elements. Learn how to go beyond the visuals to identify VoiceOver and functional issues to help improve the experience for all users.

Resources

WWDC21 Challenge: VoiceOver Maze

Enhance the VoiceOver experience in your app

Read the WWDC21 Challenges Terms and Conditions

Posted on Leave a comment

Challenge: Prototype with SwiftUI

Swiftui icon on blue background

While SwiftUI is a powerful framework, one of its key features is its simplicity. Designers with very little knowledge of code can easily create prototypes with human-readable syntax and interactive Xcode Previews. In this challenge, we invite you to say “hello, world” with a brilliant SwiftUI-based prototype.

Begin the challenge

What’s an app you’d love to build right now? Take charge of SwiftUI and Xcode Previews and turn that idea into a prototype: Explore what interfaces you can create with Xcode Preview, and let the tools write the code for you. (And pick up a little SwiftUI code knowledge along the way.)

Start fresh with a new Xcode project, or explore prototyping a new view in SwiftUI for your existing app. Need support, or want help from the community in prototyping? You can share prototyping projects in progress on the Developer Forums. Already working on a prototype in UIKit or AppKit? Explore creating a new view in SwiftUI.

Visit the Apple Developer Forums

Share your new SwiftUI views with us over the summer. We can’t wait to see what you can build with SwiftUI and Xcode Previews, and to hear about what you learn!

Resources

Code-Along: Build a great Mac app in SwiftUI

  • WWDC20

Introduction to SwiftUI

Explore the world of declarative-style programming: Discover how to build a fully-functioning SwiftUI app from scratch as we explain the benefits of writing declarative code and how SwiftUI and Xcode can combine forces to help you build great apps, faster.

Introducing SwiftUI

Read the WWDC21 Challenges Terms and Conditions

Posted on Leave a comment

Challenge: Explore spatial audio soundscapes

Person SF Symbol surrounded by speaker SF Symbols on a blue-green textured background

When you support multichannel audio in your app, game, or audiovisual content, you can add dimensionality to your storytelling, transport listeners out of a conventional audio experience, and bring people further into the worlds you’re creating. In this challenge, we invite you to explore a soundscape in intentional stereo, stereo spatialization, and multichannel formats, consider the differences between each, and brainstorm how spatial audio could enhance your own stories.

Begin the challenge

In the demo for “Immerse your app in spatial audio,” the presenter, Simon, has his spatial audio demonstration video ‘fail’ on him. After a few moments of panic and quick thinking, he decides he’s going to describe the events of this failed video — and as he does, those events begin to come to life. In each scene, different audio techniques create a fully-imagined environment for the audience to inhabit, drawing them into Simon’s described world.

Immerse your app in spatial audio

Discover how spatial audio can help you provide a theater-like experience for media in your apps and on the web. We’ll show you how you can easily bring immersive audio to those listening with compatible hardware, and how to automatically deliver different listening experiences depending on…

For this challenge, we’re inviting you to explore this demo and listen to the differences as you move between intentional stereo, spatialized stereo, and multichannel formats. You’ll need a pair of spatial audio-compatible accessories, like AirPods Pro, as well as a device running iOS 14 or macOS Big Sur. To explore the spatialized stereo format, you’ll need a device running iOS 15 or macOS Monterey. As you listen, consider how each version of the experience feels different.

Listen to the demo in intentional stereo
Watch the session on iOS 14 or macOS Big Sur in the Developer app or on developer.apple.com. You’ll hear this demo delivered in stereo, with visual cues on screen indicating the full surround experience.

What do you notice, listening to this experience? How does the audio shift and change as we move through each of Simon’s soundscapes?

Listen to the demo for “Immerse your app in spatial audio” in the Developer app

Listen to the demo in spatialized stereo
To hear the spatialized stereo version of “Immerse your app in spatial audio,” watch this demo on a device running the iOS 15 or macOS Monterey developer betas.

How does this change the experience for the listener compared to the intentional stereo version? Are there sounds or moments you find yourself noticing that you haven’t before?

Listen to the demo for “Immerse your app in spatial audio” in the Developer app

Listen to the demo in multichannel
You can stream a full multichannel mix of this demo in spatial audio on either iOS 14 or iOS 15 using the link below.

As you listen to this multichannel mix, divide the world into three distances: Background, foreground, and personal space. Think about where the sounds are coming from. What do these different distances and orientations add to the experience? How does the positioning of sound further enhance this story?

Listen to the demo for “Immerse your app in spatial audio” in multichannel audio

Now, think about a moment from your app, game or audiovisual content. How does the audio currently sound in this moment? How can you improve that experience by bringing distance and orientation into your soundscape? Where could supporting multichannel and spatial audio help draw people into your story?

Spatialize your experiences
With more support for spatial audio experiences coming with iOS 15 and macOS Monterey later this year, now is a great time to consider how you currently approach telling stories through audio. Listen to your stereo experiences on the developer betas and listen to how they change when played back in spatialize stereo. Consider how you can augment those existing moments by creating multichannel mixes. And explore what kinds of entirely new experiences you can provide listeners with spatial audio. For game designers, we also recommend watching “Discover geometry-aware audio with the Physical Audio Spatialization Engine (PHASE)” to learn about new ways you can create spatial audio experiences that adapt to the environment of your game.


Note: if you’re curious about experimenting further with multichannel, you can try creating a multichannel audio experience of your own by exploring the binaural and surround mixing tools in digital audio workstations (DAWs) like Logic Pro X. (To properly mix and play back your audio in surround, however, you’ll need a multichannel speaker setup.)


Want to share your thoughts on this demo, or how you’d adapt your existing experiences for spatial audio? Head over to the Developer Forums.

Visit the Apple Developer Forums

Resources

Immerse your app in spatial audio

Discover how spatial audio can help you provide a theater-like experience for media in your apps and on the web. We’ll show you how you can easily bring immersive audio to those listening with compatible hardware, and how to automatically deliver different listening experiences depending on…

Discover geometry-aware audio with the Physical Audio Spatialization Engine (PHASE)

Explore how geometry-aware audio can help you build complex, interactive, and immersive audio scenes for your apps and games. Meet PHASE, Apple’s spatial audio API, and learn how the Physical Audio Spatialization Engine (PHASE) keeps the sound aligned with your experience at all times — helping…

Read the WWDC21 Challenges Terms and Conditions

Posted on Leave a comment

Challenge: Achievement Unlocked — Series Finale

Achievement symbol with an achievement icon that looks like a star in a circle.

When you create achievements that truly surprise and delight your players as they make their way through a game, you can help elicit a feeling of accomplishment, or even make the player laugh. Most of us have experienced playing games where we have unlocked some kind of achievement or trophy that stirs some of these emotions. This is exactly what we want you to consider when you create Game Center achievements for your apps or games — and now, we’re challenging you to show the developer community your best, funniest, strangest, and most delightful achievements.

Begin the challenge

This achievements challenge focuses on sequencing achievements to encourage people to complete a specific set of tasks. Progress-based achievements are the most common types of rewards players can earn, and coupling some of them together can help create an even stronger narrative within your app or game.

Whether your game is divided into chapters, levels, or some other way, today’s challenge is to create a series of at least 2-3 achievements that break up the narrative in a unique and interesting way. Think about how you might add titles and descriptions in both the locked and unlocked versions of the achievement that indicate to the player these are connected together and need to be unlocked in that specific order. (And as always, bonus points for puns and amazing alliteration.)

We welcome all achievements, new, old, existing, or imaginary: Show off your “Series Finale” achievements from one of your existing apps or games, or put your wordsmithery to work and create an entirely new set of achievements. You can share these with the developer community on the Developer Forums.

Best of all, we’ve made it easy for you to participate and dream up awesome achievements even if you haven’t yet implemented Game Center or you want to try writing something entirely new: Just download the attached Game Center achievement template.

Visit the Apple Developer Forums

Best practices for great achievements

It’s a lot of fun to create unique and engaging achievements to connect people with your app or game. Below are a few of our recommendations when thinking about writing and designing achievements.

Be creative with an achievement’s title, but straightforward with its description
Although most people appreciate entertaining titles, they expect an achievement’s description to specify how to earn it. If you were to create a WWDC21 achievement, for instance, you might write the following:

Title: Code Completionist
Description: Watched every WWDC21 Code-Along session.

Be succinct
The Game Center achievement card limits your title and description to two lines each before truncating the text — brevity is key to a great achievement.

Think inclusively
Follow the Human Interface Guidelines around inclusivity when creating achievements. The best jokes, puns, and wordplay are those that are intuitive and friendly to everyone who might interact with your app or game, and make players feel recognized and rewarded.

Add unique, high-quality images
People appreciate earning unique achievements that remind them of each accomplishment. When you create custom artwork, you can help that achievement stand out from the others in your app or game and make it more recognizable to people who interact with it.

You can learn more about how to design great achievements in Apple’s Human Interface Guidelines, and in the WWDC20 session “Design for Game Center.”

Design for Game Center

Get your game’s interface ready for Game Center. We’ll show you how to deliver personalized touches to the GameKit interface that provide a rich experience for players, with features like achievements, leaderboards, and multiplayer gaming. Learn how to customize your game’s access point, design…

Download the Achievement Unlocked Challenge material

Learn more about designing achievements

Read the WWDC21 Challenges Terms and Conditions