GithubHelp home page GithubHelp logo

andrea-io / twitter Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 1.0 9.3 MB

A basic Twitter iOS app to read and compose tweets using the Twitter API

Ruby 0.94% Objective-C 99.06%
app-development ios ios-app-development objective-c twitter-api

twitter's People

Contributors

andrea-io avatar

Watchers

 avatar

Forkers

ernest1418

twitter's Issues

Project Feedback!

The point of this project was to explore an example of a full MVC application that reads and writes from a RESTful API. Many iOS apps follow the basic structure of the Twitter app that you built this week. Usually, it's not a public API, but it's a private API, e.g., the private Airbnb or Postmates API.

Here are some general things that you can read through to evaluate your implemenation:

  • Did you minimize the number of public functions and properties in your classes? You should always try to minimize the number of properties and functions that are public or internal. This is a coding best practice.

  • Is your TweetsViewController generic enough that it can be reused to display tweets from other Twitter endpoints? A view controller that displays a list of tweets is the type of view controller that you want to make generic enough that it can be used in multiple places throughout an app. This particular TweetsViewController can come in handy for displaying the user's home timeline, but can also be reused for displaying a list of tweets that mention the particular user, showing another user's timeline, etc.

  • Did you properly handle the conditionally present label "retweeted by..." in your custom TweetCell? You'll notice that for some tweets you'll need to display the "retweeted by..." label and have this hidden for other tweets. You'll want to create an outlet for a top margin AutoLayout constraint and modify the constant depending on whether you want to show the label or not.

  • Another common approach for implementing model classes Having model classes for both Tweets and Users and being able to initialize each one from a json dictionary makes it easier to handle the Twitter network response and turn it into model objects that can be reused throughout your app. It's also a good idea to check out libraries like Mantle which reduce the boilerplate code you need to implement these model classes.

  • Did you handle reply/retweet/favorite actions from within the TweetCell? This is an example where it's useful for your model to be able to handle network actions, so you can simply wire up the buttons to a method like [tweet retweet]. You can even pass in an optional block if you want to handle a failure of the network event.

  • Did you immediately update the retweet and favorite counts when a user retweets or favorites a tweet? It's common practice when building an app to have actions like favoriting a tweet assume network success and ignore any failures. This gives the user an immediate response to his/her action without having to wait for a network response.

  • Did you share code between your ProfileViewController and TimelineViewController? The ProfileViewController and the TimelineViewController both contain a feed of tweets. There are three general strategies: you can have a single view controller that conditionally has the profile header, you can create the ProfileViewController as a subclass of the TimelineViewController, or you can create a separate class called a TimelineController (not a view controller). TimelineController is a dataSource and a delegate to a UITableView and knows how to show a feed of tweets.

  • Each Storyboard scene should have Auto Layout constraints specified for each view. There should be no yellow Auto Layout warnings, even if the layout seems to work. Auto Layout warnings are like having bad HTML. The browser will try to render it, and it might even look right, but it won't be fully predictable.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.