Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WrappingHStack crashes in iOS 16 for iPhone but not iPad #28

Closed
quinn305 opened this issue Oct 7, 2022 · 5 comments
Closed

WrappingHStack crashes in iOS 16 for iPhone but not iPad #28

quinn305 opened this issue Oct 7, 2022 · 5 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@quinn305
Copy link

quinn305 commented Oct 7, 2022

Describe the bug
A clear and concise description of what the bug is.

WrappingHStack crashes in iOS 16 for iPhone but not iPad. When a Navigation Link to a View using WrappingHStack is clicked, this happens on all iOS 16 iPhone versions tried

@quinn305 quinn305 added bug Something isn't working help wanted Extra attention is needed labels Oct 7, 2022
@theedov
Copy link

theedov commented Oct 8, 2022

Looks like we have a similar issue?
#27

@quinn305
Copy link
Author

quinn305 commented Oct 8, 2022

@ViewBuilder
func DragArea() -> some View {

    WrappingHStack(shuffledWords, id: \.self, alignment: .center) { item in
        
        Text("\(item.word)")
            .blueBackground()
            .overlay(RoundedRectangle(cornerRadius: 15).style(
                withStroke: Color.white,
                lineWidth: 10,
                fill: item.isPlaced ? Color.gray: Color.clear
            ))
            //MARK: Adding Drag Operation
            .onDrag {
                print(item.id!)
                return .init(contentsOf: URL(string: item.id!))!
            }
            
            
    }
    
}

@ViewBuilder
func DropArea() -> some View {
    
    WrappingHStack($dragdropWords, id: \.self, alignment: .center) { $item in
        Text("\(item.word)")
            .blueBackground()
            .overlay(RoundedRectangle(cornerRadius: 15).style(
                withStroke: Color.white,
                lineWidth: 10,
                fill: !item.isPlaced ? Color.gray: Color.clear
            ))
            
            .onDrop(of: ["public.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(dragdropWords.count))
                            withAnimation {
                                item.isPlaced = true
                                updateShuffledArray(dragDropWord: item)
                                self.progress = progress
                            }
                        }
                         
                    }
                }
                
                return false
            }
    }
    
}

@quinn305
Copy link
Author

quinn305 commented Oct 8, 2022

Above is my code using WrappingHStack. Perhaps we do have similar issue

@theedov
Copy link

theedov commented Oct 17, 2022

I guess this package is dead since owner removed their assignment from all reported bugs without any comments.

@dkk
Copy link
Owner

dkk commented Oct 19, 2022

Closing for now, if you still have this issues 2.2.3, please reopen.

@dkk dkk closed this as completed Oct 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants