Boycott McCafé.

Saturday, July 7, 2018

2 Starbucks plastic cups

I’m trying to reduce our impact on environment. We have 2 reusable coffee cups in our family and I am using them in Starbucks, Nero and Costa. Not only this is good for environment, but it also helps to save money, Starbucks offers £0.25 off, and Nero gives you 2 stamps for one purchase instead of one. I have also banned plastic straws in our family because straws kill sea life.

2 McCafé with plastic lids

For years I was regular customer in McCafé, collecting their loyalty stickers, their coffee is good and it doesn’t cost much. One day we went to McCafé with our Starbucks cups, here’s my conversation with McDonald’s person behind the till.

— Hi, can I use my own cup please?
— No.
— Why not, you not it’s bad for environment, I use them everywhere else.
— Sorry it’s our safety policy.
— That’s wrong, okay 2 lattes please, without lid… Without plastic lid please!
— Sorry I can’t, that’s a policy.

Not only they don’t offer benefits for bringing your own coffee cup, McDonald’s employee do not allowed accept reusable cups at all! Yes, recently, they are trying to phase out plastic straws in UK but that’s not enough.

McDonald’s must change its stupid outdated policy about not allowing us to bring our own cups. I’m not buying their coffee any more and I encourage you to do the same.

Me with collection of reusable coffee cups

If you do have any cups laying around, don’t throw them in recycling bins please. Common coffee cups is paper combined with plastic. Costa and Starbucks can accept your cups from coffee and soft drinks and send them to a special place.

I Left Glance.

Thursday, May 10, 2018

I should’ve write about this earlier but couldn’t find time. I still want to, because this is big step in my life. I left Glance Creative, app agency where I worked for almost 3 years. 1 All this time together with great CEO, amazing people and doing my best work. Glance has big portfolio, it was fun to work on different projects and ship one app after another.

Me on background with app icon frames built by Glance and Locassa.

I left Glance so I can start new role at IG. I was flattered to receive offer from them, it’s hard to find good place to work in my situation 2, even in London. I’m fortunate to be able to continue to earn money from doing something I love.

  1. 2 years at Locassa, and 1 year at Glance. I usually combine this periods, because 2 companies share same people. 

  2. I don’t have British or EU passport, I can only work in UK under special visa called Tier-2. Visa can be sponsored not by every company and it requires special certificate. On top of extra expenses and paper work, sponsor needs to do market search for 30 days and try to find another candidate from UK or EU before it can hire Tier-2 immigrant. 

Sky Remote With Voice Control.

Monday, April 2, 2018

Sky remote

Spotted this on the Tube. The ad says “My mon is obsessed with Voice Control.” Can you see where is voice control button?

I couldn’t find it so I made this picture. I found full remote picture and still could not find the button. Turns out, the voice control button is on the side. They couldn’t find space to put it on the front? I don’t think my mon would ever be able to find voice button on this remote.

While Apple TV remote has many flaws, at least it has obvious voice control button. It embraces voice for everything, so there’s no search button because you can search with voice. If I would have to design this remote, I would remove most of the buttons and replace search button with voice control.

When I bought my first MacBook Pro, I fell in love with white Apple remote because it had almost no buttons and was so inviting. I am glad modern Apple TV remote inhereted this simplicity.

What's Like To Use Cheap Android.

Wednesday, February 14, 2018

In past 2 days my friend asked me to help with her smartphone.1 That’s the only computer device she uses and she said she “can’t contact my husband any more because of ads”.

Device has to be charged from the top, which was very uncomfortable to use and cable was constantly disconnecting. The battery was old, we could use it only when charging.

First thing I noticed, is how big screen was, compared to my iPhone 6s. It was easy to read, with larger touch targets. That’s a plus, considering affordable cost of the device. Of course with such a low cost,2 there’s many compromises.

She started to show me dozen of apps she didn’t installed, games and gambling apps. While I navigated the phone ads popped up, I saw 4 kind of ads which could appear even on the Home Screen.

  1. Banner in the bottom.
  2. Ads which look like Facebook bubble.
  3. Google Play redirects. When I was using Google Play app, it would show me page with random game.
  4. Full screen ads, some of them even faked lock screen UI.

