HabraReader — conveniently read ... on iOS devices

Some time ago decided to develop programs for iOS. I wanted to write something for the soul and as a first project, I chose the app for my favorite website habrahabr.ru as at that time handy program for reading posts that meet my requirements, it was not. I imagined what properties should have the application, which would use every day, and I got the following list:

the
    the
  • simple interface
  • the
  • able to read the posts in the road when no Internet
  • the
  • opportunity to work with hubs/posts/search
  • the
  • able to see only those posts that I have not read it
  • the
  • automatically synchronize the list and read all my favourites between iOS devices
  • the
  • support habracut


Actually it will be about how I solved problems and what the result was.


Preparation



First of all I decided to prepare theoretical looked Stanford courses, read the book "Programmable for iPhone and iPad" Pilonov, reviewed available in the App Store store books on iOS development. Just want to say that I did all not quite right or even completely wrong. I really enjoyed the course: the speaker has a sense of humor, clearly knows and loves what tells. However, these courses would be better to listen to and in parallel to apply what you are talking about. In my case, much of what was described a "weathered" by the time when it came to practical use of gained knowledge. A book bought under the impression of good books on design patterns from the same series, but I was completely disappointed — too much water and banality. Books on iOS development, downloaded in the App Store, I obviously did not read in that order. Later Apple released a great introduction I suggest all novice iOS programmers.

In the end the preparatory part was spent much more time than required.

Development



One of the most important and successful decisions in the early development was the use of cocoapods to manage dependencies. Using cocoapods connecting the new library requires quite a bit of time. Over 15 years of experience developing commercial C++ programs I was tempted to write the whole model to the "native" language, but I kept thinking that if we are to learn a new platform, then do it to the end. In the end, wondering "clumsiness" of the local containers, and drank the Cup to the bottom, writing everything in Objective C. Maybe in future projects I will still try the model to use boost ( the library is in cocoapods ) — I suspect that the process will go much faster.

One of the main requirements in the development had the support habracut and opportunity already in the list of posts to read the beginning of the article, see pictures and video. I solved this problem using standard class UITableViewCell with variable height. Each cell is shown using the Core Text, that is, at this point I completely abandoned the built-in browser UIWebView. So the result looks like for the iPad in landscape orientation:


vertical orientation:


In the horizontal orientation for the iPhone:


It is seen that the TabBar for horizontal orientation displaced to the left, thus saving valuable space vertically, and the fingers of the left hand to switch tabs with this arrangement more convenient.

For iPad separately, it was necessary to solve the problem of displaying a list of hubs. From the standard UISplitViewController had to be abandoned — I haven't been able to find a simple solution to show/hide the master view (a list of hubs) with the use of animation and used one of the many libraries that support sliding views. The result is something like this:

The screen for reading articles I wanted to keep as free as possible. Initially only shows the ToolBar, but you can switch to full screen mode (ToolBar and StatusBar will be hidden). In the list of controls remained only the necessary:
the
    the
  • toggle forward/back in history
  • the
  • closing a window
  • the
  • reload the page
  • add post to favorites the

  • button of departure links of the post in different social networks

Here's how it looks on iPhone:


iPad version:


the option fullscreen mode:


For management convenience, add a variety of gestures:

the
    the
  • in the list of posts with a tap delay of said read, or on the contrary the post new
  • the
  • in the list of posts with a delay tap with two fingers adds or removes the post from the favorites list
  • the
  • when reading a post with a delay tap with two fingers toggles fullscreen mode
  • the
  • when reading the post swipe with two fingers moves to the previous/next post of the current hub.


For synchronization between the devices naturally used iCloud. Due to the fact that the list is read only transferred a number of posts, and favorites list is only the beginning of each post (without pictures), managed to achieve the minimal use of traffic. The app itself is free, but the list of posts is screwed, which can be disable via in-app purchase. No functional limitations for the free version no.

Plans


Depending on how everyone is interested, I plan to write more about the technical aspects of development. There are also big plans to improve the app:
the
    the
  • to Optimize the speed. Scrolling should be as smooth
  • the
  • to Add more animation in the opening post, when you change the list of posts, if you sync via iCloud, etc.
  • the
  • to Integrate support additional functionality, which accustomed users of habrahabr, such as adding comments, a list of their hubs, answers questions, best posts, etc.


Huge request to write about the wishes, the comments, leave feedback and good ratings, what was the motivation to improve the app further.

The application itself can be found at this address.
Article based on information from habrahabr.ru

Комментарии

Популярные сообщения из этого блога

Fresh hay from the cow, or 3000 icons submitted!

Knowledge base. Part 2. Freebase: make requests to the Google Knowledge Graph

Group edit the resources (documents) using MIGXDB