GithubHelp home page GithubHelp logo

mahipal-credencys / contacthelperswift3 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from piyush-sinroja/contacthelperswift3

1.0 2.0 0.0 313 KB

ContactHelperSwift3 contains Fetch, Delete, Add and Update Contact Functionality

License: MIT License

Swift 100.00%

contacthelperswift3's Introduction

ContactHelperSwift3

ContactHelperSwift3 contains Fetch, Delete, Add and Update Contact Functionality

Contact List And Search Contact alt tag

Delete Contact

alt tag

Add Contact

alt tag

Update Contact

alt tag

CountrySelect

alt tag ContactHelper

with the help of this, We can Fetch Contact, Delete Contact from Device and Add/Update Contact To Device. We Can also modify According to our requirement.

Advantages of this Demo: 1: Contact Functionality

Fetch , Delete , Update, Add Contact

2: Country Picker Functionality

Search Functionality,  Country picker Added, Country JSON Self Made.   Convert Country Code To Country Name.

Steps:

  1. import Contacts and ContactsUI frameworks in your project.

  2. In info.plist File add key : Privacy - Contacts Usage Description.

  3. Add this line In viewWillAppear function

ContactHelper.objContactHelper.delegateContact = self

  1. Fetch Contact Details

ContactHelper.objContactHelper.getContactList(controller: self)

// Here Self is ViewController

// When We Call Above Method then Below Delegate Method is Automatic Call Through Delegate

func allContactList(array: NSArray)

this method is Delegate Method that Contains Array of Contact Details

  1. Add NewContact Details

ContactHelper.objContactHelper.addContact(addDic: dicDetails, controller : self)

// Here DicDetails

let DicDetails: NSDictionary = ["Fullname": ArrayOFFullname , "Mobile": fullNo, "EmailID" : emailId]

// self is ViewController

  1. Update Contact Details

ContactHelper.objContactHelper.updateContact(addDic: dicDetails, contactModel: contactModel!, controller: self)

// Here DicDetails

let DicDetails: NSDictionary = ["Fullname": ArrayOFFullname , "Mobile": fullNo, "EmailID" : emailId]

// ContactModel is contactModel which you want to Update

// self is ViewController

// After Add/Update Method

Below Delegate Method is Called

func contactAddedOrUpdateSuccess()

  1. Delete Contact Detail

ContactHelper.objContactHelper.deleteContact(dicdata: dicData, controller: self)

// Here Dicdata is your ContactDetails

// in DicData ContactModel is Available which we want to Delete

Note: please print DicData then You will know

// self is ViewController

// After Delete successfull Fetch Contact Details With this Delegate Method

func allContactList(array: NSArray)

  1. Take Extension of ContactFetchDelegate

//These Are Delegate Methods of ContactFetchDelegate

func allContactList(array: NSArray) func contactAddedOrUpdateSuccess() func updateDetails(indexpathValue: IndexPath)

  1. You Can Also Modify ContactHelper.swift According yo your requirement

// Please Check Demo For More Details

contacthelperswift3's People

Contributors

piyush-sinroja avatar

Stargazers

Mahipalsinh avatar

Watchers

James Cloos avatar Mahipalsinh 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.