Skip to content
This repository was archived by the owner on Feb 2, 2023. It is now read-only.

Commit cc4f604

Browse files
[tvOS] Initial commit to make build run.
1 parent 516e1f1 commit cc4f604

13 files changed

Lines changed: 48 additions & 23 deletions

AsyncDisplayKit.podspec

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,5 @@ Pod::Spec.new do |spec|
4747
}
4848

4949
spec.ios.deployment_target = '7.0'
50+
spec.tvos.deployment_target = '9.0'
5051
end

AsyncDisplayKit/ASDisplayNode.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -641,7 +641,9 @@ NS_ASSUME_NONNULL_END
641641
@property (atomic, assign) UIViewContentMode contentMode; // default=UIViewContentModeScaleToFill
642642

643643
@property (atomic, assign, getter=isUserInteractionEnabled) BOOL userInteractionEnabled; // default=YES (NO for layer-backed nodes)
644+
#if TARGET_OS_IOS
644645
@property (atomic, assign, getter=isExclusiveTouch) BOOL exclusiveTouch; // default=NO
646+
#endif
645647
@property (atomic, assign, nullable) CGColorRef shadowColor; // default=opaque rgb black
646648
@property (atomic, assign) CGFloat shadowOpacity; // default=0.0
647649
@property (atomic, assign) CGSize shadowOffset; // default=(0, -3)

AsyncDisplayKit/ASEditableTextNode.mm

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,9 @@ - (void)didLoad
137137
_textKitComponents.textView = self.textView;
138138
//_textKitComponents.textView = NO; // Unfortunately there's a bug here with iOS 7 DP5 that causes the text-view to only be one line high when scrollEnabled is NO. rdar://14729288
139139
_textKitComponents.textView.delegate = self;
140+
#if TARGET_OS_IOS
140141
_textKitComponents.textView.editable = YES;
142+
#endif
141143
_textKitComponents.textView.typingAttributes = _typingAttributes;
142144
_textKitComponents.textView.returnKeyType = _returnKeyType;
143145
_textKitComponents.textView.accessibilityHint = _placeholderTextKitComponents.textStorage.string;

AsyncDisplayKit/ASMapNode.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
*/
88

99
#import <AsyncDisplayKit/ASImageNode.h>
10+
#if TARGET_OS_IOS
1011
#import <MapKit/MapKit.h>
1112

1213
NS_ASSUME_NONNULL_BEGIN
@@ -48,3 +49,5 @@ NS_ASSUME_NONNULL_BEGIN
4849
@end
4950

5051
NS_ASSUME_NONNULL_END
52+
53+
#endif

AsyncDisplayKit/ASMapNode.mm

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
* of patent rights can be found in the PATENTS file in the same directory.
77
*/
88

9+
#if TARGET_OS_IOS
910
#import "ASMapNode.h"
1011
#import <AsyncDisplayKit/ASDisplayNode+Subclasses.h>
1112
#import <AsyncDisplayKit/ASDisplayNodeExtras.h>
@@ -246,4 +247,5 @@ - (void)layout
246247
}
247248
}
248249
}
249-
@end
250+
@end
251+
#endif

AsyncDisplayKit/ASMultiplexImageNode.h

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88

99
#import <AsyncDisplayKit/ASImageNode.h>
1010
#import <AsyncDisplayKit/ASImageProtocols.h>
11-
11+
#if TARGET_OS_IOS
1212
#import <Photos/Photos.h>
13-
13+
#endif
1414
NS_ASSUME_NONNULL_BEGIN
1515

