Skip to main content

HTTP Connection problems on iOS 9 for Apps built with XCode 7 – How to fix that

Guess what? iOS 9 and XCode 7 are finally out, and – like almost always – there’s the usual number of breaking changes that will drive most developers mad. Among the biggest ones there’s the new Apple Transport Security (ATS) feature, which happens to be enabled by default starting from iOS 9.0 and OSX 10.11 and will basically block any non-HTTPS connection for your App.

Yeah, you’ve read it right. Here’s the Apple official statement about that:

It improves the privacy and data integrity of connections between an app and web services by enforcing additional security requirements for HTTP-based networking requests. Specifically, with ATS enabled, HTTP connections must use HTTPS (RFC 2818). Attempts to connect using insecure HTTP fail. Furthermore, HTTPS requests must use best practices for secure communications.

This will undoubtely translate into tears of joy for a lot of developers relying to home-made web services hosted on non-HTTPS environments or non-TLS based storage services (such as Amazon AWS).

Read More

Allow the download of IPA files within IIS (avoiding 404 errors)

Some months ago I made a post explaining how we can configure IIS to allow the download of Android APK files: now, upon request, I’m posting the same thing for iOS .ipa files.

When you’re developing an iOS App you’ll most likely want to give someone – the customers and/or beta-testers, colleagues, etc – an URL pointing to an .IPA file containing the efforts of your hard work, which is not (yet) present in the App Store. Since the vast majority of web servers (including IIS) don’t natively support the .ipa MIME-type, your URL will most likely give an apparently odd 404 – Page Not Found error response. In order to overcome the problem you need to add the proper MIME-type corresponding to .ipa file in the following way:

  • Open the IIS Administration Panel (see picture).
  • In the left panel, click to the entry corresponding to your global IIS instance (pt. 1 in picture) so that each modification you’ll make will be applied to all your past, present and future web-sites. If you only want to handle the .apk MIME-type for a specific web site, click to the entry corresponding to it instead.
  • In the right panel, Click to the “MIME Types” icon. You will be presented with a listing of all currently supported MIME-types.
  • Click to the “Add…” button near the top-right corner (pt. 2 in picture) and add the following MIME-type (pt. 3 in picture):
    • Extension: .ipa (be sure to include the dot)
    • MIME-type: application/octet-stream


(click over the picture to enlarge)

Needless to say, this can be used to allow the download of any other file extension.

If you’re not using the IIS Management interface and/or if you want to work directly on web.config level you can achieve the same result by following the comprehensive instruction explained in the official IIS configuration page.

While you’re at it, if you’re willing to do the same thing with  Windows Phone’s .xap files you can check this post and wrap it up aswell.

DownPicker is now available through CocoaPods

A while ago I wrote an article about DownPicker, an open-source GitHub project written in Objective-C to make Android-like drop-down-lists on iOS like the one shown in the following image:


For additional info about DownPicker installation and features you can read my previous post here.

In case you want to try it (or if you’re already using it) I’m pleased to inform you that DownPicker has been added to CocoaPods, the well-known dependency manager for Objective-C and Swift iOS components. If you never heard about it you can learn an excellent way to manage your iOS project by reading their official guide.

Installing DownPicker using CocoaPods is just as easy as adding this line to your Podfile:

Here are the CocoaPods relevant meta info:

CI Status Version License Platform

You’re still free to install it manually, as explained in the project GitHub page or directly in the official repository README doc.

Here are some useful links regarding the project:

Happy coding!


DownPicker: A lightweight DropDownList / ComboBox for iOS written in Objective-C

Quick links: Project Page – GitHub – Pod

Eventually, while developing in iOS, you’re going to find yourself looking for a control allowing the user to pick an option from a drop-down, selectable list of items: any UI has something like that: drop down lists, combo boxes, expand & collapse views or anything that could resemble the behaviour of an HTML <select>  element.

Problem is, iOS doesn’t feature anything like that. Except for the UIPickerView control, which often isn’t what we really need because of its excessive height and its heavy-impact look, which isn’t always as pretty as Apple designers thought it would be, at least in real-case scenarios. Conversely, we often need it to be simpler, taking less space and/or decently blending with other TextField elements.


UIPickerView in action: not always pretty.
UIPickerView in action: not always pretty.

With that thought in mind I pulled out DownPicker, an iOS control who can mimic the behaviour of a DropDownList/ComboBox using default iOS UI elements only: an UITextField to prompt the user to tap (and then show the selected item) and an UIPickerView to handle the selecting.

Read More

Objective C: removing UIStoryboard constraints programmatically

Since XCode made them available, Storyboards became a key concept for almost any GUI-oriented app: there’s nothing wrong about it – there isn’t a better way to design & arrange your views, objects and your whole UI in timely fashion. Expecially if you properly learn to use the Storyboard constraints, which are a powerful way to place your items around and ensure they’ll stay in their place.

Nonetheless, there could be situations where you need to programmatically remove the Storyboard-defined constraints: for example, if you need to change an item position right after an user interaction.

Read More