Chris Hannah Chris Hannah

Chris Hannah

More Generic Stuff in My Micro.blog App

Started some pretty cool stuff in my Micro.blog app last night – generic views for lists of posts!

I already had it working for lists of users, but with the posts, I should be able to add conversations, and other stuff quite easily.

After that, I’m going to work on a generic view for an individual post and user. And then make the navigation much more simple, so whatever you tap on, whether it’s a post in a list, or a user’s photo in a post, the app will detect the context, and present you with the relevant view to show more details about that.

Basically, it will allow for much more user friendly navigation, and hopefully with not too much work!

Micro Blog iOS App Progress - Login UI

I thought I’d do some more work on my Micro.blog iOS client this evening. So far it can only view the following sections:

  • Timeline
  • Mentions
  • Discover
  • Favourites

The code however, is probably the best I’ve ever written. I’ve kept it pretty generic, and it’s something that can definitely be expanded upon pretty quickly now.

What I worked on tonight, was the interface and some of the error handling for the initial login page. I want to support logging in by a Micro.blog username/password, but also by a direct app token.

It is at the minute, a strict Micro.blog client, because I don’t plan on developing a whole blogging application. However I will look into that decision in the future.

For now, here’s a preview of the Login page:

The MacBook Air: A Decade’s Worth of Legacy

Stephen Hackett, writing in his MacStories column:

Today, all of our notebooks are thin and light. We’ve traded our optical drives in for a series dongles and our spinning hard drives for fast, silent SSDs.

It wasn’t always like this. Once upon a time, notebooks had optical drives and a full array of ports, complemented by features like removable batteries.

A decade ago, we entered the current era of notebook design when Steve Jobs pulled the future out of an envelope.

The MacBook Air was a real astonishing product when it first launched, and the envelope presentation shocked quite a lot of people.

Stephen, goes into a lot of detail in his article, where he discusses things like the overall design, the IO it had, and also some of the issues it had.

Along with the article, he also produced another of his insightful videos:

Watch it on YouTube.

Read the full article on MacStories.

Big Cats

Big Cats is a new documentary series, being produced by the BBC. They have an incredible track record with documentaries, especially ones focussed on nature. As proved by the recent Planet Earth II and Blue Planet II series.

This series follows in the same footsteps, as it is being pushed by a new generation of advanced camera technology, and techniques. Which enables them to get some pretty impressive shots of evasive cat species, such as the Snow Leopard, and the Rusty Spotted-Cat.

The first episode is already out, and it’s great! The scenes were impressive, the amount of knowledge about the different species was incredible, and it was just generally intriguing.

It’s the first time I’ve also heard about the Rusty Spotted-Cat, which is the smallest cat species, and grows to between 35 to 48 cm in length, and a 15 to 30 cm tail. They released a small clip from the first episode, so you can watch that below, or on YouTube.

I’m not sure how they can really make the next episode better than the first, but I expect it will go beyond my expectations. Although it is only a three-episode series, so I guess it will also be pretty packed!

BBC – Big Cats

BBC iPlayer – Big Cats – Episode 1

BBC iPlayer – Episode 1 Clip – The world’s smallest cat

 

Two More iPad Pro Focussed Adverts From Apple

Apple today, launched two more videos focussed on the iPad Pro to their YouTube channel.

Augement Reality

With iPad Pro + iOS 11, you can use augmented reality to literally transform the world around you. Your next computer might not be a computer.

Take Notes

With iPad Pro + iOS 11, you can use Apple Pencil to create multimedia notes. Draw, type, or drag and drop your favorite photos from Files. Your next computer might not be a computer.

I’m really enjoying their latest series of iOS 11 videos. It’s not a simple, an iPad is better than a Mac argument. Instead, they tend to focus on a younger user that has no concept of ”a computer”, but treat an iPad as the device.

It’s starting to become even more apparent, that younger generations are the ones that are truly adapting to new technology. Mainly because they haven’t got the burden of really knowing what it was like before these new devices, such as the iPad Pro.

Apple / Meltdown Patches

Just a quick reference of all the patches that fix the Meltdown bug (CVE-2017-5754) on Apple’s operating systems.

watchOS

Not impacted.

tvOS

Patched.
Version: 11.2
Release Date: 4th December 2017
Release Notes

iOS

Patched.
Version: 11.2
Release Date: 2nd December 2017
Release Notes

macOS

Patched.
Version: High Sierra 10.13.2
Patches for older versions:

  • Security Update 2017-005 El Capitan
  • Security Update 2017-002 Sierra

Release Date: 6th December 2017
Release Notes


More information on Meltdown/Spectre.
Apple’s Statement on Markdown/Spectre

