iOS some problems during download multiple images and update UIProgressView - ios

I have this 3 classes.
MyViewController.m (click to see code)
MySync.m (click to see code)
ImageDownload.m (click to see code)
When I download a image, I try to update the UIProgressView in my UIViewController, but the update are delayed, and I see a strange problem (see the blank space in attach image).
When all downloads are complete and execute the method "syncComplete" of "MyViewController", the method "dismissAlertView" is not triggered :S
I hope somebody can help me.
Thanks.

Assuming that syncComplete is the one calling dismissAlertView, make sure iI is calling to the UI thread (main thread). Something like this if you use GCD:
dispatch_async (dispatch_get_main_queue (),  ^{
// call the dismissAlertView method here
}); 

Related

Disable Xcode 8 code completion for image name

Is there any way to disable code completion hints for image name in Xcode 8?
According to the manual you can't select what the code completion shows and not, since the code completion shows all the assets that it has to the apps disposal in its surrounding context. If xcode thinks it should first provide you with images from the asset catalogue, it will unfortunately do so.
You can turn the code completion of in the text editing preferences or you can toggle the code completion on and off when typing with Control-Space bar and you can dismiss the code completion with the Escape key. If you turned the code completion off in the text editing preferences you can still turn them on with Control-Space bar.
I created a snippet with the completion shortcut "in" that replaces itself with "in" to stop it from suggesting images when I'm trying to write a Swift closure. If you have other annoying use cases perhaps further snippets might help.
I've found a temporary solution by installing this plugin.
https://github.com/keith/IgnoreXcodeImageCompletions

Why does my UILabel shows up delayed about 10 seconds after everything else?

I have a problem. In my xCode project, I added a label on the main storyboard but when I actually compile and run the app, the UILabel shows up around 10 seconds after everything else. Anybody knows what could be the reason?
Thanks in advance.
You are probably populating the label text from a background thread; any updates to UI elements may have mysterious delays if you do not adjust them on the main thread. Try wrapping the code that sets the label text in a perform_async() call on the main queue...

Swift performSegueWithIdentifier delay

I have the following situation: I do a check when user touches screen, to check if it matches some bounds if menuButton.frame.contains(coordinates) {
Then, I try to push a segue like this performSegueWithIdentifier(menuButton.whichButton(menuButton.tag), sender: self) My problem is that the first time the segue performs, it has a huge delay (about 3-4 sec). Afterwards, everything runs as it should. I did check for main thread and I am in the main thread. Can you please help me?
I found the answer, as strange as it may appear, it was related with the fonts. I added some fonts, selected them in interface builder, but of course I didn't check the target membership. So the system was looking for them, I think, before reverting to default font, thus creating the lag. I hope it helps someone at some point.
Have you tried to run on a device or only in the simulator? Just to make sure...
You can try this too:
dispatch_async(dispatch_get_main_queue(),{
self.performSegueWithIdentifier(mysegueIdentifier, self)
})

FBProfilePictureView loading with delay

I'm setting the FBProfilePictureView with the user id but it takes a while, so i'd like to know if there is anything that indicates when the loading is done, so i can show an ActivityIndicator
You should take a look at SDWebImage librabry, you will be able to put a placeholder while loading your picture or add a progress indicator. I think everything you need is there.
Hope it helps.
There is no delegate or something similar in FBProfilePictureView that indicates when the image finished loading. Looking at the source code (https://github.com/facebook/facebook-ios-sdk/blob/master/src/UI/FBProfilePictureView.m) it seems like it should be fairly easy to fork the repo and add a few changes to notify you when the HTTP request has finished.

How to call LazyTableImages in my own project

I am new to IOS development, and I would like to use the LazyTableImages sample in my project. I have main screen displaying a list of menus. What i want to achieve is that when a user clicks a menu on the main screen, it will start a new screen which calls the LazyTableImages code and downloads the images.
But i have no idea how to do that.Because in the sample, the screen with the images is the first window, and in my project, it is not.It seems that I will need to move the LazyTableAppDelegate.h and LazyTableAppDelegate.m to the my own delegate file AppDelegate.h and AppDelegate.m files but i didnt get any luck doing that. Can anyone shed any light how should i make the change? Is there any sample code i can refer how to call one project in the other?
http://developer.apple.com/library/ios/#samplecode/LazyTableImages/Introduction/Intro.html
this links solve your problems.
1) [HJCache][1]
2) [Video Part1][2]
3) [Video Part2][3]

Resources