Closed iAlirezaKML closed 7 years ago
@peymayesh: Could you create a sample project please? cmd + D on your project folder and then remove any unnecessary code.
@hannahmbanana It's not a big deal, Just replace this code in application:didFinishLaunchingWithOptions:
and put the attached icons in your Assets.xcassets
.
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
window = UIWindow(frame: UIScreen.mainScreen().bounds)
window?.rootViewController = ViewController()
window?.makeKeyAndVisible()
return true
}
@hannahmbanana I've attached the exact sample project you wanted.
I really appreciate if you can tell me what should I do. I'm playing with threads and GCD
for two days, but I couldn't make it work :(
NetworkImageButtonNode.zip
@peymayesh Hi! Sorry this one slipped through the cracks.
I believe the issue here is that you're accessing self.layer
inside ASDisplayNode.init()
which is called on a background thread sometimes – such as when using ASCellNode
. If you move all the CABasicAnimation
and CALayer
related code out from init
and into didLoad
(which is always run on the main thread) you will stop hitting that assertion.
If you have more questions, please check out our Slack which has a ton of helpful people working together http://asyncdisplaykit.org/slack . Cheers!
I've created a subclass of
ASMultiplexImageNode
which has a button to control download and show progress. When using it inside a simple view (node
), it works fine. But when using it insideASCellNode
, confrontingAssertion failure in ... ASDisplayNode.mm:520
thenTerminating app due to uncaught exception 'NSInternalInconsistencyException', reason: ''
.I've commented the working code inside of simple
node
inViewController
class.\ Also There is another problem (I think),
multiplexImageNode:didStartDownloadOfImageWithIdentifier:
get called once for thumb image and twice for the original image.Here's the code: