lib/walt/asset/image.rb in walt-0.1 vs lib/walt/asset/image.rb in walt-0.1.2

- old
+ new

@@ -1,5 +1,7 @@ +motion_require "asset" + =begin { url: "http://mysite.com/pic.jpg" } =end @@ -24,9 +26,12 @@ @view = UIImageView.alloc.initWithFrame(CGRectZero) @view.frame = [self.position || CGPointZero, self.size || CGSizeZero] @view.contentMode = self.view_content_mode @view.clipsToBounds = self.clips_to_bounds url = NSURL.URLWithString(self.url) + if !@view.respond_to?("af_imageRequestOperation") + raise "You need to add the AFNetworking pod for remote images" + end @view.setImageWithURLRequest(NSURLRequest.requestWithURL(url), placeholderImage:nil, success: lambda {|request, response, image| @view.image = image if !self.size \ No newline at end of file