Giter VIP home page Giter VIP logo

lbxpermission's Introduction

LBXPermission


iOS常用权限获取

image

调用接口简单,易用,如下面相机和定位权限判断及获取

//相机权限获取,已经有权限了,仍然可通过该接口返回状态
    [LBXPermission authorizeWithType:LBXPermissionType_Camera completion:^(BOOL granted, BOOL firstTime) {
     
        if (granted) {
            //TODO
            //dosth
        }
        else if (!firstTime)
        {
            //不是第一次请求权限,那么可以弹出权限提示,用户选择设置,即跳转到设置界面,设置权限
             [LBXPermissionSetting showAlertToDislayPrivacySettingWithTitle:@"提示" msg:@"没有相机权限,是否前往设置" cancel:@"取消" setting:@"设置"];
        }
    }];
    
    
    //定位
    [LBXPermission authorizeWithType:LBXPermissionType_Location completion:^(BOOL granted, BOOL firstTime) {
        
        if (granted) {
            //TODO
            //dosth
        }
        else if (!firstTime)
        {
            //不是第一次请求权限,那么可以弹出权限提示,用户选择设置,即跳转到设置界面,设置权限
            [LBXPermissionSetting showAlertToDislayPrivacySettingWithTitle:@"提示" msg:@"没有定位权限,是否前往设置" cancel:@"取消" setting:@"设置"];
        }
    }];

install by cocoapods

   pod 'LBXPermission/Base'
   pod 'LBXPermission/Camera'
   pod 'LBXPermission/Photo'
   pod 'LBXPermission/Contact'
   pod 'LBXPermission/Location'
   pod 'LBXPermission/Location'
   pod 'LBXPermission/Reminder'
   pod 'LBXPermission/Calendar'
   pod 'LBXPermission/Microphone'
   pod 'LBXPermission/Health'
   pod 'LBXPermission/Net'

install manually

drag folder "LBXPermissions" to your project

备注

demo界面待修改

lbxpermission's People

Contributors

mxabc avatar

Watchers

WuJing 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.