Skip to content
This repository has been archived by the owner on Aug 1, 2019. It is now read-only.

Crash when attempted to send the collection of images #142

Open
dodikk opened this issue Jul 19, 2017 · 2 comments
Open

Crash when attempted to send the collection of images #142

dodikk opened this issue Jul 19, 2017 · 2 comments

Comments

@dodikk
Copy link

dodikk commented Jul 19, 2017

open override func onSendButtonTapped(havingText currentText: String)
{  
        _ = self.sendText(currentText, isIncomingMessage: false)

        if let selectedImages = self.controller?.selectedImages
        {
            let imageViews = selectedImages.map { UIImageView(image: $0) }
            _ = super.sendCollectionViewWithViews(
                imageViews,
                numberOfRows: 1.0,
                isIncomingMessage: false)
       }
}

screen shot 2017-07-19 at 11 18 03 am

@dodikk
Copy link
Author

dodikk commented Jul 19, 2017

After fixing this optional dereference, I'm unable to configure image cell size.
#144

simulator screen shot jul 19 2017 4 15 52 pm

                let imageSize =
                    CGSize(
                        width: 200,
                        height: 200)
                
                let nodes: [ASDisplayNode] =
                    selectedImages.map
                    {
                        image -> ASImageNode in
                        
                        let blockResult = ASImageNode()
                            blockResult.image      = image
                            blockResult.forcedSize = imageSize
                            blockResult.contentMode = .scaleAspectFit
                            blockResult.forceUpscaling = true
                            blockResult.backgroundColor = UIColor.magenta
                        
                        
                        return blockResult
                    }
                
                _ = super.sendCollectionViewWithNodes(
                    nodes,
                    numberOfRows: 1.0,
                    isIncomingMessage: false)

@dodikk
Copy link
Author

dodikk commented Jul 20, 2017

Fixed in #145

dodikk pushed a commit to dodikk/NMessenger that referenced this issue Jul 20, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant