Latest 1.0.1
License MIT
Platforms ios 8.0, requires ARC


UIViewController Subclass for refreshing User Interface/Data when there is a logout involved in your app

Table of Contents


To install KZViewController via cocoapods, simply use the add this in your podfile and then run pod install

pod 'KZViewController'

How to Use

Simply Subclass your UIViewController with KZViewController instead if using UIViewController.

class SomeViewController: KZRefreshViewController { 


On your AppDelegate if you want to see logs of KZViewController’s userDidLogout(), userStillLoggedIn(), loggedOutNotification, viewDidRefresh() and viewWillRefresh() just add this snippet inside didFinishLaunchingWithOptions

func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {

    // this automatically defaults to false if not set
    KZVCHelper.sharedInstance.showLogs = true 

    return true

KZViewController is a UIViewController subclass

Refresh UI/Data

Inside your SomeViewController class simply override the refresh() function like this

// this function is called on viewWillAppear
override func viewWillRefresh() {
    // do refresh of variables and user interface here

// this function is called by viewWillRefresh
override func viewDidRefresh() {
    // do something after refresh

Quick note these functions are only called once and you’d need to call KZVCHelper.logOut() again to refresh all UIViewControllers sublcassed with KZRefreshViewController

On logout

Simply call this function when logging out so that viewWillRefresh() will be called on viewWillAppear() of your SomeViewController class

//inside some logout block

Performing something on Logout

You can do some other stuff if the user has logged out by overriding userDidLogout() function

override func userDidLogout() {
    //do something if user has logout

Performing something if still LoggedIn

You can do some other stuff if the user is still LoggedIn out by overriding userStillLoggedIn() function

override func userStillLoggedIn() {
    //do something if still loggedIn

Latest podspec

    "name": "KZViewController",
    "version": "1.0.1",
    "summary": "UIViewController Subclass",
    "homepage": "",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    "authors": {
        "Zonily Jame Pesquera": "[email protected]"
    "social_media_url": "",
    "platforms": {
        "ios": "8.0"
    "requires_arc": true,
    "source": {
        "git": "",
        "tag": "1.0.1"
    "source_files": [
    "pushed_with_swift_version": "3.0"

Pin It on Pinterest

Share This