Skip to content

Commit

Permalink
Merge pull request #38 from weiran/tvos14
Browse files Browse the repository at this point in the history
tvOS 14 support
  • Loading branch information
weiran authored Oct 23, 2020
2 parents 069639d + 6ed9039 commit b074945
Show file tree
Hide file tree
Showing 6 changed files with 56 additions and 49 deletions.
10 changes: 10 additions & 0 deletions App/Models/Video.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,16 @@ class Video: Object {
urlString = bookmark.url.absoluteString
}

convenience init(dummyData: Bool) {
self.init()

if dummyData {
id = 1
title = "Test Video"
urlString = "https://www.youtube.com/watch?v=W9-pVpAtvoM"
}
}

@objc dynamic var id: Int = 0
@objc dynamic var title: String = ""
@objc dynamic var date: Date = Date()
Expand Down
22 changes: 10 additions & 12 deletions App/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,14 @@ class ViewController: UIViewController {

@objc func performFetch() {
instapaperAPI?.storedAuth().then {
return self.fetchFolders()
}.done { [weak self] folders in
return self?.fetchVideos(folders)
}.done { [weak self] in
self?.setNeedsFocusUpdate()
self?.updateFocusIfNeeded()
}.catch { [weak self] _ in
self?.performSegue(withIdentifier: "ShowLoginSegue", sender: self)
self.fetchFolders()
}.then { folders in
self.fetchVideos(folders)
}.done { _ in
self.setNeedsFocusUpdate()
self.updateFocusIfNeeded()
}.catch { _ in
self.performSegue(withIdentifier: "ShowLoginSegue", sender: self)
}
}

Expand All @@ -69,10 +69,8 @@ class ViewController: UIViewController {
}

func fetchFolders() -> Promise<[Int]> {
if folder != .other {
return Promise<[Int]> { seal in
seal.fulfill([folder.rawValue])
}
guard folder == .other else {
return Promise.value([folder.rawValue])
}

return instapaperAPI!.fetchFolders()
Expand Down
28 changes: 14 additions & 14 deletions Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
PODS:
- Locksmith (4.0.0)
- Nuke (9.0.0)
- Nuke (9.1.1)
- PromiseKit/CorePromise (6.13.1)
- Realm (5.0.0):
- Realm/Headers (= 5.0.0)
- Realm/Headers (5.0.0)
- RealmSwift (5.0.0):
- Realm (= 5.0.0)
- Realm (5.2.0):
- Realm/Headers (= 5.2.0)
- Realm/Headers (5.2.0)
- RealmSwift (5.2.0):
- Realm (= 5.2.0)
- SwiftyUserDefaults (5.0.0)
- Swinject (2.7.1)
- SwinjectStoryboard (2.2.0):
- Swinject (~> 2.7.1)
- TVVLCKit (3.3.11)
- TVVLCKit (3.3.14)
- TVVLCPlayer (1.1.0):
- TVVLCKit
- XCDYouTubeKit (2.14.0)
- XCDYouTubeKit (2.14.1)
- YTVimeoExtractor (1.2.0)

DEPENDENCIES:
Expand Down Expand Up @@ -67,18 +67,18 @@ CHECKOUT OPTIONS:

SPEC CHECKSUMS:
Locksmith: e9bebbaaa4cee3c511bc358a44f843c3fe00e21f
Nuke: 4390bfb0fcde6aecf314f854439d03914ee7c604
Nuke: af4301b154d3afd8a3b045a5194a9a773a00b7a8
PromiseKit: 28fda91c973cc377875d8c0ea4f973013c05b6db
Realm: 76066d333de26f97e9caedaa85ee3ff4a62ca265
RealmSwift: c1bdff09b422569dc6881410d9ccf712bcdb79b0
Realm: f749c723e272f08fdf1939af5e61d2bd09b203e8
RealmSwift: bf0ab78b52c5bafba8b3ad73be8dfb4c1ea5cf01
SwiftyUserDefaults: 33fcb42bd1feb53a37d873feb62c82967db5f7f6
Swinject: ddf78b8486dd9b71a667b852cad919ab4484478e
SwinjectStoryboard: f0d5b1c16459949d6ff1cbb6610107946b18e1f8
TVVLCKit: 56f8ea4eaf17c2f46902590f758bf9083ac230c9
TVVLCKit: aa7c0f34d6ae19e33838c3dcad594578364fd513
TVVLCPlayer: 357ae9ec2c52ff6cdd41588fe3e58525640a41eb
XCDYouTubeKit: 04a2f89dca6c5c53d1786701a0e98dcb484be7a8
XCDYouTubeKit: 5d50bbacdd9fedf26fb578bab901d946ff3d064c
YTVimeoExtractor: f4ed90f43e08d33d56c1d1aff3f4f64663747966

PODFILE CHECKSUM: 6c830d36ed915cef7de598851abfc6d5a3a828dd

COCOAPODS: 1.9.1
COCOAPODS: 1.9.3
22 changes: 13 additions & 9 deletions WatchItLater.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0820;
LastUpgradeCheck = 1020;
LastUpgradeCheck = 1200;
ORGANIZATIONNAME = "Weiran Zhang";
TargetAttributes = {
24332BD31E108D1A00D5AA18 = {
Expand Down Expand Up @@ -472,6 +472,7 @@
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
Expand Down Expand Up @@ -530,6 +531,7 @@
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
Expand Down Expand Up @@ -565,25 +567,26 @@
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = "App/Supporting Files/WatchItLater.entitlements";
CODE_SIGN_IDENTITY = "Apple Development";
"CODE_SIGN_IDENTITY[sdk=appletvos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 38;
DEVELOPMENT_TEAM = "";
CURRENT_PROJECT_VERSION = 39;
DEVELOPMENT_TEAM = 2KB59GPA9B;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/**",
);
INFOPLIST_FILE = "App/Supporting Files/Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MARKETING_VERSION = 2.0.2;
MARKETING_VERSION = 2.0.3;
PRODUCT_BUNDLE_IDENTIFIER = co.weiran.WatchItLater;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE = "";
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_OBJC_BRIDGING_HEADER = "App/Supporting Files/WatchItLater-Bridging-Header.h";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 5.0;
TVOS_DEPLOYMENT_TARGET = 13.0;
TVOS_DEPLOYMENT_TARGET = 14.0;
};
name = Debug;
};
Expand All @@ -596,24 +599,25 @@
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = "App/Supporting Files/WatchItLater.entitlements";
CODE_SIGN_IDENTITY = "Apple Development";
"CODE_SIGN_IDENTITY[sdk=appletvos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 38;
DEVELOPMENT_TEAM = "";
CURRENT_PROJECT_VERSION = 39;
DEVELOPMENT_TEAM = 2KB59GPA9B;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/**",
);
INFOPLIST_FILE = "App/Supporting Files/Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MARKETING_VERSION = 2.0.2;
MARKETING_VERSION = 2.0.3;
PRODUCT_BUNDLE_IDENTIFIER = co.weiran.WatchItLater;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE = "";
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_OBJC_BRIDGING_HEADER = "App/Supporting Files/WatchItLater-Bridging-Header.h";
SWIFT_VERSION = 5.0;
TVOS_DEPLOYMENT_TARGET = 13.0;
TVOS_DEPLOYMENT_TARGET = 14.0;
};
name = Release;
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1020"
LastUpgradeVersion = "1200"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down Expand Up @@ -29,17 +29,6 @@
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "24332BD31E108D1A00D5AA18"
BuildableName = "WatchItLater.app"
BlueprintName = "WatchItLater"
ReferencedContainer = "container:WatchItLater.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
Expand All @@ -61,8 +50,6 @@
ReferencedContainer = "container:WatchItLater.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>PreviewsEnabled</key>
<false/>
</dict>
</plist>

0 comments on commit b074945

Please sign in to comment.