{"id":20620837,"url":"https://github.com/irons163/irsharemanager","last_synced_at":"2025-10-04T13:56:43.067Z","repository":{"id":56915176,"uuid":"232772220","full_name":"irons163/IRShareManager","owner":"irons163","description":"IRShareManager is a easy framework for deal with share files between the share extension and main app.","archived":false,"fork":false,"pushed_at":"2021-04-15T02:17:34.000Z","size":59415,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-09-17T16:15:33.960Z","etag":null,"topics":["filelist","files-management","ios","objective-c","share-extension","shareextension"],"latest_commit_sha":null,"homepage":"","language":"Objective-C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/irons163.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-01-09T09:30:56.000Z","updated_at":"2021-04-15T02:17:37.000Z","dependencies_parsed_at":"2022-08-21T03:20:43.575Z","dependency_job_id":null,"html_url":"https://github.com/irons163/IRShareManager","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/irons163/IRShareManager","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/irons163%2FIRShareManager","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/irons163%2FIRShareManager/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/irons163%2FIRShareManager/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/irons163%2FIRShareManager/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/irons163","download_url":"https://codeload.github.com/irons163/IRShareManager/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/irons163%2FIRShareManager/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278322146,"owners_count":25967874,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-04T02:00:05.491Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["filelist","files-management","ios","objective-c","share-extension","shareextension"],"created_at":"2024-11-16T12:15:49.759Z","updated_at":"2025-10-04T13:56:43.051Z","avatar_url":"https://github.com/irons163.png","language":"Objective-C","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Build Status](https://img.shields.io/badge/build-%20passing%20-brightgreen.svg)\n![Platform](https://img.shields.io/badge/Platform-%20iOS%20-blue.svg)\n\n# IRShareManager \n\n- IRShareManager is a easy framework for deal with share files between the share extension and main app.\n\n## Features\n- Easy to share files into main app by Share Extension.\n\n## Install\n### Git\n- Git clone this project.\n- Copy this project into your own project.\n- Add the .xcodeproj into you  project and link it as embed framework.\n#### Options\n- You can remove the `demo` and `ScreenShots` folder.\n\n### Cocoapods\n- Add `pod 'IRShareManager'`  in the `Podfile`\n```objc\ntarget 'Demo' do\n  # Comment the next line if you don't want to use dynamic frameworks\n  use_frameworks!\n\n  # Pods for Demo\n  pod 'IRShareManager'\nend\n\ntarget 'ShareExtension' do\n  # Comment the next line if you don't want to use dynamic frameworks\n  use_frameworks!\n\n  # Pods for ShareExtension\n  pod 'IRShareManager'\nend\n```\n- `pod install`\n\n## Usage\n\n### Basic\n\n#### Share Extension\n\n- Create Share Extension, go to `Signing \u0026 Capabilities` \u003e `+ Capability` \u003e `App Groups` \u003e Add a new group/group id\n\n- Put codes into `ShareViewController.m`\n\n```\n...\n#import \u003cIRShareManager/IRShare.h\u003e\n\n@implementation ShareViewController\n\n- (BOOL)isContentValid {\n    ...\n    [IRShare sharedInstance].groupID = YOUR_GROUP_ID;\n    return YES;\n}\n\n- (void)didSelectPost {\n    [[IRShare sharedInstance] showSaveAlertIn:self];\n    [[IRShare sharedInstance] didSelectPostWith:self.extensionContext];\n}\n\n@end\n```\n\n#### Load Resources\n\n- , go to `Signing \u0026 Capabilities` \u003e `+ Capability` \u003e `App Groups` \u003e Choose a group/group id that the same of yo\n\n- Load reseources which was shared by share extension in the main app\n\n```obj-c\n...\n#import \u003cIRShareManager/IRShare.h\u003e\n\n@implementation AppDelegate\n\n- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {\n    ...\n    [self saveImageIfExistInActionExtention];\n    return YES;\n}\n\n- (void)applicationWillEnterForeground:(UIApplication *)application{\n    NSLog(@\"applicationWillEnterForeground\");\n    ...\n    [self saveImageIfExistInActionExtention];\n}\n\n- (void)saveImageIfExistInActionExtention {\n    [IRShare sharedInstance].groupID = YOUR_GROUP_ID;\n    NSURL *directoryURL = [IRShare sharedInstance].directoryURL;\n    \n    NSFileManager *fileManager = [NSFileManager defaultManager];\n    NSArray *keys = [NSArray arrayWithObject:NSURLIsDirectoryKey];\n    NSDirectoryEnumerator *enumerator = [fileManager\n    enumeratorAtURL:directoryURL\n    includingPropertiesForKeys:keys\n    options:0\n    errorHandler:^(NSURL *url, NSError *error) {\n        // Handle the error.\n        // Return YES if the enumeration should continue after the error.\n        return YES;\n    }];\n    \n    NSMutableArray *urlsToDelete = [[NSMutableArray alloc] init];\n    for (NSURL *url in enumerator) {\n        NSLog(@\"url:%@\", url);\n        NSError *error;\n        NSNumber *isDirectory = nil;\n        if (! [url getResourceValue:\u0026isDirectory forKey:NSURLIsDirectoryKey error:\u0026error]) {\n            // handle error\n        }\n        else if (! [isDirectory boolValue]) {\n            [self saveImportFileIntoDB:url];\n        }\n        \n        [urlsToDelete addObject:url];\n    }\n    \n    for(NSURL *url in urlsToDelete){\n        [[NSFileManager defaultManager] removeItemAtURL:url error:nil];\n    }\n}\n\n- (void)saveImportFileIntoDB:(NSURL *)url {\n    NSString *fileName = [[url absoluteString] lastPathComponent];\n    fileName = [fileName stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding];\n    \n    NSString *resourceDocPath = [[NSString alloc] initWithString:[[NSTemporaryDirectory() stringByDeletingLastPathComponent]stringByAppendingPathComponent:@\"Documents\"]];\n    \n    fileName = [self getNewFileNameIfExistsByFileName:fileName];\n    \n    NSString *filePath = [resourceDocPath stringByAppendingPathComponent:fileName];\n\n    [[NSFileManager defaultManager] copyItemAtPath:[url path] toPath:filePath error:nil];\n}\n\n@end\n```\n\n## Screenshots\n| Share Extension | Files List |\n|:---:|:---:|\n|![Share Extension](./ScreenShots/demo2.png)|![Files List](./ScreenShots/demo1.png)| \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Firons163%2Firsharemanager","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Firons163%2Firsharemanager","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Firons163%2Firsharemanager/lists"}