{"action":"opened","issue":{"url":"https://api.github.com/repos/facebook/AsyncDisplayKit/issues/1380","repository_url":"https://api.github.com/repos/facebook/AsyncDisplayKit","labels_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/issues/1380/labels{/name}","comments_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/issues/1380/comments","events_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/issues/1380/events","html_url":"https://github.com/facebook/AsyncDisplayKit/issues/1380","id":140987973,"number":1380,"title":"[ASLayoutSpec] Side by side ASNetworkImageNode was overlapped until you scroll","user":{"login":"hebertialmeida","id":103670,"avatar_url":"https://avatars.githubusercontent.com/u/103670?v=3","gravatar_id":"","url":"https://api.github.com/users/hebertialmeida","html_url":"https://github.com/hebertialmeida","followers_url":"https://api.github.com/users/hebertialmeida/followers","following_url":"https://api.github.com/users/hebertialmeida/following{/other_user}","gists_url":"https://api.github.com/users/hebertialmeida/gists{/gist_id}","starred_url":"https://api.github.com/users/hebertialmeida/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hebertialmeida/subscriptions","organizations_url":"https://api.github.com/users/hebertialmeida/orgs","repos_url":"https://api.github.com/users/hebertialmeida/repos","events_url":"https://api.github.com/users/hebertialmeida/events{/privacy}","received_events_url":"https://api.github.com/users/hebertialmeida/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-03-15T14:23:39Z","updated_at":"2016-03-15T14:23:39Z","closed_at":null,"body":"I have a `ASCellNode` with two photos, they are aligned Horizontally and when it loads it was overlapped, until you scroll down and the tableView calls `tableView(tableView: ASTableView, willBeginBatchFetchWithContext context: ASBatchContext)`, the new cell loads normally.\r\n\r\nInitial load:\r\n![fullsizerender](https://cloud.githubusercontent.com/assets/103670/13780723/75d37282-ea9f-11e5-9313-ae59987b975b.jpg)\r\n\r\nAfter scroll (How should be):\r\n![fullsizerender 2](https://cloud.githubusercontent.com/assets/103670/13780756/9253579c-ea9f-11e5-8bfe-276362635e2d.jpg)\r\n\r\nOn `PhotoCardNode` I implement the `ASNetworkImageNodeDelegate` to `self.setNeedsLayout()` when the image finish loading, if I don't call `self.setNeedsLayout()` it works but the image ratio is wrong.\r\n![fullsizerender 3](https://cloud.githubusercontent.com/assets/103670/13780818/c66c04ca-ea9f-11e5-8652-ff5882ba585b.jpg)\r\n\r\nThis is my full class if it helps.\r\n`final class PhotoCardNode: ASControlNode, ASNetworkImageNodeDelegate {\r\n    var imageOne: ASNetworkImageNode!\r\n    var imageTwo: ASNetworkImageNode!\r\n    \r\n    init(withURLs: [String]) {\r\n        super.init()\r\n        \r\n        imageOne = createImageNode(imageWithURL: withURLs[0])\r\n        imageTwo = createImageNode(imageWithURL: withURLs[1])\r\n    }\r\n    \r\n    override func layoutSpecThatFits(constrainedSize: ASSizeRange) -> ASLayoutSpec {\r\n        super.layoutSpecThatFits(constrainedSize)\r\n        \r\n        let imageOneSpec = imageRatio(imageOne)\r\n        let imageTwoSpec = imageRatio(imageTwo)\r\n        imageOneSpec.flexBasis = ASRelativeDimensionMakeWithPercent(0.5)\r\n        imageTwoSpec.flexBasis = ASRelativeDimensionMakeWithPercent(0.5)\r\n        \r\n        return ASStackLayoutSpec(\r\n            direction: .Horizontal,\r\n            spacing: 5,\r\n            justifyContent: .Start,\r\n            alignItems: .Stretch,\r\n            children: [imageOneSpec, imageTwoSpec])\r\n    }\r\n    \r\n    // MARK: - ASNetworkImageNodeDelegate\r\n    \r\n    func imageNode(imageNode: ASNetworkImageNode, didLoadImage image: UIImage) {\r\n        self.setNeedsLayout()\r\n    }\r\n\r\n    // MARK: - Node functions\r\n\r\n    func createImageNode(imageWithURL URL: String) -> ASNetworkImageNode {\r\n        let image = ASNetworkImageNode()\r\n        image.backgroundColor = ASDisplayNodeDefaultPlaceholderColor()\r\n        image.delegate = self\r\n        image.URL = NSURL(string: URL)\r\n        addSubnode(image)\r\n        return image\r\n    }\r\n    \r\n    func imageRatio(imageNode: ASNetworkImageNode) -> ASRatioLayoutSpec {\r\n        if let image = imageNode.image {\r\n            let imageSize = image.size\r\n            return ASRatioLayoutSpec(ratio: imageSize.height / imageSize.width, child: imageNode)\r\n        }\r\n        return ASRatioLayoutSpec(ratio: 0.5, child: imageNode)\r\n    }\r\n}\r\n`\r\n\r\nI have tried issue #718 and #1232 but I can't fix the problem.\r\n\r\nThanks"}}