Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[tvOS] Fixes errors when building against tvOS SDK #728

Merged
merged 31 commits into from
Mar 11, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
7e8c3e2
[tvOS] Fixes errors when building against tvOS SDK
alexhillc Dec 26, 2017
bd9fd57
Update CHANGELOG.md
alexhillc Dec 26, 2017
8663491
Merge branch 'master' of github.com:TextureGroup/Texture into tvos
alexhillc Dec 26, 2017
46f5412
[tvOS] Fixes implicit conversion between UIViewAnimationCurve +
alexhillc Dec 26, 2017
6b90382
Enable tvOS deployment target in Texture.podspec (for CI)
alexhillc Dec 27, 2017
b1b582a
[ASMultiplexImageNode] Fixes typo
alexhillc Dec 28, 2017
7759cf7
[tvOS] Fixes warnings related to @available guards in Xcode 9
alexhillc Dec 28, 2017
8dbcc51
[ASAvailability] Update AS_AVAILABLE_XXX fallbacks to function more like
alexhillc Dec 28, 2017
6607bda
[ASControlNode] Adds missing 'super' call in -[ASControlNode didLoad]
alexhillc Dec 28, 2017
14a8e91
Fix API_AVAILABLE iOS requirement
alexhillc Dec 29, 2017
bcdae3f
[ASDisplayNode] Fixes last of the linker warnings related to category
alexhillc Dec 30, 2017
9673a83
[NSParagraphStyle+ASText] Fixes typo related to testing
alexhillc Dec 30, 2017
bf9aa78
[ASControlNode] Re-add helpful comment
alexhillc Dec 30, 2017
8eb2dbe
[ASTextKitCoreTextAdditions] Adds mappings for kCTParagraphStyleSpeci…
alexhillc Jan 6, 2018
cb0e735
Merge remote-tracking branch 'upstream/master' into tvos
alexhillc Jan 13, 2018
3da014a
[AsyncDisplayKit] Update project file to include new/deleted files
alexhillc Jan 13, 2018
fdf22d6
[ASControlNode+tvOS] Add missing Foundation import (whoops!)
alexhillc Jan 13, 2018
2d6d0a7
Update podspec to only link AssetsLibrary framework on iOS
alexhillc Jan 13, 2018
c7462f6
[ASTextKitCoreTextAdditions] If kCTParagraphStyleAttributeName key-value
alexhillc Jan 16, 2018
12a06b3
Merge remote-tracking branch 'upstream/master' into tvos
alexhillc Jan 16, 2018
91dcb20
[ASMultiplexImageNode] Bump availability check to support < Xcode 9
alexhillc Jan 16, 2018
ef16069
Merge branch 'master' into tvos
alexhillc Jan 16, 2018
305b443
[ASTraitCollection] Fixes typo that was causing build to fail
alexhillc Jan 16, 2018
2ec4233
Merge remote-tracking branch 'upstream/master' into tvos
alexhillc Jan 21, 2018
fd246ad
Merge branch 'master' into tvos
appleguy Feb 9, 2018
1f76d48
Merge branch 'tvos' of github.com:alexhillc/Texture into tvos
alexhillc Feb 9, 2018
b9cb2fa
Merge branch 'master' into tvos
appleguy Feb 19, 2018
917d3f3
Merge branch 'tvos' of github.com:alexhillc/Texture into tvos
alexhillc Feb 21, 2018
ebbf512
Clean up formatting to adhere to character/line limit + braces
alexhillc Feb 24, 2018
1a5b195
Merge branch 'master' into tvos
alexhillc Feb 28, 2018
873933e
Merge branch 'master' into tvos
alexhillc Mar 3, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 4 additions & 8 deletions AsyncDisplayKit.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,7 @@
690C35621E055C5D00069B91 /* ASDimensionInternal.mm in Sources */ = {isa = PBXBuildFile; fileRef = 690C35601E055C5D00069B91 /* ASDimensionInternal.mm */; };
690C35641E055C7B00069B91 /* ASDimensionInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 690C35631E055C7B00069B91 /* ASDimensionInternal.h */; settings = {ATTRIBUTES = (Public, ); }; };
690ED58E1E36BCA6000627C0 /* ASLayoutElementStylePrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 690ED58D1E36BCA6000627C0 /* ASLayoutElementStylePrivate.h */; settings = {ATTRIBUTES = (Private, ); }; };
690ED5961E36D118000627C0 /* ASControlNode+tvOS.h in Headers */ = {isa = PBXBuildFile; fileRef = 690ED5921E36D118000627C0 /* ASControlNode+tvOS.h */; settings = {ATTRIBUTES = (Private, ); }; };
690ED5981E36D118000627C0 /* ASControlNode+tvOS.m in Sources */ = {isa = PBXBuildFile; fileRef = 690ED5931E36D118000627C0 /* ASControlNode+tvOS.m */; };
690ED5991E36D118000627C0 /* ASImageNode+tvOS.h in Headers */ = {isa = PBXBuildFile; fileRef = 690ED5941E36D118000627C0 /* ASImageNode+tvOS.h */; settings = {ATTRIBUTES = (Private, ); }; };
690ED59B1E36D118000627C0 /* ASImageNode+tvOS.m in Sources */ = {isa = PBXBuildFile; fileRef = 690ED5951E36D118000627C0 /* ASImageNode+tvOS.m */; };
692510141E74FB44003F2DD0 /* [email protected] in Resources */ = {isa = PBXBuildFile; fileRef = 692510131E74FB44003F2DD0 /* [email protected] */; };
692BE8D71E36B65B00C86D87 /* ASLayoutSpecPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 692BE8D61E36B65B00C86D87 /* ASLayoutSpecPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; };
Expand Down Expand Up @@ -475,6 +473,7 @@
E5E2D72E1EA780C4005C24C6 /* ASCollectionGalleryLayoutDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = E5E2D72D1EA780C4005C24C6 /* ASCollectionGalleryLayoutDelegate.h */; settings = {ATTRIBUTES = (Public, ); }; };
E5E2D7301EA780DF005C24C6 /* ASCollectionGalleryLayoutDelegate.mm in Sources */ = {isa = PBXBuildFile; fileRef = E5E2D72F1EA780DF005C24C6 /* ASCollectionGalleryLayoutDelegate.mm */; };
F711994E1D20C21100568860 /* ASDisplayNodeExtrasTests.m in Sources */ = {isa = PBXBuildFile; fileRef = F711994D1D20C21100568860 /* ASDisplayNodeExtrasTests.m */; };
FA4FAF15200A850200E735BD /* ASControlNode+Private.h in Headers */ = {isa = PBXBuildFile; fileRef = FA4FAF14200A850200E735BD /* ASControlNode+Private.h */; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
Expand Down Expand Up @@ -670,9 +669,7 @@
690C35601E055C5D00069B91 /* ASDimensionInternal.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ASDimensionInternal.mm; sourceTree = "<group>"; };
690C35631E055C7B00069B91 /* ASDimensionInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASDimensionInternal.h; sourceTree = "<group>"; };
690ED58D1E36BCA6000627C0 /* ASLayoutElementStylePrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASLayoutElementStylePrivate.h; sourceTree = "<group>"; };
690ED5921E36D118000627C0 /* ASControlNode+tvOS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "ASControlNode+tvOS.h"; sourceTree = "<group>"; };
690ED5931E36D118000627C0 /* ASControlNode+tvOS.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "ASControlNode+tvOS.m"; sourceTree = "<group>"; };
690ED5941E36D118000627C0 /* ASImageNode+tvOS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "ASImageNode+tvOS.h"; sourceTree = "<group>"; };
690ED5951E36D118000627C0 /* ASImageNode+tvOS.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "ASImageNode+tvOS.m"; sourceTree = "<group>"; };
692510131E74FB44003F2DD0 /* [email protected] */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "[email protected]"; sourceTree = "<group>"; };
692BE8D61E36B65B00C86D87 /* ASLayoutSpecPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASLayoutSpecPrivate.h; sourceTree = "<group>"; };
Expand Down Expand Up @@ -982,6 +979,7 @@
E5E2D72F1EA780DF005C24C6 /* ASCollectionGalleryLayoutDelegate.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; lineEnding = 0; path = ASCollectionGalleryLayoutDelegate.mm; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };
EFA731F0396842FF8AB635EE /* libPods-AsyncDisplayKitTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-AsyncDisplayKitTests.a"; sourceTree = BUILT_PRODUCTS_DIR; };
F711994D1D20C21100568860 /* ASDisplayNodeExtrasTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ASDisplayNodeExtrasTests.m; sourceTree = "<group>"; };
FA4FAF14200A850200E735BD /* ASControlNode+Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "ASControlNode+Private.h"; sourceTree = "<group>"; };
FB07EABBCF28656C6297BC2D /* Pods-AsyncDisplayKitTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-AsyncDisplayKitTests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-AsyncDisplayKitTests/Pods-AsyncDisplayKitTests.debug.xcconfig"; sourceTree = "<group>"; };
/* End PBXFileReference section */

