Re-signing iOS apps

There are some times when you need to re-sign the IPA of your iOS app with a different certificate. For example, an external developer creates the IPA for you, but it is signed with their personal certificate and you need to re-sign it with yours to deploy it to the App Store. Or one of your clients does not want to have their employees install the iOS app from the App Store but wants to distribute it directly using their MDM tools.

The second case is a bit more complicated, because it involves creating a new app identity for the app. When you change the app id if your app, your push notifications will stop working and you need to also generate a new APNS certificate with the new app id and deploy it to your server. Here is everything you need to do, step by step.

[Read More]

Solving problem after upgrading Windows 10 to EFI

When I upgraded my Windows 10 installation to the Creators Update I wanted to take advantage of the new MBR2GPT.EXE tool. This tool allows you to upgrade your Windows 10 installation to EFI without having to reinstall or loosing any data. My motivation for moving to EFI installation was to be able to boot Windows 10 from Clover, the macOS bootloader in my hackintosh installation, making switching between Windows 10 and macOS easier without involving the BIOS boot menu.

The upgrade from MBR to EFI went fine on both my desktop computer and my Thinkpad but there were a few thing that needed fixing afterwards.

[Read More]

Formatting Swift code in XCode

When I started using XCode I was really surprised about the really poor implementation of its code formatting functionality. It kind of formats the alignment of the code but ignores unnecessary spaces and a lot of other things. Formatting the source code and keeping the style consistent is really important to me so I was looking for a solution. I found some linters like SwiftLint but I was interested in a tool that will actually format the source code for me on demand. I found SwiftFormat.

SwiftFormat

SwiftFormat is a code library and command-line tool for reformatting swift code. It applies a set of rules to the formatting and space around the code, leaving the meaning intact.

[Read More]

Generating a list of libraries your iOS app uses

If you work on an iOS app that is a bit more corporate you probably need to show the list of all the libraries you use with their licenses somewhere in the app. Creating and updating this list by hand is a pain. If you use Carthage to manage all your dependencies (and you really should) there is a handy script by Piet Brauer I contributed to that will help you.

When you run the script using $ ./PATH_TO_YOUR_SCRIPT/fetch_licenses.swift Cartfile.resolved OUTPUT_DIR it reads your Carthage file, gets all the libraries you use, downloads their licenses and stores them all in a single plist file. The plist file contains the name, license name and full license content for every library in your Carthage file.

There is currently no support for using multiple Carthage files (when you have more projects in your workspace), you need to generate the plist file for each of them separately and then merge them manually. But you can set up a bash script to do it for you.

[Read More]

My experience running a hackintosh

A few months ago I decided to take part in an iOS project. The first problem I needed to solve was to be able to run macOS Sierra and XCode. I did not really want to buy an overpriced MacBook without function keys or and underpowered Mac Mini. Especially when I own a more than 3 years old desktop computer that is still usable for all my needs. A few iOS developers I know recommended I go the Hackintosh way.

Hackintosh

Hackintosh is PC that runs macOS. This configuration is not supported by Apple but it is possible if you have the right hardware since Apple has been using a fairly standard PC hardware for the last couple of years. For example you cannot us any new GeForce 10X0 (Pascal) because there are no Apple computers with those new graphic cards so there are no drivers yet (NVIDIA has released new drivers supporting all the Pascal graphic cards). But if you have an older GeForce like me or an integrated one, you will be fine. The tonymacx86.com website, basically the central hub of all the Hackintosh information, regularly publishes a buying guide that can be useful if you want to buy a new computer and install macOS on it.

If you do not wish to install macOS directly on your hardware you can run it in a virtual machine, but the performance will never be very good. Some people do it for Xamarin development when they just need to compile their project and run the simulator, so there are a few tutorial on how to do it. There is also an interesting blog post series about a virtual hackintosh. I tried running macOS in WMWare on my Thinkpad T440s but the performance was not good.

[Read More]

Using MVVM with tables and cells in iOS

When I ventured into native iOS development I immediately took a look at the possibility to use data binding on iOS which enables me to simply declare the relationships between the UI and the ViewModel. This article takes that approach further shows you how to use MVVM and data binding when using tables and cells, or in the world of iOS UITableView and UITableViewCell.

Sample scenario

Let’s start with simple example scenario. You want to show progress of some flow that contains of multiple steps, each of the steps can be either running or complete. When a step is running it can report its progress. You want to display this flow in a table that looks like this

[Read More]

Using data binding in iOS

When I started working on a native iOS project after a few years of Windows (Phone) development I looked into ways to write a more declarative and more elegant code than the “standard” iOS way. I wanted to transfer some of my habits over and the first thing I really missed was XAML data binding. I did some research on how to do data binding in iOS and found a few libraries that make it possible. This allowed me to write better code and I think data binding is a concept that all the iOS developer should look into. If you are interested in my experience with using binding in iOS, read on.

Sample scenario

Let’s use a simple example scenario. You have a screen where the users have to choose their country and then enter their mobile number. The number has to be validated with respect to the selected country and if everything is ok the Next button should become visible. So basically it should work like this

[Read More]

Creating a TV schedule grid in UWP

I am currently working on a UWP app for a cable TV company. The app allows their clients to watch the TV channels they are subscribed to with additional information like the TV schedule, information about TV shows, recording TV shows for watching later, etc. One of the main functionalities of the app is a TV schedule grid. Creating this TV schedule grid in UWP is not so easy, especially because of the poor XAML rendering performance.

TV schedule grid

The TV schedule grid shows a TV schedule for all the subscribed channels for a given day. The channels are being shown in rows and the columns represent TV shows. The grid is scrollable in both directions and the channel logos are sticky. The users can be subscribed up 70 channels and all of this should work reasonably well even on a Windows Phone.

This is how the result looks in a Windows Phone emulator. Spoiler: there is just no way to make it so smooth on a real Windows Phone device.

[Read More]

Using macOS with a Windows keyboard

When you start using macOS after years of using Windows there are some things you expect to work in certain ways. One of those things is the ways the OS handles keyboard input and keyboard shortcuts. This is especially important if you still also use Windows and use a Windows keyboard with macOS. Here are a few things regarding the keyboard that help me when using macOS working on a side project.

Control, Option and Command keys

The fist thing you may notice when using macOS with a Windows keyboard is that the modifier keys are not in the right order. The order of the modifier keys on an Apple keyboard is Control, Option, Command but the Ctrl, Windows, Alt keys on a Windows keyboard map to Control, Command, Option by default. You can fix the order of the modifier keys in System Preferences | Keyboard | Modifier keys

[Read More]

My (negative) experience with the Microsoft MVP awards

Getting a MVP is a big thing when you are a developer working with the Microsoft stack. It is supposed to be some kind of approval a sign that you are doing something well. I applied for the MVP award back in 2012 and then got nominated in 2016. I want to tell you about both cases because they really made me think that the whole MVP concept is just wrong.

Disclaimer: First, this post is not a hate post because I did not get an MVP award. I do not really care about it. I just want you to know how it works and what is it like. Second, I am in no way generalizing and saying the MVP awards work like this in every region. This is my experience with the Czech Microsoft branch (2012) and later with the CEE, Russia & CIS (2016). I suspect things may work differently in different regions and with different Microsoft branches.

[Read More]