mirror of
https://github.com/YTLitePlus/YTLitePlus.git
synced 2026-05-06 15:49:27 +00:00
Update Settings.xm
This commit is contained in:
parent
1db5cdb939
commit
93f28eeb2b
1 changed files with 2 additions and 1 deletions
|
|
@ -688,7 +688,8 @@ static const NSInteger YTLiteSection = 789;
|
||||||
// Import mode: Handle the import of settings from a text file
|
// Import mode: Handle the import of settings from a text file
|
||||||
NSString *fileType = [pickedURL resourceValuesForKeys:@[NSURLTypeIdentifierKey] error:&error][NSURLTypeIdentifierKey];
|
NSString *fileType = [pickedURL resourceValuesForKeys:@[NSURLTypeIdentifierKey] error:&error][NSURLTypeIdentifierKey];
|
||||||
|
|
||||||
if (UTTypeConformsTo((__bridge CFStringRef)fileType, UTTypePlainText.identifier)) {
|
UTType *utType = [UTType typeWithIdentifier:fileType];
|
||||||
|
if ([utType conformsToType:UTTypePlainText]) {
|
||||||
NSString *fileContents = [NSString stringWithContentsOfURL:pickedURL encoding:NSUTF8StringEncoding error:nil];
|
NSString *fileContents = [NSString stringWithContentsOfURL:pickedURL encoding:NSUTF8StringEncoding error:nil];
|
||||||
NSArray *lines = [fileContents componentsSeparatedByString:@"\n"];
|
NSArray *lines = [fileContents componentsSeparatedByString:@"\n"];
|
||||||
for (NSString *line in lines) {
|
for (NSString *line in lines) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue