Posted on Leave a comment

Challenge: WidgetKit workshop

Take a glance at this WidgetKit challenge, won’t you? With glanceable experiences coming to the Lock Screen in iOS 16, it’s the perfect time to try building your very own Lock Screen widget.

Begin the challenge

If you’re exploring glanceable technologies for the first time, welcome! Before we get started with the challenge, check out “Complications and widgets: Reloaded” for an overview of the latest updates to WidgetKit.

Complications and widgets: Reloaded

Our widgets code-along returns as we adventure onto the watchOS and iOS Lock Screen. Learn about the latest improvements to WidgetKit that help power complex complications on watchOS and can help you create Lock Screen widgets for iPhone. We’ll show you how to incorporate the latest SwiftUI views…

Once you’re ready to begin, it’s time to examine your app: What parts of it might work as a widget? After you’ve identified an aspect, explore configuration options and the best timeline for your model.

If you already have a Home Screen widget, you can also explore reusing your SwiftUI code. Not every Home Screen widget is a great candidate for a Lock Screen widget, so consider different approaches to find the right one for your app.

For extra credit: What happens when you deploy your code to the Apple Watch? Have you found yourself most of the way to an awesome watchOS complication? Would you make any modifications to make your experience feel at home on Watch?

How will you transform your Lock Screen? Show us what you’ve made on Twitter with the hashtag #WWDC22Challenges, or share your work in the WidgetKit Study Hall. And if you’d like to chat more about WidgetKit, join the team at events all throughout the week at WWDC22.

Explore #WWDC22Challenges on social media

Read the WWDC22 Challenges Terms and Conditions

Posted on Leave a comment

Challenge: Draw with metal-cpp

Metal is the foundation for accelerated graphics and compute power on Apple platforms — and if you’re familiar with C++, now’s the perfect time to explore its incredible power. For this challenge, we’re inviting you to try out metal-cpp and render your own triangle, sphere, or even a mesh in Xcode.

We also welcome you to visit the Graphics & Games Study Hall during the day to collaborate on this challenge! Ask questions, connect with other developers, and share your creations.

Begin the challenge

Before you begin, you’ll want to watch “Program Metal in C++ with metal-cpp” and download the LearnMetalCPP project, which contains a series of C++ samples.

Program Metal in C++ with metal-cpp

Your C++ games and apps can now tap into the power of Metal. We’ll show you how metal-cpp helps you bridge your C++ code to Metal, explore how each manages object lifecycles, and demonstrate utilities that can help these language cooperate in your app. We’ll also share best practices for designing…

Download the LearnMetalCPP project

Open the project in Xcode, and choose 00-window.cpp as your base code. To render your image, you’ll need to set up a few things within your project.

First, create a MTL::RenderPipelineState object with a MTL::RenderPipelineDescriptor. To do this, you’ll need to create a function, like buildShaders(). In the code snippet below, we’ve provided the shader code needed to render a single triangle.

void Renderer::buildShaders()
{ using NS::StringEncoding::UTF8StringEncoding; const char* shaderSrc = R"( #include  using namespace metal; struct AAPLVertex { float3 position; half3 color; }; // Welcome to modify the mesh as you want constant AAPLVertex triangles[] = { { float3{ -0.8f, 0.8f, 0.0f }, half3{ 1.0, 0.3f, 0.2f } }, { float3{ 0.0f, -0.8f, 0.0f }, half3{ 0.8f, 1.0, 0.0f } }, { float3{ +0.8f, 0.8f, 0.0f }, half3{ 0.8f, 0.0f, 1.0 } } }; struct v2f { float4 position [[position]]; half3 color; }; v2f vertex vertexMain( uint vertexId [[vertex_id]]) { v2f o; o.position = float4( triangles[ vertexId ].position, 1.0 ); o.color = half3 ( triangles[ vertexId ].color ); return o; } half4 fragment fragmentMain( v2f in [[stage_in]] ) { return half4( in.color, 1.0 ); } )"; // TODO: Create a MTL::RenderPipelineDescriptor // TODO: Allocate a MTL::RenderPipelineState object
}

Then, extend the Renderer::draw( MTK::View* pView) function by setting a MTL::RenderPipelineState and inserting draw calls.

void Renderer::draw( MTK::View* pView )
{
... ...
}

After that:

  • Create the MTL::RenderPipelineDescriptor object and set up some properties.
  • Create the MTL::RenderPipelineState object.
  • Tip: Be careful with object lifecycles.

