Swift Student Challenge

RSS for tag

Ask questions and connect with other challenge applicants.

Swift Student Challenge Documentation

Posts under Swift Student Challenge tag

109 Posts
Sort by:
Post not yet marked as solved
1 Replies
458 Views
Hello, I’ve been trying to play system sounds in my app, but this hasn’t really been working. I am frequently switching between speech recognition (Speech framework) and sounds, so perhaps that’s where the issue lies. However, despite my best efforts, I haven't been able to solve the issue. I've been resetting the AVAudioSession category before playing a sound or starting speech recognition (as depicted in the code snippet below), to no avail. Has this happened to anyone else? Does anybody know how to fix the issue? recognizer = nil try? AVAudioSession.sharedInstance().setCategory(.playback, mode: .default, options: []) try? AVAudioSession.sharedInstance().setActive(true) AudioServicesPlaySystemSound(1113) try? AVAudioSession.sharedInstance().setCategory(.record, mode: .spokenAudio, options: []) try? AVAudioSession.sharedInstance().setActive(true) recognizer = SpeechRecognition(word: wordSheet) recognizer!.startRecognition() Thank you.
Posted
by
Post not yet marked as solved
1 Replies
405 Views
Hey, everyone! I've been testing my .swiftpm app on an iPhone. If you're wondering about how I made the connections, I used a cable plugged into my Mac so that Xcode could communicate with the phone. Do you think that evaluators of the app will be alright with this method of testing it out as well? I'm particularly leaning towards the iPhone platform because my app requires a pedometer. Thanks! Ethan
Posted
by
Post not yet marked as solved
1 Replies
426 Views
Hello! For my Swift Student Challenge 2024 Project I'm using some Illustrations from OpenDoodles (opendoodles.com). Open doodles is free for commercial and personal use and the creator has no copyright claimed. My question is whether I have to clarify the use of these Illustration when submitting the project.
Posted
by
Post not yet marked as solved
2 Replies
423 Views
I'm looking through all the latest posts to clarify a doubt I have, I noticed @eskimo's response claiming that the app must be built and run on iPadOS 16 or later. So I suppose it's okay to create an app that has SwiftData as the framework even if that dictates that the app will run on iOS 17; Also because when you create a new project in Swift Playgrounds 4.4.1 (latest version available at the moment) the target is set to iOS 17.2 automatically and technically you can't edit Package.swift file manually. Thanks in advance ❤️
Posted
by
Post marked as solved
1 Replies
271 Views
Hi, I am a Japanese student entering the swift student challenge this year. Will Apple be able to recognize my ID card, which is in JAPANESE, as a proof of my enrollment? The submission page states that To verify your student status, provide a PDF, PNG, or JPEG of your class schedule, other proof of enrollment, or proof of graduation within the past 6 months. Make sure the documentation clearly shows: Your name, The organization or school name, and The dates showing that it’s valid. In my ID. card, my name is written in Japanese , but other texts have subtitles in English, such as "Date of Birth" written under the Japanese. It also does not say the name of the school in English, only Japanese.
Posted
by
Post not yet marked as solved
1 Replies
247 Views
I'm creating a playground for SSC, and I'm using a lot of the new frameworks and capablities introduced in WWDC 2023, including @Observation, SwiftData, phaseAnimator...etc. Checking the forums just now, I see some people claiming the app should run on iOS 16 as well, so I revert the deployment destination from iOS 17 to iOS 16 in Package.swift, and now I have 150+ errors in my app playground. I know I can use #if available to write alternative code for earlier iOS versions but it feels like a redundancy since the app will be judged by Apple engineers who most likely have iOS 17 running on their devices, and since the judging process, I assume, takes into account the number of new technologies utilised. Should I write '#if available else' statements for the entire app playground, keep the deployment destination as iOS 17, or change the technologies used to iOS 16 or earlier (@observed object, CoreData...etc)? Which option is safer given that I only have less than 5 days left?
Posted
by
Post not yet marked as solved
3 Replies
399 Views
My app looks the best when it's run on an iPhone simulator, since that is what I was targeting from the start. I’m aware that an Xcode app playground submission will be run on MacOS in the Simulator only, but is there a way for me to limit/ask the Simulator to only use the iPhone? I'm seeing a few posts on this forum giving the impression that submissions will primarily be run on either the iPad, or Swift Playgrounds on Mac. Furthermore, my app depends a lot on some of the new iOS 17 features (SwiftData, @Observable macros, etc.) I followed this thread to modify my Package.swift file to target iOS 17 and above only. Is this still a good idea, or should I instead wrap the whole app in a if #available version check?
Posted
by
Post not yet marked as solved
1 Replies
372 Views
Hi everyone! I'm working on an app to submit to the Swift Student Challenge this year and wanted to get some feedback on my plan to use MapKit. I know Apple is pretty open to using any of their frameworks for the contest. But I wanted to see if anyone had insights on whether my use of MapKit would comply with the contest rules and eligibility criteria. Any thoughts or advice you have on properly leveraging MapKit for my submission would be much appreciated! I want to make sure I avoid any issues since this framework is so integral to my app idea. Let me know if you have built a map-based app for Swift Student Challenge before as well. Thanks!
Posted
by
Post not yet marked as solved
4 Replies
341 Views
Hey everyone, I'm making a Playground targeting specifically iPadOS. I've read the Terms and Conditions and it says it will be run on iPad OS 16 and newer. Does anyone know if this means 16.6 or truly 16.0? I have a view modifier which is only supported in 16.4 in later.
Posted
by
Post not yet marked as solved
0 Replies
398 Views
Im making an app that uses drag&drop but, it doesn't work. This is made with Swift Playground. If you can find a solution, please let me know. Here is the code. //MARK: Drop Area @ViewBuilder func DropAera()->some View{ VStack(spacing: 12){ ForEach($rows,id:\.self){$row in HStack(spacing: 10){ ForEach($row){$item in Text(item.value) .font(.system(size: item.fontSize)) .padding(.vertical,5) .padding(.horizontal,item.padding) .opacity(item.isShowing ? 1 : 0) .background{ RoundedRectangle(cornerRadius: 6, style: .continuous) .fill(item.isShowing ? .clear : .gray.opacity(0.25)) } .background{ // If Item is Dropped into Correct Plase RoundedRectangle(cornerRadius: 6, style: .continuous) .stroke(.gray) .opacity(item.isShowing ? 1 : 0) } // MARK: Adding Drop Operation // MARK: Adding Drag Drop Operation .onDrop(of: [.url], isTargeted: .constant(false)) { providers in if let first = providers.first{ let _ = first.loadObject(ofClass: URL.self) { value,error in guard let url = value else{return} if item.id == "\(url)"{ droppedCount += 1 let progress = (droppedCount / CGFloat(characters.count)) withAnimation{ item.isShowing = true updateShuffledArray(character: item) self.progress = progress } } else{ //Animating When Wrong text animateView() } } } return false } } } if rows.last != row{ Divider() } } } } @ViewBuilder func DragArea()->some View{ VStack(spacing: 12){ ForEach(shuffledRows,id: \.self){row in HStack(spacing: 10){ ForEach(row){item in Text(item.value) .font(.system(size: item.fontSize)) .padding(.vertical,5) .padding(.horizontal,item.padding) .background{ RoundedRectangle(cornerRadius: 6, style: .continuous) .stroke(.gray) } // MARK: Adding Drag Drop Operation .onDrag{ // Returning ID to find whitch Item is Moving return .init(contentsOf: URL(string: item.id))! } .opacity(item.isShowing ? 0 : 1) .background{ RoundedRectangle(cornerRadius: 6, style: .continuous) .fill(item.isShowing ? .gray.opacity(0.25) : .clear) } } } if shuffledRows.last != row{ Divider() } } } }
Posted
by
Post marked as solved
5 Replies
522 Views
I am currently working on a project for the Swift Student Challenge. One part of the app is for visualizing goals with a chart created using Swift Charts. In the app, you log your progress for the goal and then it should show up in the chart. My issue is that the data is not showing after it has been logged. Here are some code snippets: Code For Chart View Chart { let currentDate = Date.now BarMark ( x: .value("Day", "Today"), y: .value("Score", goalItem.getLogItemByDate(date: currentDate).score) ) } .frame(maxHeight: 225) .padding() GoalItem Data Object public class GoalItem: Identifiable { public var id: String var name: String var description: String var logItems: [String: GoalLogItem] init(name: String, description: String) { self.id = UUID().uuidString self.name = name self.description = description self.logItems = [:] } func log(date: Date, score: Double, notes: String) { self.logItems[dateToDateString(date: date)] = GoalLogItem(date: date, score: score, notes: notes) } func getLogItemByDate(date: Date) -> GoalLogItem { let logItem = self.logItems[dateToDateString(date: date)] if logItem != nil { return logItem! } else { return GoalLogItem(isPlaceholder: true) } } } After logging something using the GoalItem.log method, why does it not show up in the chart? Are the variables not updated? If so, how would I get the variables to update? Thanks
Posted
by
Post not yet marked as solved
1 Replies
420 Views
Hello, The appearance of one of my buttons is not updating after being tapped. I have had no trouble doing the exact same thing in my other views, but here it simply doesn't work. The "heart" button will keep its original appearance (in this case an unfilled heart) no matter what, despite my print statements indicating that the value has changed. The other actions performed when tapping the heart work perfectly. I've been at it for hours. Any help would be appreciated. Thanks! import SwiftUI struct SearchView: View { @State private var searchText = "" @StateObject var save = SaveWords() @State var heart: String? @State var disappear = false @State var done = true var body: some View { NavigationView { VStack { if !disappear { SearchBarView(text: $searchText) Spacer() } if searchText != "" { List(.constant(Array(FetchWord.getWordFromStart(start: searchText)).prefix(10).map {Word(word: $0.1)})) { suggestion in NavigationLink(destination: suggestion.IPA.wrappedValue == "error" ? AnyView(EmptyView()) : AnyView(PracticeView(wordSheet: suggestion) .onAppear { disappear = true if done { SaveWords.file = "Favorites" DispatchQueue.main.async { Task { try? await save.load() heart = save.words.contains(suggestion.wrappedValue) ? ".fill" : "" } } } } .onDisappear { disappear = false Task { SaveWords.file = "History" try? await save.load() if save.words.first != suggestion.wrappedValue { save.words.insert(suggestion.wrappedValue, at: 0) try? await save.save() } } } .toolbar { ToolbarItem(placement: .navigationBarTrailing) { Button(action: { SaveWords.file = "Favorites" done = false if heart == "" { heart = ".fill" DispatchQueue.main.async { Task { try? await save.load() if !save.words.contains(suggestion.wrappedValue) { save.words.insert(suggestion.wrappedValue, at: 0) try? await save.save() } } } } else { heart = "" DispatchQueue.main.async { Task { try? await save.load() try? await save.delete(wordToDelete: suggestion.wrappedValue) try? await save.save() } } } done = true }, label: { Image(systemName: "heart" + (heart ?? "")) }) } }) ) { if suggestion.IPA.wrappedValue != "error" { CardView(wordSheet: suggestion) } } } } } Spacer() } } } #Preview { SearchView() }
Posted
by
Post marked as solved
1 Replies
495 Views
Hi, I want to add a SwiftData model to my Swift Playground in Xcode 15.2, but I get errors related to iOS version, has anyone encountered this? Thanks import Foundation import SwiftData struct testStruct: Identifiable { let id = UUID() var question: String var answer: String } @Model class testClass: Identifiable { let id = UUID() var question1: testStruct var question2: testStruct var question3: testStruct var question4: testStruct var question5: testStruct init(question1: testStruct, question2: testStruct, question3: testStruct, question4: testStruct, question5: testStruct) { self.question1 = question1 self.question2 = question2 self.question3 = question3 self.question4 = question4 self.question5 = question5 } }
Posted
by