V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
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 · Dec 24, 2014 · 2468 views
    This topic created in 4146 days ago, the information mentioned may be changed or developed.

    又是一個很多年前的輪子. 在很多項目中都有用過, 所以整理出來發佈了一個開源 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 replies    2014-12-24 17:52:26 +08:00
    phoenixlzx
        1
    phoenixlzx  
       Dec 24, 2014   ❤️ 1
    给菊苣点个赞.゚٩(๑>◡<๑)۶:.
    lex
        2
    lex  
       Dec 24, 2014
    @livid h2 h3 看上去不如 GitHub 的明显。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2509 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 39ms · UTC 08:36 · PVG 16:36 · LAX 01:36 · JFK 04:36
    ♥ Do have faith in what you're doing.