V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
iOS 开发实用技术导航
NSHipster 中文版
http://nshipster.cn/
cocos2d 开源 2D 游戏引擎
http://www.cocos2d-iphone.org/
CocoaPods
http://cocoapods.org/
Google Analytics for Mobile 统计解决方案
http://code.google.com/mobile/analytics/
WWDC
https://developer.apple.com/wwdc/
Design Guides and Resources
https://developer.apple.com/design/
Transcripts of WWDC sessions
http://asciiwwdc.com
Cocoa with Love
http://cocoawithlove.com/
Cocoa Dev Central
http://cocoadevcentral.com/
NSHipster
http://nshipster.com/
Style Guides
Google Objective-C Style Guide
NYTimes Objective-C Style Guide
Useful Tools and Services
Charles Web Debugging Proxy
Smore
Elethom
V2EX  ›  iDev

PRPrivacyManager: iOS 上的 all-in-one 權限管理庫. All-in-one privacy manager for iOS. (on CocoaPods)

  •  1
     
  •   Elethom ·
    Elethom · 2014-12-24 13:37:25 +08:00 · 2010 次点击
    这是一个创建于 3416 天前的主题,其中的信息可能已经有所发展或是发生改变。

    又是一個很多年前的輪子. 在很多項目中都有用過, 所以整理出來發佈了一個開源 pod. XD

    View on GitHub

    PRPrivacyManager

    Cocoapods

    All-in-one privacy manager for iOS.

    Currently supported:

    Installation

    With CocoaPods

    In your Podfile:

    pod 'PRPrivacyManager'
    

    Usage

    Check for Status

    PRPrivacyStatus privacyStatus = [PRPrivacyManager privacyStatusForType:PRPrivacyTypeContacts];
    

    Ask for Permission

    [PRPrivacyManager authorizeWithType:PRPrivacyTypeContacts
                             completion:^(TTPrivacyStatus status) {
                                 // Handle result
                             }];
    

    Available Types

    typedef NS_ENUM(NSUInteger, PRPrivacyType) {
        PRPrivacyTypeContacts,
        PRPrivacyTypePhotos,
        PRPrivacyTypeMicrophone,
        PRPrivacyTypeCamera
    };
    

    Statuses

    typedef NS_ENUM(NSUInteger, PRPrivacyStatus) {
        PRPrivacyStatusNotDetermined,
        PRPrivacyStatusRestricted,
        PRPrivacyStatusDenied,
        PRPrivacyStatusAuthorized
    };
    

    All done! You can check out the code in the demo provided.

    License

    This code is distributed under the terms and conditions of the MIT license.

    Donate

    You can support me by:

    :-)

    Contact

    2 条回复    2014-12-24 17:52:26 +08:00
    phoenixlzx
        1
    phoenixlzx  
       2014-12-24 13:45:54 +08:00   ❤️ 1
    给菊苣点个赞.゚٩(๑>◡<๑)۶:.
    lex
        2
    lex  
       2014-12-24 17:52:26 +08:00
    @livid h2 h3 看上去不如 GitHub 的明显。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2213 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 32ms · UTC 07:43 · PVG 15:43 · LAX 00:43 · JFK 03:43
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.