You can unregister a UICollectionView supplementary view by re-registering it with nil class as stated in Apple’s docs. (Remember to use the same reuseIdentifier).

[self.collectionView registerClass:nil

Anyone that have recently developed any pods for Cocoapods know that resources should be gathered using the resource_bundles option. What is quite hard to figure out is how, exactly, to access those resources once they’re set up in the bundle. It seems obvious now that I got it working, but I struggle a lot since there wasn’t anything in Stackoverflow or anywhere else that provided the answer I came up with.

After setting up the resource_bundles, Cocoapods copies the resources found in a “resources” folder within the Pods project, but none of them are added in the target’s “Copy bundle resources”. For that reason, I couldn’t access any of the Pod’s images or xibs in my project. Every time XCode threw me this error:

‘Terminating app due to uncaught exception ‘NSInternalInconsistencyException’, reason: ‘Could not load NIB in bundle:<{PATH_TO_APP}> (loaded)’ with name ‘{VIEW_CONTROLLER_NAME}’

The obvious solution that wasn’t listed anywhere is using the Cocoapods generated bundle (which the folder actually doesn’t exist) as a NSBundle:

NSString *bundlePath = [[NSBundle mainBundle] pathForResource:@"MyBundle" ofType:@"bundle"];

NSBundle *bundle = [NSBundle bundleWithPath:bundlePath];

MyViewController *viewController = [[MyViewController alloc] initWithNibName:@"MyViewController" bundle:bundle];

[self.navigationController pushViewController:viewController animated:YES];

Yes, it’s that simple, that obvious, though it’s not listed anywhere. I believe to be prudent and convenient to write about it in order to help anyone who encounter themselves in the same situation as I did.

This morning, Cicada 3301 went back to active! In his/hers Twitter account used on last year’s challenge there was new link to an image posted on imgur.

First Chapter

Reproducing the tradicional previous steps, by extracting the image using outguess we came onto a message, once again signed. Its authenticity could be proved using Cicada’s previous known public key.

Now let’s get our hands dirty! The first task was easy, since it’s steps were already elucidated on previous years. Now things start to get interesting.

If you’re interested in following the challenge progress, Uncovering Cicada is on a good pace.

Good luck, and good hunting!

I believe that every iOS developer is already aware of Apple’s new directive forbidding any apps using frame to be submitted to the Appstore when the new iOS 7 goes public. That means that ALL new app will have be developed using this tool created by the son of a devil called autolayout.

Anyone that has already used autolayout knows that margin, width, height and other properties are calculated in runtime, therefore, they consume sometimes unnecessary CPU time. For some inescrutable reason, Apple decided to create this new concept from scratch to ease working with different sized screens, while they could easily reuse existing CSS concepts like marginpadding, among others. In addition to being extremely confusing (a UIView's margin constraints are in its superview), having a pitiful syntax  (“V:|-(-5)-[view1]-(>=10)-[view2]-(912837)-|”)autolayout also makes everything slow.

Protip: if you’re configuring your coinstraints via code, never forget seting self.translatesAutoresizingMaskIntoConstraints = NO in your view. It took me a couple of coffee cups to realise this was the reason why my  constraints weren’t being executing along with [self layoutIfNeeded].

I recently had to work with a UICollectionView and the scroll was getting really laggy. Anytime a new cell was loaded, the framerate dropped. After spending a few hours trying to find the root of the problem with a couple of friends (we even considered the problem being the SDK’s dequeue thanks to  Profiler) some inspired insight hit us and we decided to disable autolayout on the UICollectionViewCell's xib and everything flowed like a beautiful stream under the morning sunlight of tropical woods. So let us analise what happened: Apple created a new concept, from the grounds, that theoretically would solve all problems when working with screens of different sizes, but this devilish concept is composed of runtime calculated values that ruin the app’s smoothness. Yep, it gets hard to work happily…

This view that is the UICollectionView's cell will not have autolayout. Nobody knows what will happen when we submit the app to the Appstore and we sincerely hope that Apple doesn’t mind this view that, although is not explicitly using frames, also is not configured to accept autolayout.

I’m yet to find an iOS developer that has nothing to complain about this weird invention, but, as usual, Apple’s “this is what we want, so deal with it” policy doesn’t give us any alternatives. Instead of easing developers’ work, they’re making our daily lives every more difficult while Android scores another point Apple is walking backwards.

Fork me on GitHub

In any kind of environment, visual marks ease and enhance the comprehension of information. Countless researches studied the best way to display data, which colors induce what emotions, the association of geometric shapes with pre-formed concepts. The fact is that a sign or plaque draws much more attention than plain text. After all, an image is worth a thousand words, therefore, an image sends a much more significant message than some written words.

That’s one of the reasons many development tools have featured badges (or  shields) to inform the status of an application/framework/library/etcetera. It’s the case of Travis CICode ClimateGemnasium, among others, all following olivierlacan/shields` trend, available Github.

I’m an iOS developer and previously have worked with Python/Django (though I still fool around) and I’ve always found very interesting this creative way of sharing the state of a service dynamically, but sadly, there were no solution to Python nor iOS featuring badges (except for Travis CI for tests). But, recently, appeared - out of nowhere - pypip’s shields for Python packages that allows the visualisation of the latest available version of a package on pypi or how many downloads some release *had.* When I came aware if it I resented for taking so long for solution so simple and effective to come up (or at least for I to discover it)… but it got over the top when I found out… or better, did not found out a similar solution for Cocoapods.

I’m one of those who doesn’t miss a chance to solve a problem and endeavour an opportunity. That’s how the Cocoapod Badges  project started. Since Cocoapods doesn’t provide an API, any info on the number of users/downloads, nor any kind of useful data, it proved to be a challenge, and all I could use had to be what was at hand: the latest version of a pod. But even though, mistaken are those who thought it easy. As mentioned, there’s no API!

Cocoapod Badges NSStringMask 1.1.2

Digging through Cocoapod’s and Cocoadocs’ websites, I tried, first, to use the documents.jsonp  file that I found in the source of the pod’s documentation website, however, I soon gave up for realising that its update frequency is too high (above one hour). At last, I had to content with the unfortunate /search?q= requested when searching for a pod in Cocoapod’s main page. At first, it looked like an excellent solution since it returned a json object with some info, until I realised that inside the object was a string with some html code and only inside that code was the pod’s latest version. “God dammit!” Now I have to run a request on a “pseudo-webservice” and parse it with XPATH to get the latest version!

Super easy! But, as my mother would on a brazilian saying: “few shit is silliness”. The damned “API” doesn’t return the requested pod, but anything with the searched string. To get something more useful, I figured that  /search?q=name:POD_NAME searches only in the pod’s name and not in its description, what significantly reduces the results, specially when dealing with popular pods such as AFNetworking.

After all that suffering, I finally got the information I wanted, but then, how do I show it in an image? Olivier Lacan’s repo, that enabled all the existing  badges, provides, beyond the .png to existing services, .SVG vectorial files that render xml data to images. So, accidentally, I double-clicked the  .SVG file and the holy Google Chrome opened it as an image! Finally good news! As the information about the version is in plain text inside the xml, all I had to do was to set the mimetype so Django could provide the file as an image.

Heroku dyno later and the service is available fulltime (depending on Cocoapods website) through the images’ url:$PODNAME/badge.png

All you have to do is replace the $PODNAME with the name of the pod you want. Simple and easy, isn’t it? Use it at will! And suport the Github repo!