Post

Replies

Boosts

Views

Activity

Drag&Drop doesn't work
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() } } } }
1
0
930
Feb ’24
About face-to-face sessions
If I am a member of the Apple Developer Program, can I participate in the in-person Apple Vision Pro Developer Lab under "Meet With Apple Experts " regardless of my age or app release history? I am currently a high school student and have a little experience with visionOS development. I also have knowledge of iOS development and have worked on several apps. I am not currently in the Apple Developer Program yet, but would like to be if possible.
0
0
475
Feb ’24
What is Playground????(App develop for Swift Student Challenge)
I don't really understand the exact meaning of "Build your app playground" on the Apple Swift Student Challenge home page. Does it mean to build a game app with a normal Xcode SwiftUI project? Or is there a platform called "App Playground"? So we cannot make an app that is not a game or an app that is not made with a platform called "App Playground" ????????? I'm confused. If you can use Japanese, it would be helpful to answer in Japanese.
2
2
1.3k
Feb ’24
New to ARKit
Hello, I am new to ARkit. I have tried to program to display a cube using ARkit and Realitykit in various articles using Xcode, but none of them worked. How can I display a 3Dcube in AR ????? What I tried, roughly speaking, was to open the xcode iOS, AR progect file and run the program that is included by default. If you can answer in Japanese, please do so.
0
0
700
Nov ’23
Is Motion Capture(Razing hand) Possible with the iPhone Front Camera?
Hi, is there any way to use front camera to do the motion capture? I want recognize if the user raised there hands up with the front camera on iPhone. I was able to do it with the back camera, not the front. Also, if there is any sample code, or document, I would be super happy. Waiting for your reply!!
Replies
2
Boosts
0
Views
549
Activity
Feb ’25
Drag&Drop doesn't work
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() } } } }
Replies
1
Boosts
0
Views
930
Activity
Feb ’24
What's the difference
I have a few questions about the Swift Student Challenge development tools. What is the difference between swift playground and Xcode playground? Also, is it possible to develop vision OS in the playground?
Replies
2
Boosts
0
Views
3.8k
Activity
Feb ’24
About face-to-face sessions
If I am a member of the Apple Developer Program, can I participate in the in-person Apple Vision Pro Developer Lab under "Meet With Apple Experts " regardless of my age or app release history? I am currently a high school student and have a little experience with visionOS development. I also have knowledge of iOS development and have worked on several apps. I am not currently in the Apple Developer Program yet, but would like to be if possible.
Replies
0
Boosts
0
Views
475
Activity
Feb ’24
What is Playground????(App develop for Swift Student Challenge)
I don't really understand the exact meaning of "Build your app playground" on the Apple Swift Student Challenge home page. Does it mean to build a game app with a normal Xcode SwiftUI project? Or is there a platform called "App Playground"? So we cannot make an app that is not a game or an app that is not made with a platform called "App Playground" ????????? I'm confused. If you can use Japanese, it would be helpful to answer in Japanese.
Replies
2
Boosts
2
Views
1.3k
Activity
Feb ’24
New to ARKit
Hello, I am new to ARkit. I have tried to program to display a cube using ARkit and Realitykit in various articles using Xcode, but none of them worked. How can I display a 3Dcube in AR ????? What I tried, roughly speaking, was to open the xcode iOS, AR progect file and run the program that is included by default. If you can answer in Japanese, please do so.
Replies
0
Boosts
0
Views
700
Activity
Nov ’23