Picking a Great Writing Font

Michael Descy has written a great piece about finding a writing font, and why it isn’t just a waste of time.

Choosing the perfect writing font is a classic way to procrastinate—but it is not a waste of time. Fonts are important. A good font is not only highly legible, it also conveys a subliminal emotional effect on the reader. Naturally, it follows that it will also have similar effects on the writer. A good font will make you feel better while you are writing—maybe because you can read it more easily, or because you find elements of it, its curves or serifs, aesthetically pleasing. Whatever the reason, picking a font that is pleasing can have a profound effect on your writing.

He goes into detail on what makes a good writing font, some considerations you will have to make, and also a bunch of great suggestions.

For myself personally, I’ve always used a monospace font to write with. I once saw someone write about it before, although I can’t remember the source, but they explained how they used monospace fonts while they were writing/editing, and a sans-serif for previews. This is similar to how I feel myself.

Because I write everything I do in Markdown, it still feels like I’m writing code, not a programming language, but still something that has to be deciphered before it’s fit to be seen by anyone else. And for some reason, monospace fonts use feel like they represent something that’s in progress.

So, the font I use for nearly everything is SF Mono. It’s the monospace version of Apple’s San Francisco font, and it’s been my favourite ever since they released it. However, it requires some fiddling to have it installed like a regular font. Before that I used the pretty similar, Andale Mono.

Meltdown and Spectre

You’ve probably heard about the two major bugs that have been hitting the news recently. Their names are Meltdown and Spectre, and they affect nearly every modern computer processor.

As there’s so much information flying around the internet, it’s easy to not grasp the whole picture, or just have an easy place to direct other people to.

Luckily, Graz University of Technology have created MeltdownAttack.com, which explains both bugs, links to their relevant papers, and then some common questions and answers.

Meltdown and Spectre exploit critical vulnerabilities in modern processors. These hardware bugs allow programs to steal data which is currently processed on the computer. While programs are typically not permitted to read data from other programs, a malicious program can exploit Meltdown and Spectre to get hold of secrets stored in the memory of other running programs. This might include your passwords stored in a password manager or browser, your personal photos, emails, instant messages and even business-critical documents.

Meltdown and Spectre work on personal computers, mobile devices, and in the cloud. Depending on the cloud provider’s infrastructure, it might be possible to steal data from other customers.

MeltdownAttack.com

A Simple and Clean Way to Store Sectioned Data for a UITableView

This is just something small in Swift/iOS that I find pretty handy, so I thought I’d share it just in case it can help.

So, the problem is that creating data that has to be presented in a UITableView can be somewhat complex, especially if you have multiple columns. This solution is geared towards quickly creating dummy data, but I think it could be expanded into an overall DataSource solution.

Anyway, we’ll start with the current way of managing sections. Usually, you would have some kind of enum that would correspond to a section integer, and also however many arrays of data for the number of sections. You would then either use the section enum to find the correct array. Or maybe you’d use a 2d array, and then use it as the index.

It just doesn’t see very Swift to me. In Swift, everything is simple, easy to read, and is pretty easy to write. So I thought I’d come up with a slight abstraction.

My first idea was to just make two structs, one for a Section, and another for a Table:

struct Section {
    var title: String
    var items: [String]
}

struct Table { var sections: [Section] }

You could then go ahead, create individual sections, and add them to one table. Easy.

Example Data

Animals:

  • Cats
    • Tiger
    • Lion
    • Lynx
  • Bears
    • Grizzly
    • Black
    • Polar

Example Code

let catSection = Section(title: "Cats", items: ["Tiger", "Lion", "Lynx"])
let bearSection = Section(title: "Bears", items: ["Grizzly", "Black", "Polar"])

let animalTable = Table(sections: [catSection, bearSection])

I just find that a bit more readable.

It also makes the number of sections and rows a bit simpler:

let numberOfSections = animalTable.sections.count
let numberOfRows = animalTable.sections[0].items.count

However, you can add this functionality to the Table struct Which makes it much, much better.

Here is the definition of the ComplexTable struct:

struct ComplexTable {
    var sections: [Section]

func numberOfRows(forSection section: Int) -> Int { if sections.count > section { return sections[section].items.count } else { return 0 } }

func numberOfSections() -> Int { return sections.count } }

Which would make it this easy to get the row and section counts:

let numberOfSections = complexAnimalTable.numberOfSections()
let numberOfRows = complexAnimalTable.numberOfRows(forSection: 0)

So there you go.

It’s nothing big, and it won’t win many programming awards. But it’s a small piece of code that will certainly help me when I’m just messing around with tables, or I want a really clean and simple way to store small amounts of organised data.