Giter Club home page Giter Club logo

populate's Introduction

Populate

Populate is both an iOS app and library to easily create random-generated contacts.

  • the Populate app let you configure and add contacts to the iOS address book.
  • the PopulateKit library let you create contacts for either adding to the address book or any other purpose.

Build Status Cocoapods Cocoapods

Screenshots

screenshot01    screenshot02

Populate app

Run the app

  1. Install the pods with pod install
  2. Open Populate.xcworkspace (the workspace, not the project), build it and run it
  3. Choose a group name (useful for later deletion), number of contacts, type of name and type of photo
  4. Tap populate to add the contacts
  5. Tap depopulate to remove the group and all its member contacts

You can tap contacts to open the address book without switching apps.

** Be careful not to erase your real contact if you use Populate on a real device **

PopulateKit library

Install with CocoaPods

Add a pod entry to your Podfile:

pod 'PopulateKit', '~> 0.0.4'

Install the pod(s) by running:

pod install

Install manually

  1. clone this repository
  2. add the files in the PopulateKit directory to your project
  3. link your app with the AddressBook framework
  4. set `OTHER_LINKER_FLAGS="-ObjC" for your target

If you want the (optional) identicons, you should also add IGIdenticon to your project.

Usage

Import the header

#import "PopulateKit.h"

Adding contacts to the address book

To add hand-made contacts to the address book, create the contacts with the ACPerson wrapper and add them to Test group in the address book:

ACPerson *personA = [[ACPerson alloc] initWithFirstname:@"Alice"
                                               lastName:@"A"
                                                  email:@"[email protected]"
                                                  phone:@"555-111-1111"
                                                  image:nil];
ACPerson *personB = [[ACPerson alloc] initWithFirstname:@"Bob"
                                               lastName:@"B"
                                                  email:@"[email protected]"
                                                  phone:@"555-222-2222"
                                                  image:nil];
ACPerson *personC = [[ACPerson alloc] initWithFirstname:@"Charlie"
                                               lastName:@"C"
                                                  email:@"[email protected]"
                                                  phone:@"555-333-3333"
                                                  image:nil];

    [ACPopulate populateGroupWithName:@"Test"
                          withPersons:@[personA, personB, personC]
                           completion:nil];

To add randomly-generated contacts instead, use a ACPersonSet:

    [ACPopulate populateGroupWithName:@"Test"
                   withCountOfPersons:10
                              fromSet:[ACPersonSet personSetWithRandomNameAndImage]
                           completion:nil];

It is possible to populate with a custom ACPersonSet by using data sets (ACNameSet and ACImageSet). Here is an example of populating with random first names, common US surnames and identicon avatars:

[ACPopulate populateGroupWithName:@"Test"
               withCountOfPersons:10
                          fromSet:[ACPersonSet setWithFirstNameSet:[ACNameSet randomNameSet]
                                                       lastNameSet:[ACNameSet commonSurnameSet]
                                                          imageSet:[ACImageSet identiconImageSet]
                       completion:nil];

Or you can supply multiple ACPersonSet, like a male and a female set:

[ACPopulate populateGroupWithName:@"Test"
               withCountOfPersons:10
                         fromSets:@[
                                    [ACPersonSet setWithFirstNameSet:[ACNameSet commonMaleNameSet]
                                                         lastNameSet:[ACNameSet commonSurnameSet]
                                                            imageSet:[ACImageSet maleFaceImageSet]],
                                                                     
                                    [ACPersonSet setWithFirstNameSet:[ACNameSet commonFemaleNameSet]
                                                         lastNameSet:[ACNameSet commonSurnameSet]
                                                            imageSet:[ACImageSet femaleFaceImageSet]]
                                    ]
                       completion:nil];

If you want to delete the Test group and all its members from the addess book:

[ACPopulate depopulateGroupWithName:@"Test" completion:nil];

You can also have a look at the Populate app for inspiration.

Generating contacts

If you want to use randomly-generated contacts directly:

ACPersonSet *personSet = [ACPersonSet setWithFirstNameSet:[ACNameSet randomNameSet]
                                              lastNameSet:[ACNameSet commonSurnameSet]
                                                 imageSet:[ACImageSet identiconImageSet]];
ACPerson *person = [personSet randomPerson];
NSLog(@"%@", person.firstName);

Documentation

If you have appledoc installed, you can generate the documentation by running the corresponding target.

populate's People

Contributors

vmalyi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  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.