Ready to share your metal-cpp art with the community? Show us what you’ve made on Twitter with the hashtag #WWDC22Challenges, or share your work in the Graphics & Games Study Hall. And if you’d like to discuss metal-cpp and other Graphics & Games topics, join the team at events all throughout the week at WWDC22.

Explore #WWDC22Challenges on social media

Read the WWDC22 Challenges Terms and Conditions

Posted on Leave a comment

Challenge: Go big or go home

What’s better than people loving your app on iPhone? People loving your app on iPad and Mac, too! This challenge invites you to explore the ways you can expand your app’s presence in the Apple ecosystem. Explore prototyping your iPhone app for iPad, adding new desktop-class features to your iPad app, or bringing your app to macOS. Whatever it means to you, think big!

We also welcome you to visit the UI Frameworks Study Hall to collaborate on this challenge! Ask questions, connect with other developers, and share your creations.

Begin the challenge

Before you begin this challenge, check out our sessions on creating desktop-class iPad apps.

Meet desktop-class iPad

Learn how you can bring desktop-class features to your iPad app. Explore updates to UINavigationBar that bring more discoverability and customizability to your app’s features. Find out how the latest updates to UIKit can help make it easier and faster for people to explore content in your app….

Build a desktop-class iPad app

Discover how you can create iPad apps that take advantage of desktop class features. Join Mohammed from the UIKit team as we explore the latest navigation, collection view, menu, and editing APIs and learn best practices for building powerful iPad apps. Code along with this session in real time or…

Adopt desktop-class editing interactions

Discover advanced desktop-class editing features that can help people accelerate their productivity in your app. Learn how you can provide more interactions inline with your UI to help people quickly access editing features and make your iPadOS app feel right at home on macOS with Mac Catalyst….

If you already have an iPad app, this challenge is a great opportunity to refine it. If your iPad app is already at the top of its game, explore bringing it to Mac with Mac Catalyst — and consider the differences in the iPad and Mac idioms.

Don’t have an iPad app? Take this opportunity to start prototyping one! And if you’re only on iPhone, never fear – iPhone apps on the Mac are a quick and easy way to offer your iPhone app to M1 customers, no changes needed.

Tell us about the path you chose — and show us your progress! — in the UI Frameworks Study Hall. And don’t forget to show us what you’ve made on Twitter with the hashtag #WWDC22Challenges.

Explore #WWDC22Challenges on social media

Read the WWDC22 Challenges Terms and Conditions

Posted on Leave a comment

Meet the WWDC22 Swift Student Challenge winners

In the lead-up to Apple’s Worldwide Developers Conference, young people from around the globe used Swift Playgrounds to showcase their coding skills as part of the Swift Student Challenge. This year, they include submissions from first-time participants Jones Mays II, Angelina Tsuboi, and Josh Tint.

All three teens are harnessing the power of coding to create apps that help solve problems in their communities — and are among more than 350 students from 40 countries and regions who were selected as 2022 challenge winners.

Learn more about some of the WWDC22 Swift Student Challenge winners

Posted on Leave a comment

WWDC22 Daily Digest: Wednesday

Welcome to Wednesday at WWDC! We’re almost halfway through the week, and there’s so much still to come. But first: Let’s get the dispatch from day 2.

WWDC22 Day 2 recap

Ready for your Day 2 briefing? Catch up on all the great sessions from Tuesday and get a sneak peek at the day ahead.

Spin the music of WWDC

Whether you want a musical break or some bluesy background beats, you can drop the needle on the official WWDC playlists right now.

Listen to WWDC22 playlists on Apple Music

Spotlight on Digital Lounges and labs

If you haven’t registered for Digital Lounges this week, you’re missing out on great discussions, SwiftUI watch parties, and a truly… iconic… monochrome pixel art challenge.

Just a few of the fantastic pixel icons created for Tuesday’s “Pixel perfect design” challenge in the Design Lounge.

Just a few of the fantastic pixel icons created for Tuesday’s “Pixel perfect design” challenge in the Design Lounge.

But don’t fret: Even if you miss a day, you can catch up at any time this week by joining us on Slack and reading through past messages.

Register for Digital Lounges

And we’ve got another packed day today: Join us on Slack for live text-based watch parties of “Build a desktop-class iPad app” and “Compose custom layouts with SwiftUI,” ask questions about RoomPlan, WidgetKit, and Shortcuts, and join the Accessibility team for a community panel.

We’re also hosting dedicated labs for Accessibility, CarPlay, App Intents, Design, Xcode, and much much more.

Request a WWDC22 lab appointment

