mirror of
https://github.com/arichornlover/uYouEnhanced.git
synced 2026-04-21 11:52:00 +00:00
Update uYouPlusSettings.xm
This commit is contained in:
parent
9950cc2200
commit
51a3522ee7
1 changed files with 3 additions and 1 deletions
|
|
@ -250,8 +250,10 @@ extern NSBundle *uYouPlusBundle();
|
||||||
// Import Settings functionality
|
// Import Settings functionality
|
||||||
UIDocumentPickerViewController *documentPicker = [[UIDocumentPickerViewController alloc] initWithDocumentTypes:@[@"public.text"] inMode:UIDocumentPickerModeImport];
|
UIDocumentPickerViewController *documentPicker = [[UIDocumentPickerViewController alloc] initWithDocumentTypes:@[@"public.text"] inMode:UIDocumentPickerModeImport];
|
||||||
documentPicker.allowsMultipleSelection = NO;
|
documentPicker.allowsMultipleSelection = NO;
|
||||||
|
__weak typeof(self) weakSelf = self;
|
||||||
documentPicker.didPickDocumentHandler = ^(NSArray<NSURL *> * _Nonnull urls) {
|
documentPicker.didPickDocumentHandler = ^(NSArray<NSURL *> * _Nonnull urls) {
|
||||||
if (urls.count > 0) {
|
__strong typeof(weakSelf) strongSelf = weakSelf;
|
||||||
|
if (strongSelf && urls.count > 0) {
|
||||||
NSURL *url = urls.firstObject;
|
NSURL *url = urls.firstObject;
|
||||||
NSError *error = nil;
|
NSError *error = nil;
|
||||||
NSString *settingsString = [NSString stringWithContentsOfURL:url encoding:NSUTF8StringEncoding error:&error];
|
NSString *settingsString = [NSString stringWithContentsOfURL:url encoding:NSUTF8StringEncoding error:&error];
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue