TestsTested | ✗ |
LangLanguage | Obj-CObjective C |
License | MIT |
ReleasedLast Release | Dec 2016 |
Maintained by raxcat.
To run the example project, clone the repo, and run pod install
from the Example directory first.
Add this line of code when you need to know about disk events.
[[IdentifyUSBMassStorage shareManager] addMassStorageDeviceEventListener:self];
And implement event delegates
#pragma mark - IdentifyUSBMassStorageEvent
-(NSDictionary*)matchingDict{
//Example of matching: Trancend thumbdrive, pid: 0x1000, vid:0x8564
return @{ kDiskDevicePropertyVendorID:@(0x8564), kDiskDevicePropertyProductID:@(0x1000) };
// //Example of matching: pid: 0x1000 only.
// return @{ kDiskDevicePropertyProductID:@(0x1000) };
//
// //Example of matching: vid:0x8564 only.
// return @{ kDiskDevicePropertyVendorID:@(0x8564) };
//
// //Example of no restriction. matching all.
// return nil;
}
-(void)massStorageDeviceDidPlugIn:(DADiskRef)disk{
}
-(void)massStorageDeviceDidPlugOut:(DADiskRef)disk{
}
IdentifyUSBMassStorage is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod "IdentifyUSBMassStorage"
raxcat liu, [email protected]
IdentifyUSBMassStorage is available under the MIT license. See the LICENSE file for more info.