Giter Club home page Giter Club logo

twitterstream's Introduction

README

Prerequisites

  • iOS 8+
  • Latest version of Xcode

Instructions

  • Open App.xcodeproj. When open press run using a simulator or device.

  • Find OAuthAttributes and add the keys and secrets, remember to fix the tests

  • Run the test using CMD + U

  • The project has one view controller called TweetListViewController that shows a list of tweets being tracked. If there is no tweets available you have the chance to retry. In case the stream fails you are able to reconnect also.

  • Unit tests are done with XCTest. The test covearage is 87% there are some bits that will be better cover using App testing with other tools. It would be possible to add more coverage using something like OCMock for Apple classes. (NSURLSession, etc) for that we will have to do some unit testing in Objective C where we pretent to use OCMock.

  • There are not third party libraries and the code is written using the below coding standards

Coding standards

Naming

  • Use descriptive names with camelcase for classes, methods, variables, etc. Classes should be capitalized while method names should start with lowercase

Spacing

  • One line between any line of code (Not on variables definitions)
  • Method braces always open in the same line
  • Use one space separation between any operators for clarity

Code Separation

  • Use //MARK: - to make navigating the code easier

Conditionals

  • Conditionals bodies should always be in braces

Ternary Operator

  • Should only be used when increases clarity

Methods

  • There should be an space between method arguments

Extensions naming

  • ClassName+Functionality

Protocols

  • Declare all protocols in its own file
  • File should have the same name as the protocol

Use of self

  • Avoid using self since Swift doesn’t require it to access objects or methods

Completion blocks

  • Don't include their definition unless is necessary e.g () -> () in remove () -> ()

Types

  • Try to use native types when available

Type inference

  • Let the compiler infer the type for a constant or variable unless you need to specify a type

Semicolons

  • No need to use them, you should not have two statements in the same line

Code header comments

  • Should be removed as the code belongs to the team not to the person the has created the class

Other considerations

  • Keep it simple
  • Keep classes and methods short
  • No comments (the code should be self explanatory)

Project structure

  • Classes
    • AppDelegate
    • Utils
    • Vendors
    • Model
      • Domain
      • Services
    • Controllers
      • ViewControllers (Storyboards)
      • Views
    • Resources
      • Images, fonts, strings, plists, etc

Folders

  • Create class folders in finder and drag them to Xcode

Configs

  • Configuration driven by xcconfigs

Unit Testing

  • Unit testing is done using XCTest

twitterstream's People

Contributors

acastano avatar

Watchers

James Cloos avatar

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.