Giter Site home page Giter Site logo

mnfloatbtn's Introduction

MNFloatBtn

demo示例

Installation

Manually

Just add the MNFloatBtn folder to your project

CocoaPods

Use CocoaPods with Podfile:

pod 'MNFloatBtn'
github "miniLV/MNFloatBtn"

Usage

  • The floating button is displayed in any case
[MNFloatBtn show];

  • Display the floating button only in Debug mode (recommended)
[MNFloatBtn showDebugModeWithType:MNAssistiveTypeNone];

  • remove floating button
[MNFloatBtn hidden];
  • touch event
[MNFloatBtn sharedBtn].btnClick = ^(UIButton *sender) {

	NSLog(@" btn.btnClick ~");
    
};

Advanced usage

  • The current date is displayed by default
[[MNFloatBtn sharedBtn] setBuildShowDate:YES];
  • Configure the api environment display

#define kAddress            @"testapi.miniLV.com"
//#define kAddress            @"devapi.miniLV.com"
//#define kAddress            @"api.miniLV.com"
    
//Configure yourself - what api environment, what label to display
NSDictionary *envMap = @{
                         @"test":@"testapi.miniLV.com",
                         @"dev":@"devapi.miniLV.com",
                         @"pro":@"api.miniLV.com"
                         };
                             
//Set different titles to be displayed in different environments, as well as the current Host
[[MNFloatBtn sharedBtn]setEnvironmentMap:envMap currentEnv:kAddress]; 
    


中文版使用说明

集成方法

1.CocoaPods : pod 'MNFloatBtn'

2.手动导入 : 拖入MNFloatBtn文件夹

使用方法

  1. 导入头文件,#import <MNFloatBtn/MNFloatBtn.h>
  2. 一行代码,显示悬浮按钮

  • 任何情况都显示悬浮按钮
[MNFloatBtn show];

  • 仅在Debug模式下显示悬浮按钮(推荐使用)
[MNFloatBtn showDebugModeWithType:MNAssistiveTypeNone];

  • 移除悬浮按钮在界面上显示
[MNFloatBtn hidden];
  • 按钮点击事件
[MNFloatBtn sharedBtn].btnClick = ^(UIButton *sender) {

	NSLog(@" btn.btnClick ~");
    
};

进阶用法:

  • 默认显示当前日期
[[MNFloatBtn sharedBtn] setBuildShowDate:YES];
  • 配置api环境显示

#define kAddress            @"testapi.miniLV.com"
//#define kAddress            @"devapi.miniLV.com"
//#define kAddress            @"api.miniLV.com"
    
//自己配置 - 什么api环境下,要显示什么标签
NSDictionary *envMap = @{
                         @"测试":@"testapi.miniLV.com",
                         @"开发":@"devapi.miniLV.com",
                         @"生产":@"api.miniLV.com"
                         };
                             
//设置不同环境下,要展示的不同title,以及当前的Host
[[MNFloatBtn sharedBtn]setEnvironmentMap:envMap currentEnv:kAddress]; 
    

如果你在天朝,可以看这篇中文博客 文章介绍

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.