Giter Site home page Giter Site logo

ffviewcontrolplaceholdview's Introduction

FFViewControlPlaceHoldView(本模块使用需要加入以下2个第三方库 MBProgressHUD 和 FFToastView)

Placehold View For UIViewControl, Like : Loading View, Empty View, Error View(Tap Reloading)

为IOS App开发提供一些便捷功能

************ 使用 **************

1.App启动时初始化相关资源

//loading数据时的动态图(由大于等于2张图组成)
NSArray *loadImageArray = [NSArray arrayWithObjects:[UIImage imageNamed:@"icon_hud_1.png"], [UIImage imageNamed:@"icon_hud_2.png"], [UIImage imageNamed:@"icon_hud_3.png"], nil];


//loading的提示,网络错误图片,空白页面图片,以及屏幕上的提示字符串
[UIViewController initDefaultVCControllerPalceHoldRes:loadImageArray loadingText:@[@"第一个提示",   @"第二个提示"] errorImage:[UIImage imageNamed:@"icon_error_network.png"] errorText:@[@"第一个错误提示",   @"第二个错误提示"] emptyImage:[UIImage imageNamed:@"vcEmpty.png"] emptyText:@[@"我是空白页面"]];

2.在你的UIViewController中import头文件 UIViewController+FFViewControllerPlaceholdHelper.h

当你开始请求网络数据时

self.vcStates = eVCStatesLoading;

网络请求成功,且有数据

self.vcStates = eVCStatesLoadingSucceed;

网络请求成功,但是数据为空

self.vcStates = eVCStatesLoadingEmptyData;

网络请求失败

self.vcStates = eVCStatesLoadingFailedNetError;

************* 细节说明 ******************

主要类说明:UIViewController+FFViewControllerPlaceholdHelper 是一个UIViewcontroller 的 category

提供以下功能:

1.HUD loading

2.自定义动态图loading

3.展示错误界面,支持点击重新加载

4.展示空白页面

5.展示toast(类似于Android的一些消息提示功能)

ffviewcontrolplaceholdview's People

Contributors

wujiangwei avatar

Stargazers

renmoqiqi avatar c.c avatar Bob Edmonston avatar 挡不住的君文 avatar  avatar

Watchers

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