I was bombarded with notifications and alerts from “antivirus” and “cleaner” which I was canceling, I was sure it will go away after I reset the phone. How naive.

First thing I did is backed up her notes from third-party app. I could log in into Google and sync it. Then I installed Google Photos. Device didn’t have enough space and it offered to delete some apps right from the modal alert, which was nice. However then I run out of space again, and the modal alert offered to delete apps which I didn’t want to get rid of. There was no button to jump into Settings, I had to find storage manager on my own.

We uploaded all her photos and videos to Google. I even liked the experience, because Google offers free unlimited storage. I installed Google Contacts and Chrome. She had almost 2,000 contacts on her SIM card, Contacts app offered to back it up and it’s even cleaned SIM card automatically.

Ignorantly, I didn’t backed up WhatsApp conversations, which is possible to do with Google Drive. I though I could restore them logging in into her account but because her account was linked to her another oversea phone number, we couldn’t receive the text. So I had to create new account for her and we lost all conversations.

I reset her phone from the settings, surprised how many bloatware it had as part of the system. It wasn’t possible to remove system “antivirus” and “app cleaner”, Opera Mini and many other not wanted apps. All I could do is to disable notifications and disable constant monitoring. I didn’t trust it.

My biggest disappointment was the lack of OS update option. The device was sold with 5.1 and it is the only Android version it supports. I couldn’t even find this model on Lenovo website.

Another surprise was lack of Chinese keyboard from the OS. And this is device which specially made for China and sold by Chinese manufacturer. I installed Gboard but it also didn’t have Chinese. In despair, I searched Play Store for “Chinese keyboard” and found another keyboard from Google which did the job, it had only 1 Chinese language option which was poor because iOS has 2: traditional and simplified.

I installed Google Photos, Contacts and Chrome again but at some actions I was presented with option which include system app, there was no way to make OS remember my choice even when I ticked specific “do not ask again” option. This duplication felt through entire OS, there’s 2 settings app and many system apps can be find with alternatives from Google — Clock app, messages app. I tried to install messages app but it didn’t work properly, it didn’t show SMS messages.

Because Lollipop doesn’t have privacy permissions controls, when denying permission and then changing my mind, I had to reinstall an app. App would say “I can’t access camera, restart your phone” — which is ill-advised.

  1. She has Lenovo K50-t3s with 5.1 Lollipop. 

  2. About $106.99 on this day. 

Horrible Custom Smart App Banner Collection.

Tuesday, January 23, 2018

Apple has simple manual for web developers how to make Smart App Banner. It looks like this: Picture from Apple website.

Over past years I was collecting different custom implementations from all over the web. You will be surprised how creative some developers are.

eBay Glassdoor Tastemade Cnet Daily Mail Adobe Peak Telegraph

And still it remains secret to me why would anyone wants custom solution for this problem? Is this blunt ignorance or might be it is designers who think their design is better than standard solution? Or perhaps it’s greed and website owner wants have more tracking? Anyway, this custom banners look worth and don’t work well. They have worth privacy as well, so don’t tap on them.

Screenshots edited in Altershot.

How Electron Made GitHub Desktop Worse.

Monday, January 22, 2018

Not long ago GitHub released new version of their Mac app. Big update which is actually rewrite. New version uses Electron. We know Electron from Slack. I decided to compare 2 versions to demonstrate difference between native and not native.
Website presents new version of GitHub Desktop

The fact that new version is presented as “The new native” offenses me. GitHub Desktop at farthest point from native it ever was.

Let’s look at App size.
2 app sizes

Old app is 63.7 MB and new is 168 MB. Not surprised as web app need to include all dependencies and custom frameworks. Native apps can use powerful system frameworks which is already included into OS once.

Let’s open application. First thing I noticed, minimum window size for Electron app is much larger. Look how many white space is wasted. Old native app could be resizes to much smaller size which makes it’s superior for those who keep many windows on screen and value space.

Native version of GitHub Desktop Electron version of GitHub Desktop