And that’s just the tip of the iceberg! You can check out our complete schedule on the WWDC tab in the Developer app or on developer.apple.com.

Meet the new Human Interface Guidelines

Apple’s Human Interface Guidelines (HIG) is a comprehensive resource for designers and developers looking to create great experiences across Apple platforms. Now, it’s been fully redesigned and refreshed to meet your needs — from your first sketch to the final pixel. Take a moment this Wednesday and explore the new guidelines.

Meet the new Human Interface Guidelines

Apple’s Human Interface Guidelines (HIG) is a comprehensive resource for designers and developers looking to create great experiences across Apple platforms. Now, it’s been fully redesigned and refreshed to meet your needs — from your first sketch to the final pixel.

Human Interface Guidelines

Sign up for a sci-fi challenge

Floating numbers! Neon code screens! Expand your reality in today’s SwiftUI science fiction challenge, where you’ll create a futuristic-looking screen that will bend the very fabric of spacetime (or at least look really cool). To join, visit the SwiftUI Study Hall in the Digital Lounges, where you can also ask questions, connect with other devs, and share your progress.

Ready to take on more challenges? Over in the Design lounge, we’re inviting you to put your sonic skills to good use and manipulate audio from Apple sound designers with Apple sensing frameworks. Elsewhere, you can try your hand at creating or drawing with metal-cpp, designing Lock Screen widgets with WidgetKit, and expanding your iPhone app to iPad and Mac.

Have a great Wednesday — we’ll see you tomorrow for Day 4 of WWDC!

Posted on Leave a comment

Meet the new Human Interface Guidelines

Meet the new Human Interface Guidelines

Apple’s Human Interface Guidelines (HIG) is a comprehensive resource for designers and developers looking to create great experiences across Apple platforms. Now, it’s been fully redesigned and refreshed to meet your needs — from your first sketch to the final pixel.

Human Interface Guidelines

The HIG has merged its platform-specific guidance into a unified document, making it simpler to explore common design approaches while still preserving relevant details about each platform. The overhauled navigation also helps you browse components, technologies, design patterns, and foundational principles: Larger sections include a visual index, while each individual page features links to related resources like videos, articles, and API documentation. You can also search directly within the HIG to find a specific page. And coming later this year, the HIG will sport change logs that record updates and edits as they happen — both for each updated page and for the entire set of guidelines.

The Human Interface Guidelines have come a long way.

The Human Interface Guidelines have come a long way.

The HIG is deeply rooted in the design principles Apple helped pioneer decades ago. It has a rich legacy that reaches back to the early days of the graphical user interface and is a living document that provides the latest design guidance for Apple platforms, adapting to new devices, technologies, and updates.

Whether you’re just starting out or a veteran Apple developer, the HIG is a key resource for creating amazing experiences on all platforms.

Posted on Leave a comment

Challenge: You can build an app for that!

WWDC isn’t only about exploring the brand-new frameworks and APIs — it’s also an excuse to give yourself time to experiment and play with the APIs that already exist. Whether you’ve got a problem you’ve been itching to solve or you just want a blank canvas to try out an animation or view, Swift Playgrounds makes it easy to build apps and projects. And that’s what we’re inviting you to do with this challenge: play!

Begin the challenge

Today is all about experimentation and having fun: Download the Swift Playgrounds app on iPad or Mac and experiment with an existing framework, idea, animation, or app concept that you’ve always wanted to try but haven’t had the time to explore. Discover the tools available, incorporate packages, build prototypes, and most importantly, enjoy yourself!

Download Swift Playgrounds for macOS

Download Swift Playgrounds for iOS

Learn more about Swift Playgrounds

You can collaborate on this challenge with others in the Digital Lounges Study Hall, or explore a solo challenge. And if you have questions about the app or building your own software, you can meet the presenter behind “Build your first app in Swift Playgrounds” for a text-based conversation and short group Q&A.

Make something you want to share with the world? Feel free to show it off in the Digital Lounges or on Twitter using #WWDC22Challenges.

Explore #WWDC22Challenges on social media

Read the WWDC22 Challenges Terms and Conditions

Posted on Leave a comment

Challenge: Toolbar transformation Tuesday

Move over, Taco Tuesday. This week, it’s Toolbar Transformation Tuesday! With iOS 16 and iPadOS 16, you can now adopt powerful productivity improvements in your app like customizable bar button items, inline search bars, and document menu support.

So today, we’re challenging you to transform your own toolbars. We also welcome you to visit the UI Frameworks Study Hall during the day to collaborate on this challenge! Ask questions, connect with other developers, and share your creations.

