Apps Should Work Offline, with Visible Status Bar.

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.

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

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.

Goal.

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.

Bibliography.

Xcode project.

Project is available on GitHub.

Let Safari Be Different. Case Against Favicons.

Idea of why Safari team should change its original design and add favicons getting big traction among Daring Fireball users. Jhon Gruber wrote that most of his readers think that Safari team should include favicons in its browser. I have different opinion.

Safari should stay as it is, tabs should not have colourful favicons. Option in Preferences is not a good solution neither. Safari design should not follow common pattern where each browser has favicons in its tabs. It doesn’t have tabs on the top and it shouldn’t have favicons either. Here’s why.

I believe Safari designed to be minimal for multiple good reasons. It’s not hard to include them from technical perspective, this is clear design choice.

Why Safari worse with favicons.

Let’s think why Apple designers decided not to include favicons into Safari. I can speculate on many reasons. First that’s coming into my mind is content. Apple wants us to focus on the material. Colourful icons row is another distraction which gets in our way when we reading article or navigating the page. Aesthetics important here. Safari looks nicer, favicons small and noisy. Favicons look cheap. Safari looks professional, it makes website stand out, it doesn’t compete with its content.

Two main arguments from favicon supporters are:

  1. Favicons help to identify tab quickly, find the right tab without need to click or read.
  2. Favicons allow to fit more recognisable tabs in a single window.

I could agree with first argument, it is harder to find the right tab in Safari. But only when people use Safari like they would use Chrome. I believe Safari was created with different workflow in mind.

Web browser is main research tool for me. My goal finding information and returning into apps. My work starts with new Safari window and search query. Then reading and opening new tabs. When need to go back, not trying to use mouse — using hot key command + shift + { to go back, and command + shift + } to go forward. It feels faster than trying to find the right tab, I can see entire pages. I also use command + 1, 2, 3… to open first, second and third tabs and so on.

At some point I need to find particular tab and that’s when I use View > Show All Tabs, another muscle memory combination: command + shift + \. It also works well with iPad and iPhone. Each tab presented as small preview.

Safari window with 6 tabs visible as small page previews.

Safari tab preview is better representation of web pages and its content, from here we can find the right page and close pages we don’t need.

Okay, let’s imagine I had Chrome, then favicons would not help me, some of tabs are from the same domain, which means I have to use keyboard anyway. When you need to click, you need to read title and Safari even has more space to fit it.

The second argument with many tabs in single window is also not a problem. I open new Safari window whenever I have new task at a hand and “Show All Tabs” can help too. Normally I have more than 5 Safari windows open, and this number increases over time. Opening multiple windows allows me to separate my tasks. I close entire windows with one click after task is done.

From what I saw, some Chrome users maximise browser window, this is not how I use Safari, I have many narrow windows so I can see more than one page at a time and hide sidebar distractions behind the scroll area. This also means that I only have tabs I need for a given task.

Option in Preferences is bad solution.

Now answering your possible question, why don’t add option to the Preferences. If Apple designers would ever decide to add the option, it will be enabled by default. Most of people don’t have time and energy to go through settings and fiddle with checkboxes — nerds love it, most of the people don’t. App should be configured in a right way from the start. Hence if Apple designers think that favicons is the right way, they would ship new version with favicons and the will be no option to disable them. Because when you do need to open Preferences, less checkboxes means faster navigation, so there’s no need to search for a toggle.

What if they do it.

I realise that how I use web browser might be not the right way for some people. I see more people use web applications instead of native apps and keep only one maximised window. I spend more time in apps and I use Dock more than I use tab picker. Safari is just another app for me and I don’t do everything there. For math or weather queries Spotlight feels better, I don’t listen to music on YouTube, I use Dictionary app for looking up a definition, I use Xcode documentation window and so on… Safari is just another app for me.

People can change, designers change their opinion. It can happen. It will make me feel sad. Not as much sad as spacial Finder though.

Expectations from High Sierra.

I was pleased to watch High Sierra announcement during WWDC by Craig Federighi. Technology and Refinements was two things given most attention. As software engineer this words is music to my ears. I felt excitement. This is it, this is Mountain Lion moment once again!

All of my work is done on the Mac, I use it every day. macOS has great foundation, unlimited and unrestricted potential. Combined with years of iterative improvements and innovation, we get capable, reliable OS.

It seams like Craig and Phil continue to do excellent job. People will benefit if macOS continue to improve. I am happy that’s there’s wise executives and engineers at Apple who care about Mac and its software. Many people who create amazing things and continue to rely on macOS as their main working horse will benefit from refinements and performance improvements.

Besides Metal 2, APFS, new image and video formats, one thing mentioned by Jhon Siracusa during ATP caught my attention — new initiative to rewrite open source Dynamic linker in order to make apps launch faster. Goal is to reduce time from start moment to main function call. There’s WWDC session. It looks like low level risky work which can be done by few people. Wish them success.

Repairing first generation Apple Watch.

I heard strange pop noise when I took my watch from its charging dock. Then reboot cycle began and I left them on the desk for a night. On next morning, thought of software issue, decided to deal with it later, I put the watch on and couldn’t get touch screen to respond. I could unlock the watch with iPhone. Then on my commute to work reboot cycle began again. I was able to touch in with Apple Pay and I couldn’t touch out with “Card Unavailable” message. I got into the office and while lifting left arm to press door button I heard another short rattling sound coming from my wrist. I shook my wrist, and Apple Watch screen opened like a little door, rattling on thin wires strip. Came back to my desk and feeling upset I put the watch away, gently wrapped it to apply pressure from top and bottom with paper tissues and duck tape, then put them in black spring loaded glasses case to apply even more pressure and security. I thought of it as little coffin and felt sad.

