Skip to content

Instantly share code, notes, and snippets.

View maheshgiri's full-sized avatar
:octocat:
Work from home building something

Mahesh Giri maheshgiri

:octocat:
Work from home building something
  • pune
View GitHub Profile
@maheshgiri
maheshgiri / InviteFromContacts.swift
Last active January 24, 2017 06:19
Add Pagination in existing array in IOS using swift.
//
// InviteFrdsController.swift
import UIKit
import Contacts
import AlamofireImage
import MessageUI
class InviteFrdsController: UIViewController,UITableViewDelegate,UITableViewDataSource,MFMessageComposeViewControllerDelegate,UIScrollViewDelegate
{
add ```UIScrollViewDelegate``` in tableview/collectionview
``` var isDataLoading:Bool=false
var pageNo:Int=1
var limit:Int=0
var offset:Int=0
var connectionCount:Int=0```
```override method func scrollViewDidEndDragging(_ scrollView: UIScrollView, willDecelerate decelerate: Bool) {
if scrollView == collectionView{
@maheshgiri
maheshgiri / gist:76e624ddd9e83d47b853c9f189767581
Last active November 17, 2016 09:56
Swift 3 Create Custom Segue
In swift3 create one segue -add identifier -add and set in segue(storyboard) custom storyboard class from cocoatouch file -In custom class override perform()
'override func perform() {
let sourceViewController = self.source
let destinationController = self.destination
let navigationController = sourceViewController.navigationController
// Pop to root view controller (not animated) before pushing
if self.identifier == "your identifier"{
navigationController?.popViewController(animated: false)
navigationController?.pushViewController(destinationController, animated: true)