Now let’s focus on the title bar. Electron app missing title. Not only title shows what item selected but is also possible to click on it and navigate file hierarchy. Right Click on the drop down menu and select item, this opens Finder. Title Bar options

New app has black top and white content area. That’s not a good look, usually Mac apps have main color scheme, dark apps dark everywhere, iMovie is perfect example, and apps like Finder and Safari have light background.

On the screenshots you can see how basic “Add Local Repository” interface differs. Pay attention on the buttons styles, old GitHub apps has familiar buttons looks which is the same as any other Mac app, while new Electron app has its own style. Not only it looks out of place, this also adds additional cognitive load. The same is true for apps font, old app uses excellent system font. At least Cancel button is on the left.

Last let’s click on the File menu. Menu bar is important on Mac. Everything that’s app does can be accesses from menu bar, it allows user to study what app can do, it also displays shortcut commands.
Menu comparison

Now here, I have to say, new GitHub Desktop does not a bad job, some web apps don’t have menu commands at all. However particularly in the File menu I noticed that old app had more options. One of most important changes is ability to open multiple windows. This core function is lacking from Electron version.

Another subtle benefit using native app is lack of need to click twice when window not active. Any web site or web app can recognize click only in active mode. Normal Mac apps can receive click events even when window not active. For example, you can click on the + button in top right corner of GitHub Desktop even when window is not active. Any web application will require 2 clicks in this situation.


Web apps never going to feel native. You can call it “React native” but it will not make code more native. You can call it “Electron” but it will not make app size smaller and efficient.

Native GitHub Desktop app is no longer available but you can download my copy. I still use it to this day and I will continue until it stopps working.

Auto Layout Scroll View with footer.

Wednesday, November 1, 2017

iOS simulator screenshot with blue content area and yellow footer

The goal of this Auto Layout exercise is to build scroll view with dynamic content height and footer. There’s 2 challenges here.

  1. Sticking footer to the bottom even when there’s very little content.
  2. Allowing scroll view to scroll even though content height is unknown.

First, read “iOS: How To Make AutoLayout Work On A ScrollView” from Natasha as it’s very practical and saved me many hours.

The fastest and easiest way to get started is Storyboard and Interface Builder. Download sample project from GitHub.

  1. Add Scroll View to your root view and add pin it with 4 constraints. Your root view should have only 1 child which is the scroll view.
  2. Create new “container” view and add it to the scroll view. Scroll view can have only one child view. This was mentioned by Natasha and I always follow this rule since, I lost many hours when I didn’t know about this.
  3. Add constraint for container view width to be equal with root view width.
  4. Add footer view and pin it to the bottom.
  5. Scroll view can’t function when content height is unknown. Add height constraint outlet. In this example for my content I have single label, I don’t set container view height because it will change depending on label height. I pinned label to its superview. Make sure your Storyboard file doesn’t have error messages and layout conflicts resolved.

Interface Builder with footer sticking to the top

At this point you should get something like this in your Interface Builder. We still have some work to do. Open view controller and add following code.

labelHeightConstraint.constant = view.bounds.height - footerView.bounds.height

So far I have no content and we had to increase label heigh so footer sticks to the bottom as design required. If I set text for the label it will truncate which I don’t want. I had to disable this constraint and allow scrolling.

labelHeightConstraint.isActive = false

2 screens with text taking all the space.

iPhone X

I thought I was done but when I run the code I realised it was broken on new iPhone X. Here’s code snippet that helped me.