Been busy with work, one or two weeks later, I went online to research the issue. This thread on Apple forum was most popular and gave me little hope it was factory issue. We wouldn’t be able to afford $200 repair cost. I bought them more than 2 years ago and was mostly happy with it, planned to use Apple Watch for another 2.

Next day I had scheduled call and friendly person suggested that the reason is battery which is expanded after large amount of charging cycles. He suggested to bring watch for repair or send him a picture. I regret not taking a picture when screen went loose.

With little hope I went to Apple Store Kingston, there I explained my problem. Apple Store employee couldn’t pick up screen with his nails and screen started to recognise touch input again. Been tightly sealed for a week, it could reverse the damage. It is not safe to use device with damaged battery. Another reason keeping device in a case was fear of fire or even explosion.

I signed estimated £165.83 repair cost, with single part which is entire watch body without band. I was told I don’t need to pay anything right now. He also told me they had replacement program but only for the back of the watch coming loose.

4 working days later I received “Your product is ready for pickup” letter. My hope grew stronger still I couldn’t know what to expect, I could get a bill or my broken watch back but I got small cardboard box, had to sign another waver with the same £165.83 price and £0 due amount. I was asked do I want to open the box right there or home, I choose latter, oh boy what a surprise I got.

Grey box with another white box inside. Sealed 38mm Apple Watch body.

To my delight, Apple sent Apple Watch Series 1, 2016 model with updated dual core CPU straight from China. It was mentioned in email but I wanted to check SN and engraving to be sure. Excelent customer service on every level.

Low Brightness Bug in iOS 10.2.1

10.3 Update.

I need to mention, the main issue is now resolved. People which couldn't see without maximum brightness not suffering any more. From what I found, problem caused by energy saving behaviour and it's also exist in 10.3, however maximum brightness cap is removed.

10.2.1 Problem.

With iOS 10.2.1 update Apple engineers fixed lots of security problems. I was impressed with the list of fixes and the fact that Apple credited some people and organisations which helped to discover the problems.

I went to Twitter to find out how update is doing, as I sometimes do, and found one complaint from Tim Carr about brightness issues on his iPhone 6. First I was sceptical because I read release notes prior and I couldn't make a connection between patching core iOS security and breaking brightness.

Turns out there's real bug which locks maximum iPhone 6 and 6s[^2] brightness at certain battery levels. Tim Carr is registered blind and having maximum screen brightness at all time is very important for him and many other users with visual disabilities. Quick search brought this iMore forum thread which proves that's it's not isolated problem.



Two iPhone 6 phones. Left is without latest update. Right is with latest update. Left screen is much brighter.
Two iPhone 6 phones. Left is without latest update. Right is with latest update. Both set to full brightness. Image from Tim Carr's tweet.

We tried to troubleshoot it and came to a conclusion that's issue was in iOS not his iPhone. I hoped that Apple Support could help and encouraged Tim to talk to them. That's didn't help at all. Tim tried to reach them in many ways — through Twitter and phone calls and couldn't get any solution. In his desperation he even tweeted to Tim Cook:[^1]

and recieved this poor response:

It would be much better if Apple could admit their fault and inform their support team. I bet some iPhone 6 owners talking to Apple Support right now and getting standard responses to restore their devices. Apple Support at this moment has no idea about the problem and taking every enquiry through the standard path when it could be just a single reply: *Thank you, we working on a fix, I'm meanwhile please try to turn Zoom on and off.*

Instead they making it worse:

As Tim found out, there's a workaround. I mentioned it on the top. I also submitted a radar #30612785. Let's hope it's going to be fixed.



[^1]: Note Apple Support monitors tweets to Tim Cook.
[^2]: I couldn't reproduce issue on my 6s which means not all devices affected.

The State of iBooks in Early 2017. ⚓️

Michael E. Cohen from TidBITS wrote amazing post revealing details about current iBooks state. Even found “irritating” Truncated Serif bug I never noticed before. Michael also like me noticed that iBooks sync ignores books added not from the iBooks Store.

His conclusion:

iBooks is not quite as unreliable and confusing as it was when I wrote about it last year, but neither has it improved nearly as much as loyal iBooks users deserve. Moreover, what little support documentation Apple provides is sketchy and inaccurate, leaving the impression that even the support and documentation departments within Apple are ignoring iBooks.

I wrote about iBooks stagnation 2 weeks ago, glad I’m not the only one concerned about its future.

Black Wallpaper.

My iPhone Home Screen.

All my iOS wallpapers are black. I am using simple black wallpaper for iPhone more than 3 years and now also trying it on iPad. Black wallpaper has following perks.

  • Less visual noise on the Home Screen.
  • App icons easier to recognise.
  • Matches nicely with black bezel.1
  • You not getting tired looking at it.

Note original iPhone had black wallpaper.

How to Make One.

Unfortunately Apple doesn’t include it with iOS. To make your own you can use Pixelmator app.

  1. Open Pixelmator app.
  2. Tap on the + icon to Create Image.
  3. Select Custom…
  4. You will get empty canvas with your device screen size. Tap Create.
  5. Tap on the + icon, select Layers control. Pixelmator Layers.
  6. Select black rectangle.
  7. Tap Activity Sheet button and save image to Photos.
  8. Open Photos, tap on the Activity Sheet icon and tap Use as Wallpaper.
  1. My iPad and iPhone are black. 

← Newer Page 1 of 7