Begin the challenge

The transformation all starts with Xcode 14: download the app and and check out your existing projects within it. We also recommend watching “Meet desktop-class iPad” and “Adopt desktop-class editing interactions” from WWDC22 to explore the possibilities for your UI.

  • WWDC22

Meet desktop-class iPad

Learn how you can bring desktop-class features to your iPad app. Explore updates to UINavigationBar that bring more discoverability and customizability to your app’s features. Find out how the latest updates to UIKit can help make it easier and faster for people to explore content in your app….

  • WWDC22

Adopt desktop-class editing interactions

Discover advanced desktop-class editing features that can help people accelerate their productivity in your app. Learn how you can provide more interactions inline with your UI to help people quickly access editing features and make your iPadOS app feel right at home on macOS with Mac Catalyst….

Begin the transformation for your app by exploring buried functionality and adding items to the center section of the toolbar. Check out all the available customization options that can make it easy for people to put the tools they need front and center.

You can also try adding a title menu with UINavigationItem.titleMenuProvider to enable workflows that cover the entire document; centralize sharing and drag and drop by adopting UIDocumentProperties; and power up your searches by adding search suggestions to help people find exactly what they’ve been seeking.

We’d love to check out your progress! Show us what you’ve made in the Digital Lounges or on Twitter with the hashtag #WWDC22Challenges. If you’d like to discuss toolbars and other UI frameworks topics, join the team at events all throughout the week at WWDC22. And — if you’re so moved — please enjoy a taco today in celebration.

Explore #WWDC22Challenges on social media

Read the WWDC22 Challenges Terms and Conditions

Posted on Leave a comment

Challenge: Learn Switch Control through gaming

Learn more about a critical assistive technology this WWDC and solve a matching game using only Switch Control!

We’re inviting you to expand your skillset and familarize yourself with Switch Control, an assistive technology used by mobility-impaired individuals to help navigate and operate iOS. We’ll show you how to set up a screen switch, use automatic scanning, and control the Switch Control menu system. From there, dive deeper and learn how you can customize and enhance the experience for people using Switch Control through a specific accessibility API.

You can share your progress with others on this challenge in the Digital Lounges Study Hall, or explore a solo challenge.

Begin the challenge

To start this challenge, you’ll need to first download and run the sample code project and set up Switch Control.


Note: This project requires an iPhone or iPad running iOS 16 or iPadOS 16. You won’t be able to to run it in Simulator.

WWDC22 Challenge: Learn Switch Control through gaming

Configure and enable Switch Control

Switch Control is an accessibility feature that helps you interact with your device using a variety of software and hardware switches. These can be located on the screen, and can use the camera, sounds, or connected accessories.

First, configure the switch you’ll need for the challenge:

  1. Open the Settings app.
  2. Choose Accessibility > Switch Control > Switches.
  3. Select Add New Switch.
  4. Add a switch by navigating to Switches > Screen Switch > Full Screen. Choose Select Item.

Choose your scanning time in Auto Scanning Time. The default is one second, which means the Switch Control focus will wait one second on each element before moving on to the next. You can adjust this time as you like.

Alternatively, you can choose Bluetooth Devices, select a device to use as a switch, and select an action for that switch.

After you’ve finished setting up your switch, you’re ready to enable Switch Control on your device. If you don’t typically use Switch Control, you can set up an Accessibility Shortcut to quickly enable or disable it for the purposes of this challenge. Here’s how:

  1. Open the Settings app.
  2. Choose Accessibility > Accessibility Shortcut.
  3. Select Switch Control. Make sure this is the only enabled item in the list.

You can now triple-click the Side button or Home button on your device to trigger the Accessibility Shortcut and toggle Switch Control on or off.

Set up the challenge

Now that you’ve got Switch Control enabled, it’s time to explore the project.

  1. Go to Settings > Accessibility > Accessibility Shortcut and select Switch Control.
  2. Download the Xcode project and run it on your iPad or iPhone.

Once the app is running, you can match two boxes with the same symbol by tapping one on the screen while Switch Control is focused on a box. Then choose Tap in the Switch Control menu. Then, select the other matching item. Repeat until all icons have been exposed to solve the challenge!

Figured out the puzzle? Post your accomplishment on Twitter with the hashtag #WWDC22Challenges. And if you’d like to discuss Switch Control and other accessibility topics, join the team at events all throughout the week at WWDC22.

Accessibility & Inclusion

Explore #WWDC22Challenges on social media

Read the WWDC22 Challenges Terms and Conditions