Expand Down Expand Up @@ -1424,6 +1422,7 @@
CC2E317F1DAC353700EEE891 /* ASCollectionView+Undeprecated.h */,
CC0F885A1E42807F00576FED /* ASCollectionViewFlowLayoutInspector.h */,
CC0F88591E42807F00576FED /* ASCollectionViewFlowLayoutInspector.m */,
FA4FAF14200A850200E735BD /* ASControlNode+Private.h */,
9F98C0231DBDF2A300476D92 /* ASControlTargetAction.h */,
9F98C0241DBDF2A300476D92 /* ASControlTargetAction.m */,
8B0768B11CE752EC002E1453 /* ASDefaultPlaybackButton.h */,
Expand Down Expand Up @@ -1531,9 +1530,7 @@
690ED5911E36D118000627C0 /* tvOS */ = {
isa = PBXGroup;
children = (
690ED5921E36D118000627C0 /* ASControlNode+tvOS.h */,
690ED5931E36D118000627C0 /* ASControlNode+tvOS.m */,
690ED5941E36D118000627C0 /* ASImageNode+tvOS.h */,
690ED5951E36D118000627C0 /* ASImageNode+tvOS.m */,
);
path = tvOS;
Expand Down Expand Up @@ -1887,6 +1884,7 @@
9C70F20F1CDBE9FF007D6C76 /* ASLayoutManager.h in Headers */,
6947B0C31E36B5040007C478 /* ASStackPositionedLayout.h in Headers */,
DBABFAFC1C6A8D2F0039EA4A /* _ASTransitionContext.h in Headers */,
FA4FAF15200A850200E735BD /* ASControlNode+Private.h in Headers */,
B350624F1B010EFD0018CF92 /* ASDisplayNode+DebugTiming.h in Headers */,
CC57EAF71E3939350034C595 /* ASCollectionView+Undeprecated.h in Headers */,
B35062521B010EFD0018CF92 /* ASDisplayNodeInternal.h in Headers */,
Expand All @@ -1902,14 +1900,12 @@
DEC146B71C37A16A004A0EE7 /* ASCollectionInternal.h in Headers */,
68B8A4E21CBDB958007E4543 /* ASWeakProxy.h in Headers */,
9F98C0271DBE29FC00476D92 /* ASControlTargetAction.h in Headers */,
690ED5961E36D118000627C0 /* ASControlNode+tvOS.h in Headers */,
695943401D70815300B0EE1F /* ASDisplayNodeLayout.h in Headers */,
0442850E1BAA64EC00D16268 /* ASTwoDimensionalArrayUtils.h in Headers */,
DE8BEAC21C2DF3FC00D57C12 /* ASDelegateProxy.h in Headers */,
B350623E1B010EFD0018CF92 /* _ASAsyncTransactionContainer+Private.h in Headers */,
AC6145411D8AFAE8003D62A2 /* ASSection.h in Headers */,
8BBBAB8C1CEBAF1700107FC6 /* ASDefaultPlaybackButton.h in Headers */,
690ED5991E36D118000627C0 /* ASImageNode+tvOS.h in Headers */,
254C6B741BF94DF4003EC431 /* ASTextNodeWordKerner.h in Headers */,
698DFF441E36B6C9002891F1 /* ASStackLayoutSpecUtilities.h in Headers */,
CCF18FF41D2575E300DF5895 /* NSIndexSet+ASHelpers.h in Headers */,
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
## master
* Add your own contributions to the next release on the line below this with your name.
- [tvOS] Fixes errors when building against tvOS SDK [Alex Hill](https://github.com/alexhillc) [#728](https://github.com/TextureGroup/Texture/pull/728)
- [ASDisplayNode] Add unit tests for layout z-order changes (with an open issue to fix).
- [ASDisplayNode] Consolidate main thread initialization and allow apps to invoke it manually instead of +load.
- [ASRunloopQueue] Introduce new runloop queue(ASCATransactionQueue) to coalesce Interface state update calls for view controller transitions.
Expand Down
2 changes: 1 addition & 1 deletion Source/ASCollectionView.mm
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ - (instancetype)_initWithFrame:(CGRect)frame collectionViewLayout:(UICollectionV
// Experiments done by Instagram show that this option being YES (default)
// when unused causes a significant hit to scroll performance.
// https://github.com/Instagram/IGListKit/issues/318
if (AS_AVAILABLE_IOS(10)) {
if (AS_AVAILABLE_IOS_TVOS(10, 10)) {
super.prefetchingEnabled = NO;
}

Expand Down
7 changes: 6 additions & 1 deletion Source/ASControlNode.h
Original file line number Diff line number Diff line change
Expand Up @@ -141,12 +141,17 @@ static UIControlState const ASControlStateSelected ASDISPLAYNODE_DEPRECATED_MSG(
@param event The event which triggered these control actions. May be nil.
*/
- (void)sendActionsForControlEvents:(ASControlNodeEvent)controlEvents withEvent:(nullable UIEvent *)event;
@end

#if TARGET_OS_TV
@interface ASControlNode (tvOS)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adding categories, this is a nice improvement for organization.


/**
@abstract How the node looks when it isn't focused. Exposed here so that subclasses can override.
*/
- (void)setDefaultFocusAppearance;
#endif

@end
#endif

NS_ASSUME_NONNULL_END
5 changes: 4 additions & 1 deletion Source/ASControlNode.mm
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
//

#import <AsyncDisplayKit/ASControlNode.h>
#import <AsyncDisplayKit/ASControlNode+Private.h>
#import <AsyncDisplayKit/ASControlNode+Subclasses.h>
#import <AsyncDisplayKit/ASDisplayNode+Subclasses.h>
#import <AsyncDisplayKit/ASImageNode.h>
Expand Down Expand Up @@ -103,10 +104,12 @@ - (instancetype)init
#if TARGET_OS_TV
- (void)didLoad
{
[super didLoad];

// On tvOS all controls, such as buttons, interact with the focus system even if they don't have a target set on them.
// Here we add our own internal tap gesture to handle this behaviour.
self.userInteractionEnabled = YES;
UITapGestureRecognizer *tapGestureRec = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(pressDown)];
UITapGestureRecognizer *tapGestureRec = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(_pressDown)];
tapGestureRec.allowedPressTypes = @[@(UIPressTypeSelect)];
[self.view addGestureRecognizer:tapGestureRec];
}
Expand Down
34 changes: 0 additions & 34 deletions Source/ASDisplayNode.mm
Original file line number Diff line number Diff line change
Expand Up @@ -3601,40 +3601,6 @@ - (void)asyncTraitCollectionDidChange
{
// Subclass override
}

#if TARGET_OS_TV
#pragma mark - UIFocusEnvironment Protocol (tvOS)

- (void)setNeedsFocusUpdate
{

}

- (void)updateFocusIfNeeded
{

}

- (BOOL)shouldUpdateFocusInContext:(UIFocusUpdateContext *)context
{
return NO;
}

- (void)didUpdateFocusInContext:(UIFocusUpdateContext *)context withAnimationCoordinator:(UIFocusAnimationCoordinator *)coordinator
{

}

- (UIView *)preferredFocusedView
{
if (self.nodeLoaded) {
return self.view;
} else {
return nil;
}
}
#endif

@end

#pragma mark - ASDisplayNode (Debugging)
Expand Down
2 changes: 1 addition & 1 deletion Source/ASImageNode+AnimatedImage.mm
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ - (void)displayLinkFired:(CADisplayLink *)displayLink
CFTimeInterval timeBetweenLastFire;
if (self.lastDisplayLinkFire == 0) {
timeBetweenLastFire = 0;
} else if (AS_AVAILABLE_IOS(10)){
} else if (AS_AVAILABLE_IOS_TVOS(10, 10)) {
timeBetweenLastFire = displayLink.targetTimestamp - displayLink.timestamp;
} else {
timeBetweenLastFire = CACurrentMediaTime() - self.lastDisplayLinkFire;
Expand Down
5 changes: 5 additions & 0 deletions Source/ASImageNode.h
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,11 @@ typedef UIImage * _Nullable (^asimagenode_modification_block_t)(UIImage *image);

@end

#if TARGET_OS_TV
@interface ASImageNode (tvOS)
@end
#endif

@interface ASImageNode (AnimatedImage)

/**
Expand Down
14 changes: 4 additions & 10 deletions Source/ASMultiplexImageNode.h
Original file line number Diff line number Diff line change
Expand Up @@ -131,14 +131,12 @@ typedef NS_ENUM(NSUInteger, ASMultiplexImageNodeErrorCode) {
*/
@property (nonatomic, assign, readwrite) BOOL shouldRenderProgressImages;

#if TARGET_OS_IOS
/**
* @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.

* @see `+[NSURL URLWithAssetLocalIdentifier:targetSize:contentMode:options:]` below.
*/
@property (nullable, nonatomic, strong) PHImageManager *imageManager;
#endif
@property (nullable, nonatomic, strong) PHImageManager *imageManager API_AVAILABLE(ios(8.0), tvos(10.0));
@end


Expand Down Expand Up @@ -245,7 +243,6 @@ didFinishDownloadingImageWithIdentifier:(ASImageIdentifier)imageIdentifier
*/
- (nullable NSURL *)multiplexImageNode:(ASMultiplexImageNode *)imageNode URLForImageIdentifier:(ASImageIdentifier)imageIdentifier;

#if TARGET_OS_IOS
/**
* @abstract A PHAsset for the specific asset local identifier
* @param imageNode The sender.
Expand All @@ -256,12 +253,10 @@ didFinishDownloadingImageWithIdentifier:(ASImageIdentifier)imageIdentifier
* @note This method may be called from any thread.
* @return A PHAsset corresponding to `assetLocalIdentifier`, or nil if none is available.
*/
- (nullable PHAsset *)multiplexImageNode:(ASMultiplexImageNode *)imageNode assetForLocalIdentifier:(NSString *)assetLocalIdentifier;
#endif
- (nullable PHAsset *)multiplexImageNode:(ASMultiplexImageNode *)imageNode assetForLocalIdentifier:(NSString *)assetLocalIdentifier API_AVAILABLE(ios(8.0), tvos(10.0));
@end

#pragma mark -
#if TARGET_OS_IOS
#pragma mark -
@interface NSURL (ASPhotosFrameworkURLs)

/**
Expand All @@ -275,9 +270,8 @@ didFinishDownloadingImageWithIdentifier:(ASImageIdentifier)imageIdentifier
+ (NSURL *)URLWithAssetLocalIdentifier:(NSString *)assetLocalIdentifier
targetSize:(CGSize)targetSize
contentMode:(PHImageContentMode)contentMode
options:(PHImageRequestOptions *)options AS_WARN_UNUSED_RESULT;
options:(PHImageRequestOptions *)options AS_WARN_UNUSED_RESULT API_AVAILABLE(ios(8.0), tvos(10.0));

@end
#endif

NS_ASSUME_NONNULL_END
Loading