Hey, I am the winner of WWDC20 Swift Student Challenge, I was recently checking out my account hoping to find Events tab to find my winner badge there, but the whole section is gone. I was wondering if anyone can help me in finding out the updated or similar version of the Events section in this website :)
Swift Student Challenge
RSS for tagAsk questions and connect with other challenge applicants.
Posts under Swift Student Challenge tag
44 Posts
Sort by:
Post
Replies
Boosts
Views
Activity
Hello,
My App Playground uses a text file to work properly. I've had no issues running the app on Simulator, but it fails to find the file when being run on my physical iPhone. Has anyone had the same issue? Any idea what the problem is?
Thanks for the help!
I am developing my app for the Swift Student Challenge 2024. I have made significant progress on it and have been building it on a M1 Mac, where it works perfectly. However, when testing it on some iPads (specifically, the iPad Pro 2018 and iPad Air 5 M1), it did not perform well on these devices.
I am wondering if I can specify whether the app should be reviewed on a Mac (M1 or later) or if it will be reviewed on an iPad.
Hi! I'm preparing to apply for the Swift Student Challenge and had a question, how can I find info.plist in Xcode 15.2 playground I will do a game AR game and I need info.plist to access to camera so how can I find info.plist ?
Hi! I'm preparing to apply for the Swift Student Challenge and had a question.
In the terms and conditions, it says
"Your app playground must be built with and run on Swift Playgrounds 4.4 or later (requires iPadOS 16 or macOS 13.5) or Xcode 15 on macOS 13.5 or later. You may incorporate the use of Apple Pencil."
Does this mean that my app must run on iPadOS 16 or macOS 13.5, or can it run on iPadOS 17 or macOS 14 or later as long as it runs on Playgrounds 4.4?
In other words, what should I set my Deployment Target to?
Thanks for your help in advance 😜
Hello everyone,
Is there a way to set the minimum deployment target in Xcode Playground?
Hello,
For the past month, I've been learning to use UIKit on Xcode to prepare for the Swift Student Challenge. However, I can't find a way to use my newly acquired skills in App Playgrounds. Do they strictly require SwiftUI? Is there a way to use UIKit and Storyboards?
Hello everyone,
Is there a better solution than my approach out there to convert an image to data and back?
@Model
class User {
var name: String
@Attribute(.externalStorage) var image: Data?
var createdAt: Date
init(name: String, image: Data, createdAt: Date = .now) {
self.name = name
self.image = image
self.createdAt = createdAt
}
}
if let selectedPhotoData = imageData,
let uiImage = UIImage(data: selectedPhotoData) {
Image(uiImage: uiImage)
.resizable()
.scaledToFill()
.frame(width: 300, height: 300, alignment: .center)
.clipShape(Circle())
}
.task(id: selectedPhoto) {
if let data = try? await selectedPhoto?.loadTransferable(type: Data.self) {
imageData = data
}
}
I am trying to implement a ML model with Core ML in a playground for a Student Challenge project, but I can not get it to work. I have already tried everything I found online but nothing seems to work (the tutorials where posted long time ago). Anyone knows how to do this with Xcode 15 and the most recent updates?
HELLO, I am new to swift ,I want to make a arkit based app for swift student challenge should I make it on playground or Xcode
Hi!
I'm participating in the Swift Student Developer competition this year, which requires developers to present a Swift Playground to Apple. I'm used to making normal Xcode projects, and am having trouble finding a Swift Playgrounds version of the Copy Bundle Resources build phase (I don't think it is possible to edit build phases in a Swift Playground).
I created a '.usdz' file from a 3D model I designed using Reality Converter and added it to the root of my Swift Playground project. I access the file programmatically from the App Bundle like so (fileName is a non-nullable String):
guard let path = Bundle.main.path(forResource: fileName, ofType: "usdz") else { fatalError("Couldn't find the USDZ file.") }
At runtime, this throws the Couldn't find the USDZ file error, as the file isn't being copied to the App Bundle.
In a normal Xcode project, according to this StackOverflow question, I can get xcodebuild to copy my file over by specifying it in the Copy Bundle Resources build phase, however, in a Swift Playground (required by Apple), I am restricted from modifying Xcode's buildphases (the option is not present when clicking on the default target - the only options are General, Signing & Capabilites and Package Dependencies).
How can I ensure that resources are copied over to the App Bundle at buildtime in a Swift Playground?
If this is not possible, are there any other options besides using the Bundle.main.path API for accessing the USDZ file (to load a QuickLook preview) at runtime?
Hi,
I stumbled about the Swift Student Challenge at Apples Website and now I have some questions. I've programmed some Apps in Xcode and I think one of them might be pretty god for this Challenge. Now I've read something about Swift Playgrounds and I'm confused. What's a Swift Playground? Do I need to create one or is it enough to have the App? and finally: I'm currently 14 and live in Germany. Is it possible to participate when I'm 14? And if not would it be a big thing to lets say forget my age and somehow think that I'm 16?
Thanks a lot for answers
I am currently working on my project for the Swift Student Challenge 2024. I am trying to implement a feature (.defaultScrollAnchor on a ScrollView in this instance). However, when trying to build/run the app in Xcode it says that .defaultScrollAnchor is only compatible with iOS 17. If I try to use .scrollPosition(initialAnchor: ), it also doesn't work (likely because it has been depreciated). I printed the system version as suggested in another post, and it showed the simulator was running iOS 17.2. Why can't the app build/run with this feature if the simulator is running iOS 17.2?
MacBook Pro 14" 2021 M1 Pro
Xcode Version 15.1
macOS Sonoma 14.0
These are the three views in my to do list project.
I want to save data, so users' to do list will still be there after they launch the app.
But whenever I click on the icon "check.circle' or "circle", they cannot switch immediately. They will switch after I launch the app again.
I don't know how to let icon switched immediately.
Thanks in advance!!!
// Content View
import SwiftUI
struct ContentView: View {
@EnvironmentObject var listViewModel: ListViewModel
@State var newText: String = ""
@State var detents: PresentationDetent = .medium
@State var showSheet: Bool = false
static var item1 = ItemModel(title: "First", isCompleted: false)
var body: some View {
NavigationView {
List {
ForEach(listViewModel.items) { item in
ListRowView(item: item)
.onTapGesture {
listViewModel.updateItem(item: item). -> *
}
}
.onDelete(perform: listViewModel.delete)
.onMove(perform: listViewModel.moveItem)
}
.navigationTitle("To Do List")
.navigationBarItems(
leading: EditButton(),
trailing: Button(
action: {
showSheet.toggle()
}, label: {
Text("Add")
})
.sheet(
isPresented: $showSheet,
content: {
SecondScreen()
.presentationDetents([.height(500)])
}
))
}
}
}
// List View Model -> *
func saveItems() {
if let encodedData = try? JSONEncoder().encode(items) {
UserDefaults.standard.set(encodedData, forKey: itemsKey)
}
}
// Item Model
import Foundation
struct ItemModel: Identifiable, Codable {
let id: String
let title: String
var isCompleted: Bool
init(id: String = UUID().uuidString, title: String, isCompleted: Bool) {
self.id = id
self.title = title
self.isCompleted = isCompleted
}
func updateCompletion() -> ItemModel {. -> *
return ItemModel(id: id, title: title, isCompleted: !isCompleted)
}
}
The error shown in the picture appears when I try to link the StartScene.sks file to the code
Attached are pictures of the code
Please help me🙏🏻
Hello, someone told me that I can get a programming certificate when I complete (Learn to Code 1) from the Swift Playground application, is this true?? And if it is true, how do I get it?
On the swift student challenge page it says "Your app playground must be built with and run on Swift Playgrounds 4.2.1 or later (requires iPadOS 16 or macOS 13) or Xcode 14 on macOS 13." Could I build it with Xcode in a swift.pm file but ask for it to be viewed on iPhone?
Hello, i am working on my project for the Swift Student Challenge and it came to my attention that the project must be built using Swift Playgrounds. I have run into an issue where I want to add multiple views to my project but it seems i am unable. How am i supposed to do this?
I want to make it like this
How to disable the button that open the side bar, I only need the content and the detail view. I don't need the sidebar view.
Below is my code
import SwiftUI
@available(iOS 16.0, *)
struct Screen: View {
@ObservedObject var userData = UserData()
@State private var isIntroShown = true
@State var Itema: Bool = false
@State private var showFoodDetail = false
@State var rb: Bool = false
@State var Setting: Bool = false
@State var Recipe: Bool = false
@Environment(\.defaultMinListRowHeight) var minRowHeight
@Environment(\.colorScheme) var colorScheme
@State private var searchText = ""
private let adaptiveColumns = [
GridItem(.adaptive(minimum: 170))
]
var columns = Array(repeating: GridItem(.flexible(), spacing: 10), count: 2)
var filteredRooms: [Room] {
if searchText.isEmpty {
return userData.rooms
} else {
return userData.rooms.filter { room in
let foodNames = room.food.map { $0.name.lowercased() }
return room.name.lowercased().contains(searchText.lowercased()) ||
foodNames.contains { $0.contains(searchText.lowercased()) }
}
}
}
@State private var columnVisibility = NavigationSplitViewVisibility.doubleColumn
var body: some View {
NavigationSplitView (columnVisibility: $columnVisibility){
} content: {
ScrollView{
GridView()
.padding(.horizontal)
.padding(.bottom, 20)
}.toolbar {
ToolbarItem(placement: .bottomBar){
Button(action:{self.Itema = true}) {
HStack {
Image(systemName: "plus.circle.fill").resizable().frame(width: 20, height: 20).foregroundColor(.white)
Text("New Item").foregroundColor(.white).bold()
}
}
.sheet(isPresented: self.$Itema){
NewItem(userData: self.userData)
}
}
ToolbarItem(placement: .bottomBar){
Button(action:{self.rb = true}) {
HStack {
Text("New Room").foregroundColor(.white)
}
}
.sheet(isPresented: self.$rb){
NewRoom(userData: self.userData)
}
}
ToolbarItem(placement: .navigationBarTrailing){
Button(action:{self.Setting = true}) {
HStack {
Image(systemName: "gear").foregroundColor(.white)
}
}
.sheet(isPresented: self.$Setting){
NavigationView {
NewItem( userData: userData)
.navigationBarItems(trailing:Button(action: {
self.Setting = false
}){
Text("Done")
}
)
}
}
}
}
.background(Color(red: 203/255, green: 237/255, blue: 207/255))
} detail: {
ZStack {
Text("")
}
.frame(maxWidth: .infinity, maxHeight: .infinity)
.background(Color(red: 220/255, green: 247/255, blue: 234/255))
}
.searchable(text: $searchText)
}
}
My while loop continues execution after reaching gemsCollected = 3 if I use OR logical operator (||) and stops execution if I use AND logical operator (&&).
IMHO it should be the other way around, right?
var gemsCollected = 0
var switchesToggled = 0
while gemsCollected < 3 || switchesToggled < 4 {
moveForward()
if gemsCollected < 3 && isOnGem {
collectGem()
gemsCollected = gemsCollected + 1
} else if switchesToggled < 4 && isOnClosedSwitch {
toggleSwitch()
switchesToggled = switchesToggled + 1
} else if isBlocked && !isBlockedRight {
turnRight()
} else if isBlocked && !isBlockedLeft {
turnLeft()
}
}