Permalink
Browse files

Improve image saving performance

  • Loading branch information...
1 parent 6951b29 commit 061709faed35677734c30be6e3e683275b6b0ef4 @satococoa committed Feb 9, 2013
Showing with 2 additions and 1 deletion.
  1. +2 −1 app/photos_controller.rb
View
@@ -38,14 +38,15 @@ def viewDidAppear(animated)
# BubbleWrap の #picture メソッドの仕様により、これで回避
if @image
open_tweet(@image)
+ @saving_image = @image
Dispatch::Queue.concurrent.async {
@friends = [Friend.new] + @friends
path = NSIndexPath.indexPathForRow(0, inSection:0)
Dispatch::Queue.main.async {
collectionView.insertItemsAtIndexPaths([path])
+ Friend.save_with_image(@saving_image)
}
}
- Friend.save_with_image(@image)
@image = nil
end
end

0 comments on commit 061709f

Please sign in to comment.