ios – Overlapping UIImageViews on display screen: choose the suitable view


I’m creating an iPhone app during which the consumer faucets buildings on a picture of an MRI scan to pick areas of curiosity and calculate a rating. Every display screen accommodates a UIView with a number of UIImage views. Every UIImageView that’s touched by the consumer is “highlighted”. Nonetheless, on one of many screens the buildings of curiosity are so shut collectively that the body rectangles of the UIImageView overlap (3 of them). Now, tapping in some areas highlights the incorrect picture. Rearranging views doesn’t assist (transferring to entrance or again) does not assist, there’s a massive space of overlap. I included a display screen shot of the Storyboard and corresponding code of the view controller. Can anyone consider an answer??
enter image description here
override func touchesBegan(_ touches: Set, with occasion: UIEvent?)
{

    let contact = touches.first!
    
    swap contact.view {
        
    case PO_PV_R:
        if PO_PV_R.isHighlighted == false
        {
            PO_PV_R.isHighlighted = true
            loesScore.parieto_occipital_R_perivent = 0.5
        }
        else
        {
            PO_PV_R.isHighlighted = false
            loesScore.parieto_occipital_R_perivent = 0.0
        }
    
    case PO_C_R:
        if PO_C_R.isHighlighted == false
        {
            PO_C_R.isHighlighted = true
            loesScore.parieto_occipital_R_central = 0.5
        }
        else
        {
            PO_C_R.isHighlighted = false
            loesScore.parieto_occipital_R_central = 0.0
        }
        
    case PO_SC_R:
        if PO_SC_R.isHighlighted == false
        {
            PO_SC_R.isHighlighted = true
            loesScore.parieto_occipital_R_subcortical = 0.5
        }
        else
        {
            PO_SC_R.isHighlighted = false
            loesScore.parieto_occipital_R_subcortical = 0.0
        }
        
    default:
        print("default")
        
    }
    
    let rating = loesData.shared.totalLoesScore()
    scoreLabel.textual content = String(format:"%.1f", rating)
    
}

Similar Posts

Leave a Reply

Your email address will not be published.