Monday, March 28, 2016

"Find what you love and let it kill you"

Challenge




Technical notes
  • Language - Swift 2.2
  • Base SDK - 9.3
  • Deployment target - 8.0
  • Architecture - MVVM
  • Database : Realm 0.98.6  
  • Layouts - Single storyboard w/autolayouts
  • Allow orientations? Yes
  • Target? Universal (iPhone/iPad)
  • Dev Time : 2 days



Day 1
  • Done
    • Offline support (the records are download and store for offline use).
      • All images are download and cached for future use.
      • All feed records are stored.
    • Simple touch/press on a feed row will open a new window (UINavigationController).
    • Long press on a feed row will open a preview window.
    • Pull down to refresh (in the feed) will delete all records, and images (app reset).
    • Carthage dependency manager
  • Todo/Errors
    • N/A


Day 1 result






Day 2
  • Bug's

    • If the app starts with no internet connection, when the the connection is gained again, the app doesn't detect that event to automatic reload it self.
    • When the app rotates (to landscape), the screen isn't adjusting it self (but if the app starts in landscape mode, the screen is OK)
    • Only in iPhone6 (not in other devices). The method static fun recordsCount() is returning 0.  [Fixed here]
  • Improvements
    • A more elegant "Pull to refresh" control?
    • Unit tests?
    • Use the same font color in all text messages.
    • Use NSOperationqueue to download just one image at the time (2 at most) [Fixed here]
      • Depending on the user network connection, the app could change the number of images the user could downloads the the time
        • 2G, 3G download 1 image at the time,
        • 4G, Wifi, 2 images at the time.
      • If the user try's to see a new image (not yet ever download), that image is added to the queue of images to be download. But if the user continues scrolling down on the feed, maybe the user is not interested in that previous image anymore. So that image show be removed from the queu (of images currently downloading) and the present image that the user is seeing should be added to the queue. 


Day 2 (final version) result





Final version (iPhone-Portrait) screen shots


Different UIFonts testing...

If the user opens the app for the first time and have no Internet connection (nor either cached images/records)

Image preview (on long pressing a feed row)


Pull to refresh - Will delete all records, all cache images and will request the feeds all over again

Scrolling... The top bar fades (should it disappear insted?)

When simple selecting a feed row, its pushed the image.



Final version (iPhone-Landscape) screen shots





Final version (iPad-Portrait) screen shots








Final version (iPad-Landscape) screen shots








Final version source code



The source code can be downloaded here

The project contains several app's separated by different schemes and target. 

Run the app scheme "App_7"

No comments:

Post a Comment