Skip to content

Commit d0837e6

Browse files
committed
v1.4.0(47)
fix for maccatalyst reject Fix #17 add auto selection for cast converter
1 parent 96feff7 commit d0837e6

File tree

15 files changed

+381
-54
lines changed

15 files changed

+381
-54
lines changed

RemoteCloud/RemoteCloud/Storages/CryptRclone.swift

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,18 @@ class ViewControllerPasswordRclone: UIViewController, UITextFieldDelegate, UIDoc
368368
0xd3, 0x90, 0x19, 0x8e, 0xb8, 0x12, 0x8a, 0xfb,
369369
0xf4, 0xde, 0x16, 0x2b, 0x8b, 0x95, 0xf6, 0x38,]
370370
var ciphertext_stdbase64 = ciphertext.replacingOccurrences(of: "-", with: "+").replacingOccurrences(of: "_", with: "/")
371-
ciphertext_stdbase64.append(contentsOf: String(repeating: "=", count: 4 - ciphertext_stdbase64.count % 4))
371+
switch ciphertext_stdbase64.count % 4 {
372+
case 0:
373+
break
374+
case 1:
375+
return nil
376+
case 2:
377+
ciphertext_stdbase64.append(contentsOf: String(repeating: "=", count: 2))
378+
case 3:
379+
ciphertext_stdbase64.append(contentsOf: String(repeating: "=", count: 1))
380+
default:
381+
break
382+
}
372383
//print(ciphertext_stdbase64)
373384
guard let cipher = Data(base64Encoded: ciphertext_stdbase64) else {
374385
return nil
@@ -689,18 +700,14 @@ public class CryptRclone: ChildStorage {
689700
{
690701
case 1:
691702
c = 4
692-
break
693703
case 3:
694704
c = 3
695-
break
696705
case 4:
697706
c = 2
698-
break
699707
case 6:
700708
c = 1
701-
break
702709
default:
703-
break;
710+
break
704711
}
705712
}
706713

RemoteCloud/RemoteCloud/Storages/LocalStorage.swift

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,15 @@ public class LocalStorage: RemoteStorageBase {
417417
}
418418

419419
do {
420+
let attr = try FileManager.default.attributesOfItem(atPath: target.path)
421+
let fileSize = attr[.size] as! UInt64
422+
423+
UploadManeger.shared.UploadFixSize(identifier: sessionId, size: Int(fileSize))
424+
420425
try FileManager.default.moveItem(at: target, to: newURL)
426+
427+
UploadManeger.shared.UploadProgress(identifier: sessionId, possition: Int(fileSize))
428+
421429
let group2 = DispatchGroup()
422430
group1.notify(queue: .global()) {
423431
self.storeItem(item: newURL, parentFileId: parentId, parentPath: parentPath, group: group2)

ccViewer.xcworkspace/contents.xcworkspacedata

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ccViewer/ccViewer.xcodeproj/project.pbxproj renamed to ccViewer/CryptCloudViewer.xcodeproj/project.pbxproj

Lines changed: 38 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@
6565
3F48A079237AFDFF008B6690 /* GoogleCast.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 3F48A076237AFD99008B6690 /* GoogleCast.framework */; platformFilter = ios; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
6666
3F92E7032336B1F700D1FF9B /* Media.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 3F92E7022336B1F700D1FF9B /* Media.xcassets */; };
6767
3FA954D62322EC22005B086A /* ViewControllerConvert.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3FA954D52322EC22005B086A /* ViewControllerConvert.swift */; };
68+
3FC2F2392381355800EB747C /* ccViewer.help in Resources */ = {isa = PBXBuildFile; fileRef = 3FC2F2382381355800EB747C /* ccViewer.help */; };
6869
/* End PBXBuildFile section */
6970

7071
/* Begin PBXContainerItemProxy section */
@@ -131,15 +132,15 @@
131132
3CEF9AC8223EE865008F90B5 /* ViewControllerPDF.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewControllerPDF.swift; sourceTree = "<group>"; };
132133
3CF15E7822370B9300328A90 /* ViewControllerText.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewControllerText.swift; sourceTree = "<group>"; };
133134
3CF89CEF22333C14002FF0B5 /* TableViewControllerSetting.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TableViewControllerSetting.swift; sourceTree = "<group>"; };
134-
3CFCF695222F347A00843054 /* ccViewer.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ccViewer.app; sourceTree = BUILT_PRODUCTS_DIR; };
135+
3CFCF695222F347A00843054 /* CryptCloudViewer.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = CryptCloudViewer.app; sourceTree = BUILT_PRODUCTS_DIR; };
135136
3CFCF698222F347A00843054 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
136137
3CFCF69D222F347A00843054 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
137138
3CFCF6A2222F347B00843054 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
138139
3CFCF6A5222F347B00843054 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
139-
3CFCF6AC222F347B00843054 /* ccViewerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ccViewerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
140+
3CFCF6AC222F347B00843054 /* CryptCloudViewerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = CryptCloudViewerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
140141
3CFCF6B0222F347B00843054 /* ccViewerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ccViewerTests.swift; sourceTree = "<group>"; };
141142
3CFCF6B2222F347B00843054 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
142-
3CFCF6B7222F347B00843054 /* ccViewerUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ccViewerUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
143+
3CFCF6B7222F347B00843054 /* CryptCloudViewerUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = CryptCloudViewerUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
143144
3CFCF6BB222F347B00843054 /* ccViewerUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ccViewerUITests.swift; sourceTree = "<group>"; };
144145
3CFCF6BD222F347B00843054 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
145146
3CFCF6C9222F351900843054 /* TableViewControllerRoot.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TableViewControllerRoot.swift; sourceTree = "<group>"; };
@@ -183,6 +184,7 @@
183184
3F9151D5236C191600E5EF65 /* GoogleCast.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = GoogleCast.framework; path = "../GoogleCastSDK-ios-4.4.5_dynamic/GoogleCast.framework"; sourceTree = "<group>"; };
184185
3F92E7022336B1F700D1FF9B /* Media.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Media.xcassets; sourceTree = "<group>"; };
185186
3FA954D52322EC22005B086A /* ViewControllerConvert.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewControllerConvert.swift; sourceTree = "<group>"; };
187+
3FC2F2382381355800EB747C /* ccViewer.help */ = {isa = PBXFileReference; lastKnownFileType = folder; path = ccViewer.help; sourceTree = "<group>"; };
186188
/* End PBXFileReference section */
187189

188190
/* Begin PBXFrameworksBuildPhase section */
@@ -281,16 +283,17 @@
281283
3CFCF696222F347A00843054 /* Products */ = {
282284
isa = PBXGroup;
283285
children = (
284-
3CFCF695222F347A00843054 /* ccViewer.app */,
285-
3CFCF6AC222F347B00843054 /* ccViewerTests.xctest */,
286-
3CFCF6B7222F347B00843054 /* ccViewerUITests.xctest */,
286+
3CFCF695222F347A00843054 /* CryptCloudViewer.app */,
287+
3CFCF6AC222F347B00843054 /* CryptCloudViewerTests.xctest */,
288+
3CFCF6B7222F347B00843054 /* CryptCloudViewerUITests.xctest */,
287289
);
288290
name = Products;
289291
sourceTree = "<group>";
290292
};
291293
3CFCF697222F347A00843054 /* ccViewer */ = {
292294
isa = PBXGroup;
293295
children = (
296+
3FC2F2382381355800EB747C /* ccViewer.help */,
294297
3CFCF698222F347A00843054 /* AppDelegate.swift */,
295298
3CFCF6A2222F347B00843054 /* Assets.xcassets */,
296299
3CA2C96122355E9B00481DB5 /* ccViewer.entitlements */,
@@ -384,9 +387,9 @@
384387
/* End PBXGroup section */
385388

386389
/* Begin PBXNativeTarget section */
387-
3CFCF694222F347A00843054 /* ccViewer */ = {
390+
3CFCF694222F347A00843054 /* CryptCloudViewer */ = {
388391
isa = PBXNativeTarget;
389-
buildConfigurationList = 3CFCF6C0222F347B00843054 /* Build configuration list for PBXNativeTarget "ccViewer" */;
392+
buildConfigurationList = 3CFCF6C0222F347B00843054 /* Build configuration list for PBXNativeTarget "CryptCloudViewer" */;
390393
buildPhases = (
391394
3CFCF691222F347A00843054 /* Sources */,
392395
3CFCF692222F347A00843054 /* Frameworks */,
@@ -399,14 +402,14 @@
399402
);
400403
dependencies = (
401404
);
402-
name = ccViewer;
405+
name = CryptCloudViewer;
403406
productName = ccViewer;
404-
productReference = 3CFCF695222F347A00843054 /* ccViewer.app */;
407+
productReference = 3CFCF695222F347A00843054 /* CryptCloudViewer.app */;
405408
productType = "com.apple.product-type.application";
406409
};
407-
3CFCF6AB222F347B00843054 /* ccViewerTests */ = {
410+
3CFCF6AB222F347B00843054 /* CryptCloudViewerTests */ = {
408411
isa = PBXNativeTarget;
409-
buildConfigurationList = 3CFCF6C3222F347B00843054 /* Build configuration list for PBXNativeTarget "ccViewerTests" */;
412+
buildConfigurationList = 3CFCF6C3222F347B00843054 /* Build configuration list for PBXNativeTarget "CryptCloudViewerTests" */;
410413
buildPhases = (
411414
3CFCF6A8222F347B00843054 /* Sources */,
412415
3CFCF6A9222F347B00843054 /* Frameworks */,
@@ -417,14 +420,14 @@
417420
dependencies = (
418421
3CFCF6AE222F347B00843054 /* PBXTargetDependency */,
419422
);
420-
name = ccViewerTests;
423+
name = CryptCloudViewerTests;
421424
productName = ccViewerTests;
422-
productReference = 3CFCF6AC222F347B00843054 /* ccViewerTests.xctest */;
425+
productReference = 3CFCF6AC222F347B00843054 /* CryptCloudViewerTests.xctest */;
423426
productType = "com.apple.product-type.bundle.unit-test";
424427
};
425-
3CFCF6B6222F347B00843054 /* ccViewerUITests */ = {
428+
3CFCF6B6222F347B00843054 /* CryptCloudViewerUITests */ = {
426429
isa = PBXNativeTarget;
427-
buildConfigurationList = 3CFCF6C6222F347B00843054 /* Build configuration list for PBXNativeTarget "ccViewerUITests" */;
430+
buildConfigurationList = 3CFCF6C6222F347B00843054 /* Build configuration list for PBXNativeTarget "CryptCloudViewerUITests" */;
428431
buildPhases = (
429432
3CFCF6B3222F347B00843054 /* Sources */,
430433
3CFCF6B4222F347B00843054 /* Frameworks */,
@@ -435,9 +438,9 @@
435438
dependencies = (
436439
3CFCF6B9222F347B00843054 /* PBXTargetDependency */,
437440
);
438-
name = ccViewerUITests;
441+
name = CryptCloudViewerUITests;
439442
productName = ccViewerUITests;
440-
productReference = 3CFCF6B7222F347B00843054 /* ccViewerUITests.xctest */;
443+
productReference = 3CFCF6B7222F347B00843054 /* CryptCloudViewerUITests.xctest */;
441444
productType = "com.apple.product-type.bundle.ui-testing";
442445
};
443446
/* End PBXNativeTarget section */
@@ -495,7 +498,7 @@
495498
};
496499
};
497500
};
498-
buildConfigurationList = 3CFCF690222F347900843054 /* Build configuration list for PBXProject "ccViewer" */;
501+
buildConfigurationList = 3CFCF690222F347900843054 /* Build configuration list for PBXProject "CryptCloudViewer" */;
499502
compatibilityVersion = "Xcode 9.3";
500503
developmentRegion = en;
501504
hasScannedForEncodings = 0;
@@ -509,9 +512,9 @@
509512
projectDirPath = "";
510513
projectRoot = "";
511514
targets = (
512-
3CFCF694222F347A00843054 /* ccViewer */,
513-
3CFCF6AB222F347B00843054 /* ccViewerTests */,
514-
3CFCF6B6222F347B00843054 /* ccViewerUITests */,
515+
3CFCF694222F347A00843054 /* CryptCloudViewer */,
516+
3CFCF6AB222F347B00843054 /* CryptCloudViewerTests */,
517+
3CFCF6B6222F347B00843054 /* CryptCloudViewerUITests */,
515518
);
516519
};
517520
/* End PBXProject section */
@@ -525,6 +528,7 @@
525528
3C4009192240653C0028A45A /* Localizable.strings in Resources */,
526529
3F92E7032336B1F700D1FF9B /* Media.xcassets in Resources */,
527530
3CFCF6A3222F347B00843054 /* Assets.xcassets in Resources */,
531+
3FC2F2392381355800EB747C /* ccViewer.help in Resources */,
528532
3CFCF69E222F347A00843054 /* Main.storyboard in Resources */,
529533
3CC4851D2258945B0003C44A /* Settings.bundle in Resources */,
530534
3C0693432253D1EC0040DC0B /* InfoPlist.strings in Resources */,
@@ -635,12 +639,12 @@
635639
/* Begin PBXTargetDependency section */
636640
3CFCF6AE222F347B00843054 /* PBXTargetDependency */ = {
637641
isa = PBXTargetDependency;
638-
target = 3CFCF694222F347A00843054 /* ccViewer */;
642+
target = 3CFCF694222F347A00843054 /* CryptCloudViewer */;
639643
targetProxy = 3CFCF6AD222F347B00843054 /* PBXContainerItemProxy */;
640644
};
641645
3CFCF6B9222F347B00843054 /* PBXTargetDependency */ = {
642646
isa = PBXTargetDependency;
643-
target = 3CFCF694222F347A00843054 /* ccViewer */;
647+
target = 3CFCF694222F347A00843054 /* CryptCloudViewer */;
644648
targetProxy = 3CFCF6B8222F347B00843054 /* PBXContainerItemProxy */;
645649
};
646650
/* End PBXTargetDependency section */
@@ -809,9 +813,10 @@
809813
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
810814
CODE_SIGN_ENTITLEMENTS = ccViewer/ccViewer.entitlements;
811815
CODE_SIGN_STYLE = Automatic;
812-
CURRENT_PROJECT_VERSION = 45;
816+
CURRENT_PROJECT_VERSION = 47;
813817
DERIVE_MACCATALYST_PRODUCT_BUNDLE_IDENTIFIER = YES;
814818
DEVELOPMENT_TEAM = 7A9X38B4YU;
819+
"ENABLE_HARDENED_RUNTIME[sdk=macosx*]" = YES;
815820
FRAMEWORK_SEARCH_PATHS = (
816821
"$(inherited)",
817822
"$(PROJECT_DIR)",
@@ -842,9 +847,10 @@
842847
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
843848
CODE_SIGN_ENTITLEMENTS = ccViewer/ccViewer.entitlements;
844849
CODE_SIGN_STYLE = Automatic;
845-
CURRENT_PROJECT_VERSION = 45;
850+
CURRENT_PROJECT_VERSION = 47;
846851
DERIVE_MACCATALYST_PRODUCT_BUNDLE_IDENTIFIER = YES;
847852
DEVELOPMENT_TEAM = 7A9X38B4YU;
853+
"ENABLE_HARDENED_RUNTIME[sdk=macosx*]" = YES;
848854
FRAMEWORK_SEARCH_PATHS = (
849855
"$(inherited)",
850856
"$(PROJECT_DIR)",
@@ -886,7 +892,7 @@
886892
PRODUCT_NAME = "$(TARGET_NAME)";
887893
SWIFT_VERSION = 5.0;
888894
TARGETED_DEVICE_FAMILY = "1,2";
889-
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/ccViewer.app/ccViewer";
895+
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/CryptCloudViewer.app/CryptCloudViewer";
890896
};
891897
name = Debug;
892898
};
@@ -907,7 +913,7 @@
907913
PRODUCT_NAME = "$(TARGET_NAME)";
908914
SWIFT_VERSION = 5.0;
909915
TARGETED_DEVICE_FAMILY = "1,2";
910-
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/ccViewer.app/ccViewer";
916+
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/CryptCloudViewer.app/CryptCloudViewer";
911917
};
912918
name = Release;
913919
};
@@ -954,7 +960,7 @@
954960
/* End XCBuildConfiguration section */
955961

956962
/* Begin XCConfigurationList section */
957-
3CFCF690222F347900843054 /* Build configuration list for PBXProject "ccViewer" */ = {
963+
3CFCF690222F347900843054 /* Build configuration list for PBXProject "CryptCloudViewer" */ = {
958964
isa = XCConfigurationList;
959965
buildConfigurations = (
960966
3CFCF6BE222F347B00843054 /* Debug */,
@@ -963,7 +969,7 @@
963969
defaultConfigurationIsVisible = 0;
964970
defaultConfigurationName = Release;
965971
};
966-
3CFCF6C0222F347B00843054 /* Build configuration list for PBXNativeTarget "ccViewer" */ = {
972+
3CFCF6C0222F347B00843054 /* Build configuration list for PBXNativeTarget "CryptCloudViewer" */ = {
967973
isa = XCConfigurationList;
968974
buildConfigurations = (
969975
3CFCF6C1222F347B00843054 /* Debug */,
@@ -972,7 +978,7 @@
972978
defaultConfigurationIsVisible = 0;
973979
defaultConfigurationName = Release;
974980
};
975-
3CFCF6C3222F347B00843054 /* Build configuration list for PBXNativeTarget "ccViewerTests" */ = {
981+
3CFCF6C3222F347B00843054 /* Build configuration list for PBXNativeTarget "CryptCloudViewerTests" */ = {
976982
isa = XCConfigurationList;
977983
buildConfigurations = (
978984
3CFCF6C4222F347B00843054 /* Debug */,
@@ -981,7 +987,7 @@
981987
defaultConfigurationIsVisible = 0;
982988
defaultConfigurationName = Release;
983989
};
984-
3CFCF6C6222F347B00843054 /* Build configuration list for PBXNativeTarget "ccViewerUITests" */ = {
990+
3CFCF6C6222F347B00843054 /* Build configuration list for PBXNativeTarget "CryptCloudViewerUITests" */ = {
985991
isa = XCConfigurationList;
986992
buildConfigurations = (
987993
3CFCF6C7222F347B00843054 /* Debug */,

ccViewer/ccViewer/Info.plist

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@
88
<string></string>
99
<key>CFBundleExecutable</key>
1010
<string>$(EXECUTABLE_NAME)</string>
11+
<key>CFBundleHelpBookFolder</key>
12+
<string>ccViewer.help</string>
13+
<key>CFBundleHelpBookName</key>
14+
<string>maccatalyst.info.lithium03.ccViewer.help</string>
1115
<key>CFBundleIdentifier</key>
1216
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
1317
<key>CFBundleInfoDictionaryVersion</key>

ccViewer/ccViewer/TableViewControllerItems.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -694,7 +694,9 @@ class TableViewControllerItems: UITableViewController, UISearchResultsUpdating,
694694

695695
})
696696
alert.addAction(cancelAction)
697+
#if !targetEnvironment(macCatalyst)
697698
alert.addAction(defaultAction)
699+
#endif
698700
alert.addAction(defaultAction2)
699701
alert.addAction(defaultAction4)
700702
alert.addAction(defaultAction5)

ccViewer/ccViewer/TableViewControllerSetting.swift

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,8 @@ class TableViewControllerSetting: UITableViewController, UITextFieldDelegate {
7676
NSLocalizedString("PlayList", comment: ""), //5
7777
NSLocalizedString("Partial Play", comment: ""), //6
7878
NSLocalizedString("Player control", comment: ""), //7
79-
NSLocalizedString("Help", comment: "") //8
79+
NSLocalizedString("Cast converter", comment: ""), //8
80+
NSLocalizedString("Help", comment: "") //9
8081
]
8182
let settings = [["Password"],
8283
[NSLocalizedString("Run one more", comment: "")],
@@ -95,6 +96,8 @@ class TableViewControllerSetting: UITableViewController, UITextFieldDelegate {
9596
NSLocalizedString("Stop after specified duration", comment: "")],
9697
[NSLocalizedString("Skip foward (sec)", comment: ""),
9798
NSLocalizedString("Skip backward (sec)", comment: "")],
99+
[NSLocalizedString("Ignore overlay subtiles", comment: ""),
100+
NSLocalizedString("Auto select streams", comment: "")],
98101
[NSLocalizedString("View online help", comment: ""),
99102
NSLocalizedString("View privacy policy", comment: ""),
100103
NSLocalizedString("Version", comment: "")]
@@ -251,6 +254,20 @@ class TableViewControllerSetting: UITableViewController, UITextFieldDelegate {
251254
break
252255
}
253256
case 8:
257+
let aSwitch = UISwitch()
258+
aSwitch.addTarget(self, action: #selector(switchChanged), for: .valueChanged)
259+
switch indexPath.row {
260+
case 0:
261+
aSwitch.isOn = UserDefaults.standard.bool(forKey: "noOverlaySubtitles")
262+
aSwitch.tag = 12
263+
case 1:
264+
aSwitch.isOn = UserDefaults.standard.bool(forKey: "autoSelectStreams")
265+
aSwitch.tag = 13
266+
default:
267+
break
268+
}
269+
cell.accessoryView = aSwitch
270+
case 9:
254271
switch indexPath.row {
255272
case 0...1:
256273
cell.accessoryType = .detailButton
@@ -301,6 +318,10 @@ class TableViewControllerSetting: UITableViewController, UITextFieldDelegate {
301318
present(v, animated: false) {
302319
v.dismiss(animated: false, completion: nil)
303320
}
321+
case 12:
322+
UserDefaults.standard.set(value, forKey: "noOverlaySubtitles")
323+
case 13:
324+
UserDefaults.standard.set(value, forKey: "autoSelectStreams")
304325
default:
305326
break
306327
}
@@ -322,7 +343,7 @@ class TableViewControllerSetting: UITableViewController, UITextFieldDelegate {
322343
default:
323344
break
324345
}
325-
case 8:
346+
case 9:
326347
switch indexPath.row {
327348
case 0:
328349
let url = URL(string: NSLocalizedString("Online help URL", comment: ""))!

0 commit comments

Comments
 (0)