1616
@protocol ASMultiplexImageNodeDelegate;
@@ -116,13 +116,14 @@ typedef NS_ENUM(NSUInteger, ASMultiplexImageNodeErrorCode) {
116116
*/
117117
@property (nullable, nonatomic, readonly) ASImageIdentifier displayedImageIdentifier;
118118

119+
#if TARGET_OS_IOS
119120
/**
120121
* @abstract The image manager that this image node should use when requesting images from the Photos framework. If this is `nil` (the default), then `PHImageManager.defaultManager` is used.
121122
122123
* @see `+[NSURL URLWithAssetLocalIdentifier:targetSize:contentMode:options:]` below.
123124
*/
124125
@property (nonatomic, strong) PHImageManager *imageManager;
125-
126+
#endif
126127
@end
127128

128129

@@ -229,6 +230,7 @@ didFinishDownloadingImageWithIdentifier:(ASImageIdentifier)imageIdentifier
229230
*/
230231
- (nullable NSURL *)multiplexImageNode:(ASMultiplexImageNode *)imageNode URLForImageIdentifier:(ASImageIdentifier)imageIdentifier;
231232

233+
#if TARGET_OS_IOS
232234
/**
233235
* @abstract A PHAsset for the specific asset local identifier
234236
* @param imageNode The sender.
@@ -240,11 +242,11 @@ didFinishDownloadingImageWithIdentifier:(ASImageIdentifier)imageIdentifier
240242
* @return A PHAsset corresponding to `assetLocalIdentifier`, or nil if none is available.
241243
*/
242244
- (nullable PHAsset *)multiplexImageNode:(ASMultiplexImageNode *)imageNode assetForLocalIdentifier:(NSString *)assetLocalIdentifier;
243-
245+
#endif
244246
@end
245247

246248
#pragma mark -
247-
249+
#if TARGET_OS_IOS
248250
@interface NSURL (ASPhotosFrameworkURLs)
249251

250252
/**
@@ -261,5 +263,6 @@ didFinishDownloadingImageWithIdentifier:(ASImageIdentifier)imageIdentifier
261263
options:(PHImageRequestOptions *)options;
262264

263265
@end
266+
#endif
264267

265268
NS_ASSUME_NONNULL_END

AsyncDisplayKit/ASMultiplexImageNode.mm

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@
77
*/
88

99
#import "ASMultiplexImageNode.h"
10-
10+
#if TARGET_OS_IOS
1111
#import <AssetsLibrary/AssetsLibrary.h>
1212

1313
#import <Photos/Photos.h>
14-
14+
#endif
1515
#import <libkern/OSAtomic.h>
1616

1717
#import "ASAvailability.h"
@@ -112,6 +112,7 @@ - (void)_loadNextImage;
112112
*/
113113
- (void)_fetchImageWithIdentifierFromCache:(id)imageIdentifier URL:(NSURL *)imageURL completion:(void (^)(UIImage *image))completionBlock;
114114

115+
#if TARGET_OS_IOS
115116
/**
116117
@abstract Loads the image corresponding to the given assetURL from the device's Assets Library.
117118
@param imageIdentifier The identifier for the image to be loaded. May not be nil.
@@ -131,7 +132,7 @@ - (void)_loadALAssetWithIdentifier:(id)imageIdentifier URL:(NSURL *)assetURL com
131132
@param error An error describing why the load failed, if it failed; nil otherwise.
132133
*/
133134
- (void)_loadPHAssetWithRequest:(ASPhotosFrameworkImageRequest *)request identifier:(id)imageIdentifier completion:(void (^)(UIImage *image, NSError *error))completionBlock;
134-
135+
#endif
135136
/**
136137
@abstract Downloads the image corresponding to the given imageIdentifier from the given URL.
137138
@param imageIdentifier The identifier for the image to be downloaded. May not be nil.
@@ -262,7 +263,9 @@ - (void)setDataSource:(id <ASMultiplexImageNodeDataSource>)dataSource
262263
_dataSource = dataSource;
263264
_dataSourceFlags.image = [_dataSource respondsToSelector:@selector(multiplexImageNode:imageForImageIdentifier:)];
264265
_dataSourceFlags.URL = [_dataSource respondsToSelector:@selector(multiplexImageNode:URLForImageIdentifier:)];
266+
#if TARGET_OS_IOS
265267
_dataSourceFlags.asset = [_dataSource respondsToSelector:@selector(multiplexImageNode:assetForLocalIdentifier:)];
268+
#endif
266269
}
267270

268271
#pragma mark -
@@ -455,6 +458,7 @@ - (void)_loadNextImage
455458
return;
456459
}
457460

461+
#if TARGET_OS_IOS
458462
// If it's an assets-library URL, we need to fetch it from the assets library.
459463
if ([[nextImageURL scheme] isEqualToString:kAssetsLibraryURLScheme]) {
460464
// Load the asset.
@@ -470,6 +474,7 @@ - (void)_loadNextImage
470474
finishedLoadingBlock(image, nextImageIdentifier, error);
471475
}];
472476
}
477+
#endif
473478
else // Otherwise, it's a web URL that we can download.
474479
{
475480
// First, check the cache.
@@ -499,7 +504,7 @@ - (void)_loadNextImage
499504
}];
500505
}
501506
}
502-
507+
#if TARGET_OS_IOS
503508
- (void)_loadALAssetWithIdentifier:(id)imageIdentifier URL:(NSURL *)assetURL completion:(void (^)(UIImage *image, NSError *error))completionBlock
504509
{
505510
ASDisplayNodeAssertNotNil(imageIdentifier, @"imageIdentifier is required");
@@ -609,7 +614,7 @@ - (void)_loadPHAssetWithRequest:(ASPhotosFrameworkImageRequest *)request identif
609614
_phImageRequestOperation = newImageRequestOp;
610615
[phImageRequestQueue addOperation:newImageRequestOp];
611616
}
612-
617+
#endif
613618
- (void)_fetchImageWithIdentifierFromCache:(id)imageIdentifier URL:(NSURL *)imageURL completion:(void (^)(UIImage *image))completionBlock
614619
{
615620
ASDisplayNodeAssertNotNil(imageIdentifier, @"imageIdentifier is required");
@@ -708,7 +713,7 @@ - (BOOL)_shouldClearFetchedImageData {
708713
}
709714

710715
@end
711-
716+
#if TARGET_OS_IOS
712717
@implementation NSURL (ASPhotosFrameworkURLs)
713718

714719
+ (NSURL *)URLWithAssetLocalIdentifier:(NSString *)assetLocalIdentifier targetSize:(CGSize)targetSize contentMode:(PHImageContentMode)contentMode options:(PHImageRequestOptions *)options
@@ -720,4 +725,5 @@ + (NSURL *)URLWithAssetLocalIdentifier:(NSString *)assetLocalIdentifier targetSi
720725
return request.url;
721726
}
722727

723-
@end
728+
@end
729+
#endif

AsyncDisplayKit/ASPagerNode.m

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,13 @@ - (void)didLoad
4848
[super didLoad];
4949

5050
ASCollectionView *cv = self.view;
51-
51+
#if TARGET_OS_IOS
5252
cv.pagingEnabled = YES;
53+
cv.scrollsToTop = NO;
54+
#endif
5355
cv.allowsSelection = NO;
5456
cv.showsVerticalScrollIndicator = NO;
5557
cv.showsHorizontalScrollIndicator = NO;
56-
cv.scrollsToTop = NO;
5758

5859
// Zeroing contentInset is important, as UIKit will set the top inset for the navigation bar even though
5960
// our view is only horizontally scrollable. This causes UICollectionViewFlowLayout to log a warning.

AsyncDisplayKit/ASTableViewProtocols.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,9 @@ NS_ASSUME_NONNULL_BEGIN
7373

7474
- (UITableViewCellEditingStyle)tableView:(UITableView *)tableView editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath;
7575
- (nullable NSString *)tableView:(UITableView *)tableView titleForDeleteConfirmationButtonForRowAtIndexPath:(NSIndexPath *)indexPath;
76+
#if TARGET_OS_IOS
7677
- (nullable NSArray<UITableViewRowAction *> *)tableView:(UITableView *)tableView editActionsForRowAtIndexPath:(NSIndexPath *)indexPath;
77-
78+
#endif
7879
- (BOOL)tableView:(UITableView *)tableView shouldIndentWhileEditingRowAtIndexPath:(NSIndexPath *)indexPath;
7980

8081
- (void)tableView:(UITableView*)tableView willBeginEditingRowAtIndexPath:(NSIndexPath *)indexPath;

AsyncDisplayKit/Details/ASPhotosFrameworkImageRequest.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
// Created by Adlai Holler on 9/25/15.
66
// Copyright © 2015 Facebook. All rights reserved.
77
//
8-
8+
#if TARGET_OS_IOS
99
#import <Foundation/Foundation.h>
1010
#import <Photos/Photos.h>
1111

@@ -64,3 +64,4 @@ extern NSString *const ASPhotosURLScheme;
6464
@end
6565

6666
// NS_ASSUME_NONNULL_END
67+
#endif

0 commit comments

Comments
 (0)