combine AQGridView with HJCache - aqgridview

I am trying to combine AQGridView with HJCache.
However, separately, both works fine. but i combine them together, it seems that they 're not compatible with each other.
Any one done this before? Can i have a hint?

You can use AFNetworking (https://github.com/AFNetworking/AFNetworking) which has an ImageView Category that let's you load images asynchronously.
[content.imageView setImageWithURL:thumbURL placeholderImage:[UIImage imageNamed:#"thumbnail_loading.jpg"]];
content is a view with an ImageView named 'imageview' as a subview.

Related

Integrating EgoImageLoader by using UIImageView instead of egoimageview

I'm new to objective c. Want to implement EGOIMAGELOADER for my customised tableview, but as i have mutliple uiimageview and that has to be in their respective fix position so i have created uitablecell in xib and placed the uiimageview in the alignment i want it.
I went through the ego example but there the egoimageview is being used to create imageview dynamically.
I want to use my uiimageview with egoimageloader and not use egoimageview as i have fixed placement of imageviews in uitablecell.
I want to implement lazyloading and caching of images using egoimageview.
Can anyone help me with example or sample code to achieve above requirement.
As i'm using normal code for loading images in uiimageview for tablecell. So don't know what to include for code snippet.

Working with storyboards in Xcode, how to handle massive Storyboard in iOS

I have been using the storyboard to make an application and currently there are many segues and several components. This is causing a ton of lag when I try to do anything inside the storyboard. Is there a way to hide components inside the storyboard? thanks.
+1, For the potentially features to improve Xcode. Now, there is no way you can hide those views (Not that I know). But I would suggest you to,
Hide the debug areas you don't need.
Hide the document outline while working with segues.
Why?
I think in this way whenever you are making changes, system does not have to repaint those unwanted views and long document outline. Probably this will be less laggy(I don't think there is a word like this)!
Work around
Divide your segue into different meta segues and then you can call those segues from your main segue. In that way you don't have to put each connection on one file but you condense it!
And here we go the documentation for it! Now you can get the story board by different file and then initiate with the UIViewController easily. Then you can just use old ways to segue between different ViewControllers.
Apple Documentation for UIStoryboard
Demo App.
In order to achieve this, I have made a quick demo application which will help any future visitors.
https://github.com/Krutarth/LargeStoryboardManagement
Visually something like this,
You can split one huge storyboard into multiple small storyboards.
Select the view controllers that you want to move to a smaller storyboard, then
In the top menu, click Editor -> Refactor to Storyboard
Save the new storyboard with the desired name. XCode will auto generate all the required storyboard links from your large storyboard to this newly created small one.

Flipping between views has UITableView position issue

I have a UINavigationController within a UITabBarController. Within the navigation controller I have a ViewController that looks after flipping between two views using transitionWithView:duration:options:animations:completion one of the views i am trying to show is a TableView.
The problem is when showing the TableView it is off position.
and the flip view
I have tested flipping between two standard views without issue, it is only the TableView that shows off position. Also when the Tableview has more data then can be shown on screen the bottom rows are hidden by the Tabbar. It looks like the frame size is wrong but I am not sure how to proceed to fix the problem.
Full test project and code can be found on GitHub
Any suggestions or help is greatly appreciated.
The root of the problem is that you are using UIViewControllers (FlipSide and FlipMain) as subviews for FlipController which is itself a UIViewController. Prior to iOS 5 this was not supported and inevitably led to problems. iOS 5 adds support for a view controller hierarchy but requires that you use the appropriate new methods.
You have a couple of choices: restructure the view controllers so they are not nested, rewrite the sub-controllers as UIViews, or use addChildViewController to add the subcontrollers.
I've forked and modified your original code here to illustrate that changing to UIViews resolves the problem with layout.
It's a bit hard to answer without the full code, but I would try playing with the "wantsFullScreenLayout" property of your view controllers. I say that because the offset seems to be 20px high, which corresponds to the status bar's height...
Let me know if this helped ;-)

Best way to implement "iOS Photos style" tiled image gallery

I have an app that basically can be used to download, upload, and manage photos from various web services.
I want the image list view to look like the iOS Photos app but not quite sure what the best way to do that is.
I was thinking I could use NSMutableArray and subclass UIScrollView to create that functionality from scratch but I'd really like to use NSFetchedResultsController because some of the data related to the images are dynamically/asynchronously updated/inserted/deleted in Core Data.
Right now I've setup something pretty hacky.
I created an separate Core Data entity to hold relationships to 4 photos in each managed object and I made UITableView loop through them. Then cellforrow delegate would loop through the 4 photos in each table cell. This approach sucks because it's hard to delete and insert photos dynamically and I have to reconstruct relationships and reload the table each time an update is made.
I've looked at some other libraries that do this but I really want to understand what the most simple and efficient way to do this is.
If you are referring to the tile view, you can duplicate that using a UITableView or a UIScrollView. If you want it to side scroll then a UIScrollView is the starting point.
If you want it to scroll vertically (which I recommend on iPhone) then use a UITableView with a custom UITableViewCell.
As for the Core Data side, you are probably coming at this incorrect, you are trying to store UI state information (how many photos are in a cell) in core data. Core Data should not care about how many images are in a cell.
UITableViewCell
To use a UITableView you would create an array that contains all of your images. You can then determine how many rows you need by dividing that array by the number of images per row.
From there you should subclass UITableViewCell and pass in the 4 images for that cell to draw. Then it is a simple matter of adding 4 UIImageView instances to the custom cell and setting the images.
UIScrollView
For a scrollview you crate a UIImageView for each image and then add them as subviews of the UIScrollView. You would then set the frame of each UIImageView so that they are displayed in a grid.
If you find you have more images than you can hold in memory at once then you will need to deal with tiling, effectively paying attention to where the user is scrolling and filling in (via moving the offscreen image views) ahead of the edge the user is scrolling towards. This is the same thing you get effectively for free with a UITableView via its queuing of cells.
I just did this with a UITableView - you are over thinking it with the relationships.
For my solution I created a UITableViewCell subclass has four buttons as properties.
In my cellForRow method I figure out which four images belong to that row and then set the appropriate image for the appropriate button.
My images are in an array in my view controller. I populate the array in viewDidLoad. Whenever I add or delete an image from the managedObjectContext I repopulate the array and then reload the tableview. Reloading the tableview will rearrange the images in the cell appropriately.
Scrolling is smooth and the only drawback I have run into is that I would like the images to animate to their new positions when I delete one, but I do not think that I'll be able to pull that off with this setup.
I think a very nice implementation is AQGridView.
It is easy to extends, has nice reordering (see the springboard demo) and it reuses the cell.
If you ever implemented a TableViewDelegate, you should be able to use it.
You should check out the Three20 photo viewer. The project is on github. Also, there's a nice tutorial for the photo viewer here

Adding Images in a TableView in Xcode

I tried to add images with the size of 32 by 32...it worked but it shows me only the first image for all the objects on the table view... In other words only image for all the other objects
You need to implement this in the tableView:willDisplayCell:forTableColumn:row delegate method. You should probably read the TableView Programming Guide before going further.