Code Monkey home page Code Monkey logo

colourlove's Introduction

ColourLove (updated for iOS7)

This project only purpose is to provide brief, clean and readable code in a dummy application. It is heavily library based and MVC oriented and shows mecanisms like downloading, storing and displaying data from a webservice.

You are of course invited to use, fork and improve this project using your own knowledge.

Philosophy

Architecture

Here is the file hierarchy as is in the project. We aim to have a clear view of our MVC components.

.
|-- Classes
|   |-- AppDelegate.h
|   |-- AppDelegate.m
|   |-- Constants.h
|   |-- Models
|   |-- Controllers
|   |-- Views
|   |-- Helpers
|-- Supporting Files
|-- Resources
    |-- Images
|-- Frameworks
|-- Products
|-- Pods.xcconfig

Conventions

In this project I rely on some naming conventions :

Classes

  • ViewControllers are suffixed by 'VC'
  • Models should be self-explanatory and match the server model (if any)
  • Custom views should indicate the superclass type (like ColorCell which extends UITableViewCell)

Methods

  • Networking methods should always begin with the keyword request, like requestColors
  • User interaction method should always begin with select

Best practices

K&R indentation

All code should respect (K&R style : http://en.wikipedia.org/wiki/Indent_style#K.26R_style)

	- (void) foo
	{
	    if(bar == 1){
	        bar = 2;
	    }
	}

Fast declarations

Use fast declarations as much as possible gives a more readable, less cluttered code.

// Arrays
// No
[NSArray array];
[NSArray arrayWithObjects:@"foo", @"bar",nil];
[array objectAtIndex:index];
// Yes
@[];
@[@"foo",@"bar"];
array[index];

// Dictionaries
// No
[NSDictionary dictionary];
[NSDictionary dictionaryWithObjects:@"object", @"key",nil];
[dictionary objectForKey:key];
// Yes
@{};
@{@"key" : @"object"};
dictionary[key];

// Numbers
// No
[NSNumber numberWithInt:1];
// Yes
@1;

How to install

Dependencies are managed with CocoaPods, which I recommend you to have a look at : http://cocoapods.org/

git clone [email protected]:kirualex/ColourLove.git
cd ColourLove
gem install cocoapods
pod setup
pod install
open ColourLove.xcworkspace

Screenshots

ColorsVC

1

PalettesVC

2

PatternsVC

3

colourlove's People

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.