override func viewDidAppear(_ animated: Bool) {
	labelHeightConstraint.constant = (view.frame.height - - footerView.bounds.height

The key is viewDidAppear because safe area insets equal to zero in viewDidLoad. I also had to disable landscape layout.

I noticed that iPhone X screen is very tall so all my text was visible and footer was in the middle of the screen, I had to activate constraint again. Only disable height constraint when you have many pages of content, iPhone X can fit surprising amount of information.

iPhone X screenshot

State of Mobile Gaming.

Monday, October 30, 2017

Black iPhone and Nintendo 3DS on the white desk.

I carry my Nintendo 3DS almost every day. Completing one game after another, surprised how good and memorable Nintendo games are. I try to play on iPhone sometimes but it always disappointment, ether game requires internet connection or it is too plain, too simple, without a story and characters, repetitive. Generic sense I’m getting from mobile studios is maximising revenue from each player with tracking, dirty psychological tricks, micro transactions and cool-off timers. Sadly neither developers or consumers care about gameplay and story aspects. Yes, there’s a Monument Valley but the game is short and very simple, it’s not comparable to Super Mario 3D Land (recently discounted) or Legend of Zelda.

Is it because price raise to the bottom or short playing sessions or lack of physical controls included with every device, or, more likely, combination of all? I wonder can this market be sustainable in a long run? Classic video game industry always relied on creating something special, experience which is art form more immersive than TV and movies. To play best games you have to own dedicated console. For a long time you had to own MP3 player and photo and video camera separately but now all this markets cannibalised by iPhone. Gaming industry is still separate. Hardware is not longer an issue, even last year iPhone 7 are more powerful than Nintendo Switch, has much better screen as well. So why no one makes exclusive iOS games with big budget and controller support? I am not talking about ports or multi platform games. Nowadays tools like Unity and Unreal makes it easy to deploy game on each platform but this approach doesn’t take advantage of unique hardware aspects like 3D Touch and Haptic Feedback. Or why there’s no iPad exclusive games which take advantage of a larger screen? There’s ports but that’s all.

Nintendo is very smart by releasing Switch which can be used in commute and games which can be played together with all necessary controllers included, games which use consoles unique features (HD Rumble). It’s a natural evolution for 3DS. I am very happy about progress they made and have a lot of hope that people who experienced game on Nintendo console will never look towards Rovio, King again.

Apps Should Work Offline, with Visible Status Bar.

Saturday, September 16, 2017

We have not expensive data plan, and I disable mobile data for most of my apps. I have a problem with “Internet Wall” appearing in even one of the best apps like Carrot Weather (iOS or Mac) or Super Mario Run (iOS). Just today I opened Carrot Weather while on vacation to have white screen of nothing telling me there’s connection problem.

Apple Wather on left and Carrot on the right. Apple app has visible status bar and shows all data even though both apps don't have immidiate internet acces.

And not only I can’t check the weather but I can’t see time, battery level and most important, connection status. I guess developer decided their custom made artistic interface is more important than Status Bar.

I use Carrot Weather for their great Apple Watch app. On iPhone I prefer Weather but I launch Carrot from time to time. Recently Carrot Weather had big 2.0 update with new UI. I am sure developer very proud of all extra features and personality added into Carrot Weather but I don’t care. I even turned off all “fun” features. And this is why I continue to use Weather, it shows me the weather in any conditions, especially when I am trying to manage my data plan usage. It also shows me Status Bar at any screen.

Recently we shipped goEvo (iOS), app with daily planner for meals and exercises, and function to log emotional state and even have 2 way conversations with virtual coach. I am proud that all of its features work without internet connection.

Every non-web software developer should understand that application they develop should not require immediate internet connection. It’s not hard to do, and it’s good for performance and energy efficiency. Otherwise what’s point of making native app? If Carrot Weather can’t do data persistence, they should’ve focus their development building web application instead.

Raise of Smart Consumer.

Friday, September 15, 2017

In a light of approaching Safari release with Intelligent Tracking Prevention and ad industry reacting with public letter to Apple, I am seeking view in which industry can change while technology is used in favour of people privacy.

Classic Ads.

As example, after Soviet Union fall there was new market opportunities for western companies. Russians were ready to buy new products and their choices were determined by ads. Richest and biggest companies captured the market. TV ads worked — some products has been called by brand name, like some people call each MP3 player as “iPod” — to this day most Russian people call nappies as “pampers”. Advertising is a big market driver and necessary part of any successful product. It worked well without any data collection or tracking.

Track, Convert, Repeat.

World we live today is not as simple. “Big Data” became annoying buzz word, most of tech used to collect and analyse people’s behaviour. Company getting bigger. There’s new loyalty schemas with cards like Nectar Card and Tesco Club Card is pure not hidden tracking in which customers acquired by small portion of a sale, about 0.1% to my rough estimates earned in points which on top of all can expire.

There’s web tracking too, with cross domain cookies identifiers and whole industry of companies which entire focus on maximising conversions by any means. Facebook ads generate thousands of dollars every second. Advertisers exploiting VR and AR as well, you can get Google cardboard VR just as part of movie promotion walking on streets of London. Although advertising industry arguing no wrong doing to as the only “serve consumer interests”, we know they only serve only their own interest.

@marcoarment: If the ad industry is complaining, you know Apple made the right decisions for us. Thanks, Safari team!

Those tactics has only single goal — maximising profits by using technology while influencing peoples choices. Those companies want to use same advertisement models with invading new areas of our personal lives. Their lack of ability to change means we will find a way around their primitive “track, convert, repeat” model. Ad industry complaining about decreasing profits but instead of changing they only make thing worse by using even more ads often through mediation networks, inserting video ads, fighting content blockers.

Trust and Research as Primary Buying Factor.

My wife wanted to get me new slippers. I saw massive ad campaign all around London Tube and on the web. I knew the brand she’s going for. 5 minutes of research gave me everything I need to argue against the purchase. I found one youtuber who purchased this slippers 1 year ago and reflected on his purchase recently. Slippers broke soon because cheap materials and customer support was not up to the high price. Company invested all the profits into advertisement and almost none in the product quality and support.

Nothing stops websites to continue serve ads, but they will have to do it with respect to readers privacy, without profiling and identifying. Facebook, Amazon and Google continue to track us on their own. Not much can be done, as they deploy code from their own domains, except maybe abandoning services altogether, hence switching from Google to DuckDuckGo. However, we should make harder identify us across. Videos we watch on YouTube shouldn’t influence recommend products from Amazon, click on a search result shouldn’t make us an ad target. Safari already doing great job while blocking third party cookies by default and for 2 years supports innovative efficient and private ad blockers like 1Blocker for Mac and iOS.

There’s individuals like Jhon Grubber who started first using sponsored posts in RSS, websites and podcasts with exclusive subscription model, podcasters which experience product while sponsoring it ensuring basic curation. There’s Marco Arment created his own advertising network in Overcast. This innovation is a new way for products to rich their customers and they fund independent content creators. This examples show there’s new ways for advertisement to exist without breaking trust.

I believe our economy and society are better off when individuals make conscious choices about products they purchase. Choice influenced not with massive surveillance and propaganda but trust and research. I want to leave in a world where companies compete not by sole marketing but with design, quality, customer service and environment impact. Looking into future, I want to end this by quoting a reaction comment from MacRumors.

I want to be respected as a consumer, able to make my own choices about my needs, seek them out on my own and be helped by knowledgeable people when I want information on what to purchase.

SOLID Photo Gallery in Swift 4

Wednesday, August 30, 2017

Goal of this exercise is to improve my code design. I am hearing a lot about SOLID design principles and “uncle Bob”, so I decided to understand its ideas. This exercise is my attempt to implement this ideas on practice in simple and modern Swift application. Although SOLID principles explained with C++ examples, its good Object Oriented Design principles can be applied to Swift.

As mentioned by Robert C. Martin before, this principles is only recommendations and is not a law. Sometimes it is better to violate this good design principles but only when necessary. I also have to mentions that this is only mine interpretation, I can be wrong. Please write to me if you have any feedback.


Applications accesses Flickr API and displays image gallery, displays meta data for each image.

To satisfy acceptance criteria we need to display collection of photos, be able to show all metadata for each photo and perform actions on each photo. I designed 3 screens and to implement them we will need following:

  1. PhotosCollectionViewController
  2. PhotoViewController
  3. MetadataViewController

Let’s assume, later we will need to add sorting feature for the next version of application.

Naive Design.

For getting photos from Flickr singe service class is created. This class sends data to PhotosCollectionViewController.

For the UI we use single Storyboard file.

Good Model Design.

What makes design good or bad? How we can judge it? There’s 3 warnings signs in which we can evaluate design quality. This was described in The Dependency Inversion Principle.

  1. Code that hard to change.
  2. Every change breaks code in unexpected place.
  3. Code can’t be reused.

In order to create reusable design we need to think what parts of application can be changed in the future and what kind of change we should be ready for. We can improve naive design in many ways. Let’s focus on model design and UI design separately and start with model.

Lets say everything user can’t see is part of the model. First decision that I made is to write separate NetworkService protocol. Swift protocol itself can have only method definition, not implementation. I extended NetworkService and chose to use Apple URLSession to request data with status and optional error object.

Let’s imagine this source code need to be used in another project which relies on third party Alamofire library. In this case, developer need to replace NetworkService  extension. If developer keeps same method definition, good news, PhotosCollectionViewController will not need to change. Job well done.

Another struct is required to specify request path, I called it FlickrService. It has endpoint path and data type parameter. I also created FlickrDataModel struct. In this struct I added method to parse data into Flickr model taking advantage of Swift 4 Standard Library with JSONDecoder. I chose to use nested Decodable Structs to mirror data model from an Flickr endpoint.

Unlike naive model, in this design I separated Flickr related logic and networking logic into separate abstractions. This enables easy code reuse, and also allows easier refactoring of one part of application without breaking other part.

PhotosCollectionViewController communicates with lower level networking module through higher level FlickrService class which conforms to abstract NetworkService protocol and can perform request. I believe this is good example of The Dependency Inversion Principle. Higher level abstractions doesn’t depend on lower level implementation.

The rest of application.

So far I spend most of my attention into PhotosCollectionViewController. There’s 2 other goals:

  1. View controller for displaying photo in full screen and performing some actions: sharing photo, opening original Flickr web page.
  2. Displaying metadata in full screen.

This can be done with 2 or 1 view controller. Whenever Photo metadata changes, this view controllers and UI would need to change as well. I chose to split metadata viewer and full screen photo view into 2 different view controllers. I created 2 Storyboard files and took advantage of Storyboard References. That’s better than using single Storyboard file, now engineers can work simultaneously. Storyboard itself allows us to separate view logic from business logic. This allows changes in UI design and layout without need to change view controller code.

I assume one can say that this design violates The Dependency Inversion Principle — changes in Photo object model, replacement it with another object, or adding new data source types, require changes in UI and controllers. For this simple exercise I chose to keep UI static. We can’t be ready to every possible change and need to think carefully what areas of application can change. Because this is photo browsing app I keep core UI functionality together. I believe it is important to understand purpose of the application, in our case it is displaying photos with meta data. We should design our code to be ready for additional features and changes in implementation. In case when core purpose changes, it is better to start from scratch.

Separating User Interface.

Well done, version one finished. I am satisfied with design and core requirements. What if we would like to implement sort function? It can be done inside the same collection view controller. But this would be bad design and eventually lead to well known Massive View Controller problem. What if we want to reuse sorting module or change its implementation? The Dependency Inversion Principle states that UI should not be connected with business logic directly, UI should communicate through higher level abstractions. Ideally, sorting feature should have its own MVC.

To fix this, we can create SortOptions struct which defines SortType enum and its order. It also contains text to be displayed in UI. We use UISegmentedControl, I consider it as low lever class which should know nothing about business logic. We extend this control with SortControlextension which would take SortOptions and would configure UISegmentedControl. to display appropriate number of segments with appropriate labels.

I included SortOptions struct into PhotosCollectionViewController which is fine but I didn’t connect UISegmentedControl directly to PhotosCollectionViewController like it’s done in naive model. Instead, I created SortViewController and took advantage of Cocoa Touch Container View. This allows me to move UISegmentedControl into separate Storyboard file, meaning if UI changes, PhotosCollectionViewController will work the same, only SortViewController would require change. As long as our collection view conforms to SortableCollection protocol and communicates through SortViewController, design does not violates The Dependency Inversion Principle.


Xcode project.

Project is available on GitHub.

Page 3 of 9