-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
128 changed files
with
9,925 additions
and
1,596 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
github "SRGSSR/srgidentity-ios" "1.0" | ||
github "SRGSSR/srgidentity-ios" "1.0.1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,4 @@ | ||
github "SRGSSR/srgletterbox-ios" "1.13" | ||
github "onmyway133/DeepDiff" "2.2.0" | ||
# Fork from AliSoftware/OHHTTPStubs to support Xcode 9.x and Swift 4. | ||
github "rckoenes/OHHTTPStubs" ~> 6.1.1 | ||
github "SRGSSR/srgletterbox-ios" "1.14" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
github "SRGSSR/srgcontentprotection-ios" "1.2" | ||
github "SRGSSR/srgcontentprotection-ios" "1.2.1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
github "SRGSSR/srgcontentprotection-fake-ios" "1.2" | ||
github "SRGSSR/srgcontentprotection-fake-ios" "1.2.1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,21 @@ | ||
github "Mantle/Mantle" "2.1.0" | ||
github "SRGSSR/FXReachability" "1.3.2_srg2" | ||
github "SRGSSR/MAKVONotificationCenter" "1.0_srg2" | ||
github "SRGSSR/ComScore-iOS-watchOS-tvOS" "5.8.4" | ||
github "SRGSSR/FXReachability" "1.3.2_srg3" | ||
github "SRGSSR/MAKVONotificationCenter" "1.0_srg3" | ||
github "SRGSSR/Masonry" "v1.1.0_srg1" | ||
github "SRGSSR/UICKeyChainStore" "v2.1.2_srg1" | ||
github "SRGSSR/YYWebImage" "1.0.5_srg1" | ||
github "SRGSSR/libextobjc" "0.6_srg1" | ||
github "SRGSSR/srganalytics-ios" "3.6.3" | ||
github "SRGSSR/srgappearance-ios" "1.1.9" | ||
github "SRGSSR/srgcontentprotection-ios" "1.2" | ||
github "SRGSSR/srgdataprovider-ios" "6.5" | ||
github "SRGSSR/srganalytics-ios" "3.7" | ||
github "SRGSSR/srgappearance-ios" "1.1.10" | ||
github "SRGSSR/srgcontentprotection-ios" "1.2.1" | ||
github "SRGSSR/srgdataprovider-ios" "6.5.1" | ||
github "SRGSSR/srgdiagnostics-ios" "1.0.1" | ||
github "SRGSSR/srgidentity-ios" "1.0" | ||
github "SRGSSR/srgletterbox-ios" "1.13" | ||
github "SRGSSR/srglogger-ios" "1.0.8" | ||
github "SRGSSR/srgmediaplayer-ios" "2.5.6" | ||
github "SRGSSR/srgnetwork-ios" "1.0" | ||
github "SRGSSR/tagcommander-ios" "4.1.5_4.1.3" | ||
github "SnapKit/Masonry" "v1.1.0" | ||
github "comScore/ComScore-iOS-SDK" "92f34897cd7659d56bb5a3e9e85b808cf3758bda" | ||
github "ibireme/YYWebImage" "1.0.5" | ||
github "kishikawakatsumi/UICKeyChainStore" "v2.1.2" | ||
github "SRGSSR/srgidentity-ios" "1.0.1" | ||
github "SRGSSR/srgletterbox-ios" "1.14" | ||
github "SRGSSR/srglogger-ios" "1.0.9" | ||
github "SRGSSR/srgmediaplayer-ios" "2.6" | ||
github "SRGSSR/srgnetwork-ios" "1.0.1" | ||
github "SRGSSR/tagcommander-ios" "4.3.1_4.3.1" | ||
github "onmyway133/DeepDiff" "2.2.0" | ||
github "rckoenes/OHHTTPStubs" "6.1.1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,21 @@ | ||
github "Mantle/Mantle" "2.1.0" | ||
github "SRGSSR/FXReachability" "1.3.2_srg2" | ||
github "SRGSSR/MAKVONotificationCenter" "1.0_srg2" | ||
github "SRGSSR/ComScore-iOS-watchOS-tvOS" "5.8.4" | ||
github "SRGSSR/FXReachability" "1.3.2_srg3" | ||
github "SRGSSR/MAKVONotificationCenter" "1.0_srg3" | ||
github "SRGSSR/Masonry" "v1.1.0_srg1" | ||
github "SRGSSR/UICKeyChainStore" "v2.1.2_srg1" | ||
github "SRGSSR/YYWebImage" "1.0.5_srg1" | ||
github "SRGSSR/libextobjc" "0.6_srg1" | ||
github "SRGSSR/srganalytics-ios" "3.6.3" | ||
github "SRGSSR/srgappearance-ios" "1.1.9" | ||
github "SRGSSR/srgcontentprotection-fake-ios" "1.2" | ||
github "SRGSSR/srgdataprovider-ios" "6.5" | ||
github "SRGSSR/srganalytics-ios" "3.7" | ||
github "SRGSSR/srgappearance-ios" "1.1.10" | ||
github "SRGSSR/srgcontentprotection-fake-ios" "1.2.1" | ||
github "SRGSSR/srgdataprovider-ios" "6.5.1" | ||
github "SRGSSR/srgdiagnostics-ios" "1.0.1" | ||
github "SRGSSR/srgidentity-ios" "1.0" | ||
github "SRGSSR/srgletterbox-ios" "1.13" | ||
github "SRGSSR/srglogger-ios" "1.0.8" | ||
github "SRGSSR/srgmediaplayer-ios" "2.5.6" | ||
github "SRGSSR/srgnetwork-ios" "1.0" | ||
github "SRGSSR/tagcommander-ios" "4.1.5_4.1.3" | ||
github "SnapKit/Masonry" "v1.1.0" | ||
github "comScore/ComScore-iOS-SDK" "92f34897cd7659d56bb5a3e9e85b808cf3758bda" | ||
github "ibireme/YYWebImage" "1.0.5" | ||
github "kishikawakatsumi/UICKeyChainStore" "v2.1.2" | ||
github "SRGSSR/srgidentity-ios" "1.0.1" | ||
github "SRGSSR/srgletterbox-ios" "1.14" | ||
github "SRGSSR/srglogger-ios" "1.0.9" | ||
github "SRGSSR/srgmediaplayer-ios" "2.6" | ||
github "SRGSSR/srgnetwork-ios" "1.0.1" | ||
github "SRGSSR/tagcommander-ios" "4.3.1_4.3.1" | ||
github "onmyway133/DeepDiff" "2.2.0" | ||
github "rckoenes/OHHTTPStubs" "6.1.1" |
15 changes: 15 additions & 0 deletions
15
Demo/Resources/Images.xcassets/playlist_22.imageset/Contents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"idiom" : "universal", | ||
"filename" : "playlist-22.pdf" | ||
} | ||
], | ||
"info" : { | ||
"version" : 1, | ||
"author" : "xcode" | ||
}, | ||
"properties" : { | ||
"template-rendering-intent" : "template" | ||
} | ||
} |
Binary file not shown.
15 changes: 15 additions & 0 deletions
15
Demo/Resources/Images.xcassets/playlists_30.imageset/Contents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"idiom" : "universal", | ||
"filename" : "playlists_30.pdf" | ||
} | ||
], | ||
"info" : { | ||
"version" : 1, | ||
"author" : "xcode" | ||
}, | ||
"properties" : { | ||
"template-rendering-intent" : "template" | ||
} | ||
} |
Binary file added
BIN
+5.69 KB
Demo/Resources/Images.xcassets/playlists_30.imageset/playlists_30.pdf
Binary file not shown.
15 changes: 15 additions & 0 deletions
15
Demo/Resources/Images.xcassets/playlists_48.imageset/Contents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"idiom" : "universal", | ||
"filename" : "playlists_48.pdf" | ||
} | ||
], | ||
"info" : { | ||
"version" : 1, | ||
"author" : "xcode" | ||
}, | ||
"properties" : { | ||
"template-rendering-intent" : "template" | ||
} | ||
} |
Binary file not shown.
15 changes: 15 additions & 0 deletions
15
Demo/Resources/Images.xcassets/preferences_30.imageset/Contents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"idiom" : "universal", | ||
"filename" : "settings_30.pdf" | ||
} | ||
], | ||
"info" : { | ||
"version" : 1, | ||
"author" : "xcode" | ||
}, | ||
"properties" : { | ||
"template-rendering-intent" : "template" | ||
} | ||
} |
Binary file added
BIN
+5.99 KB
Demo/Resources/Images.xcassets/preferences_30.imageset/settings_30.pdf
Binary file not shown.
15 changes: 15 additions & 0 deletions
15
Demo/Resources/Images.xcassets/watch_later_22.imageset/Contents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"idiom" : "universal", | ||
"filename" : "watch_later-22.pdf" | ||
} | ||
], | ||
"info" : { | ||
"version" : 1, | ||
"author" : "xcode" | ||
}, | ||
"properties" : { | ||
"template-rendering-intent" : "template" | ||
} | ||
} |
Binary file added
BIN
+5.52 KB
Demo/Resources/Images.xcassets/watch_later_22.imageset/watch_later-22.pdf
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// | ||
// Copyright (c) SRG SSR. All rights reserved. | ||
// | ||
// License information is available from the LICENSE file. | ||
// | ||
|
||
import DeepDiff | ||
import UIKit | ||
|
||
extension NSObject: DiffAware { | ||
public var diffId: Int { | ||
return self.hashValue | ||
} | ||
|
||
public static func compareContent(_ a: NSObject, _ b: NSObject) -> Bool { | ||
return a == b | ||
} | ||
} | ||
|
||
extension UITableView { | ||
@objc public func reloadDataAnimated(oldObjects: [NSObject], newObjects: [NSObject], section: Int = 0, updateData: () -> Void) { | ||
if !oldObjects.isEmpty && !newObjects.isEmpty && oldObjects != newObjects { | ||
let changes = diff(old: oldObjects, new: newObjects) | ||
self.reload(changes: changes, section: section, insertionAnimation: .automatic, deletionAnimation: .automatic, replacementAnimation: .automatic, updateData: updateData, completion: nil) | ||
} | ||
else { | ||
updateData() | ||
self.reloadData() | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
// | ||
// Use this file to import your target's public headers that you would like to expose to Swift. | ||
// | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// | ||
// Copyright (c) SRG SSR. All rights reserved. | ||
// | ||
// License information is available from the LICENSE file. | ||
// | ||
|
||
#import <UIKit/UIKit.h> | ||
|
||
NS_ASSUME_NONNULL_BEGIN | ||
|
||
@interface DataViewController : UIViewController <UITableViewDataSource, UITableViewDelegate> | ||
|
||
@property (nonatomic, weak, nullable) IBOutlet UITableView *tableView; | ||
|
||
@end | ||
|
||
@interface DataViewController (Subclassing) | ||
|
||
- (void)refresh; | ||
- (void)cancelRefresh; | ||
|
||
- (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView NS_REQUIRES_SUPER; | ||
|
||
@end | ||
|
||
NS_ASSUME_NONNULL_END |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
// | ||
// Copyright (c) SRG SSR. All rights reserved. | ||
// | ||
// License information is available from the LICENSE file. | ||
// | ||
|
||
#import "DataViewController.h" | ||
|
||
@interface DataViewController () | ||
|
||
@property (nonatomic, weak) UIRefreshControl *refreshControl; | ||
@property (nonatomic, getter=isRefreshTriggered) BOOL refreshTriggered; | ||
|
||
@end | ||
|
||
@implementation DataViewController | ||
|
||
#pragma mark View lifecycle | ||
|
||
- (void)viewDidLoad | ||
{ | ||
[super viewDidLoad]; | ||
|
||
self.tableView.dataSource = self; | ||
self.tableView.delegate = self; | ||
|
||
UIRefreshControl *refreshControl = [[UIRefreshControl alloc] init]; | ||
refreshControl.layer.zPosition = -1.f; // Ensure the refresh control appears behind the cells, see http://stackoverflow.com/a/25829016/760435 | ||
[refreshControl addTarget:self action:@selector(refresh:) forControlEvents:UIControlEventValueChanged]; | ||
[self.tableView insertSubview:refreshControl atIndex:0]; | ||
self.refreshControl = refreshControl; | ||
} | ||
|
||
- (void)viewWillAppear:(BOOL)animated | ||
{ | ||
[super viewWillAppear:animated]; | ||
|
||
[self refresh]; | ||
} | ||
|
||
- (void)viewWillDisappear:(BOOL)animated | ||
{ | ||
[super viewWillDisappear:animated]; | ||
|
||
if (self.movingFromParentViewController || self.beingDismissed) { | ||
[self cancelRefresh]; | ||
} | ||
} | ||
|
||
#pragma mark Default implementations | ||
|
||
- (void)refresh | ||
{} | ||
|
||
- (void)cancelRefresh | ||
{} | ||
|
||
#pragma mark UIScrollViewDelegate protocol | ||
|
||
- (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView | ||
{ | ||
if (self.refreshTriggered) { | ||
[self refresh]; | ||
self.refreshTriggered = NO; | ||
} | ||
} | ||
|
||
#pragma mark UITableViewDataSource protocol | ||
|
||
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section | ||
{ | ||
NSAssert(NO, @"Not implemented"); | ||
return 0; | ||
} | ||
|
||
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath | ||
{ | ||
NSAssert(NO, @"Not implemented"); | ||
return nil; | ||
} | ||
|
||
#pragma mark Actions | ||
|
||
- (void)refresh:(id)sender | ||
{ | ||
// When reloading a table view with animations and if a refresh control is used to trigger the reload, | ||
// a glitch makes the table jump down when the refresh control value changed event is triggered. To | ||
// solve this issue, we only mark the table as required a refresh when this event is triggered, and | ||
// perform the refresh when the table is released. | ||
// | ||
// Note that applying the same strategy with a UITableViewController does not work, we have to build | ||
// the table and the refresh control ourselves. | ||
if (self.refreshControl.refreshing) { | ||
[self.refreshControl endRefreshing]; | ||
} | ||
self.refreshTriggered = YES; | ||
} | ||
|
||
@end |
Oops, something went wrong.