iOS-Runtime-Headers icon indicating copy to clipboard operation
iOS-Runtime-Headers copied to clipboard

Help to integrate and use headers

Open shaikshabana opened this issue 9 years ago • 2 comments

Can any one guide me on how can i add this headers into my application and how can i use those,

for Sample please take below code as example and help to achieve this,

BOOL isInstalled = [[LSApplicationWorkspace defaultWorkspace] applicationIsInstalled:@"com.app.identifier"];

if (isInstalled) { // app is installed } else { // app is not installed }

This code is in below link, https://github.com/nst/iOS-Runtime-Headers/blob/master/Frameworks/MobileCoreServices.framework/LSApplicationWorkspace.h.

Can you please help me to integrate this headers,where actually i need to copy and how can i import that .h file to use method.

Please help me as soon as possible.

shaikshabana avatar Nov 17 '15 05:11 shaikshabana

You should not directly call the private Class method.You can test the code below.Create a new class and init the private class.

@interface SCApplicationWorkspace() @property (strong, nonatomic) id applicationWorkspace;

//test LSApplicationWorkspace instance method

  • (void)testApplicationWorkspace; @end

@implementation SCApplicationWorkspace

  • (id)defaultWorkspace{

    return nil; }

  • (id)applicationWorkspace{

    if (!_applicationWorkspace) { //LSApplicationWorkspace Class class = NSClassFromString([@[@"L",@"S",@"App",@"lication",@"Work",@"space"] componentsJoinedByString:@""]); _applicationWorkspace = [class defaultWorkspace]; } return _applicationWorkspace; }

  • (BOOL)applicationIsInstalled:(NSString *)arg1{ return NO; }

  • (id)allInstalledApplications{ return nil; }

  • (void)testApplicationWorkspace{

// { // id object = [self.applicationWorkspace allInstalledApplications]; // NSLog(@"object %@",object); //log array LSApplicationProxy // } { BOOL value = [self.applicationWorkspace applicationIsInstalled:@"com.apple.Passbook"]; NSLog(@"object %@",@(value)); //log "object 1" } { BOOL value = [self.applicationWorkspace applicationIsInstalled:@"com.apple.PassbookNULL"]; NSLog(@"object %@",@(value)); //log "object 0" } }

@end

xl19880619 avatar Nov 24 '15 04:11 xl19880619

@xl19880619

People could use comments like yours at the iPhoneDevWiki.

Great answers like these are everywhere but not enough people are contributing to nice, clean, readable docs. : /

ruslan-ardashev avatar Nov 24 '15 20:11 ruslan-ardashev