diff --git a/Source/ASCellNode.mm b/Source/ASCellNode.mm index 54cf94a1..f771471d 100644 --- a/Source/ASCellNode.mm +++ b/Source/ASCellNode.mm @@ -321,6 +321,15 @@ withCellFrame:cellFrame]; } +- (UIColor *)tintColor +{ + if (self.supernode == nil && self.scrollView != nil) { + return self.scrollView.tintColor; + } else { + return [super tintColor]; + } +} + - (NSMutableArray *)propertiesForDebugDescription { NSMutableArray *result = [super propertiesForDebugDescription]; diff --git a/Source/ASImageNode.mm b/Source/ASImageNode.mm index 1d867acb..a5337637 100644 --- a/Source/ASImageNode.mm +++ b/Source/ASImageNode.mm @@ -188,7 +188,6 @@ typedef void (^ASImageNodeDrawParametersBlock)(ASWeakMapEntry *entry); _cropDisplayBounds = CGRectNull; _placeholderColor = ASDisplayNodeDefaultPlaceholderColor(); _animatedImageRunLoopMode = ASAnimatedImageDefaultRunLoopMode; - return self; } @@ -297,6 +296,15 @@ typedef void (^ASImageNodeDrawParametersBlock)(ASWeakMapEntry *entry); #pragma mark - Drawing +//- (void)didEnterHierarchy +//{ +// [super didEnterHierarchy]; +// if (self.interfaceState & ASInterfaceStateDisplay) { +// [self tintColorDidChange]; +// } +//} + + - (NSObject *)drawParametersForAsyncLayer:(_ASDisplayLayer *)layer { ASLockScopeSelf(); diff --git a/Source/ASTableView.mm b/Source/ASTableView.mm index 98e3c830..87b87450 100644 --- a/Source/ASTableView.mm +++ b/Source/ASTableView.mm @@ -113,7 +113,7 @@ static NSString * const kCellReuseIdentifier = @"_ASTableViewCell"; self.selectionStyle = node.selectionStyle; self.focusStyle = node.focusStyle; self.accessoryType = node.accessoryType; - self.tintColor = node.tintColor; +// self.tintColor = node.tintColor; // the following ensures that we clip the entire cell to it's bounds if node.clipsToBounds is set (the default) // This is actually a workaround for a bug we are seeing in some rare cases (selected background view diff --git a/examples/ASDKgram/Sample/Assets.xcassets/AppIcon.appiconset/Contents.json b/examples/ASDKgram/Sample/Assets.xcassets/AppIcon.appiconset/Contents.json index eeea76c2..d8db8d65 100644 --- a/examples/ASDKgram/Sample/Assets.xcassets/AppIcon.appiconset/Contents.json +++ b/examples/ASDKgram/Sample/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -1,5 +1,15 @@ { "images" : [ + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "3x" + }, { "idiom" : "iphone", "size" : "29x29", @@ -30,6 +40,16 @@ "size" : "60x60", "scale" : "3x" }, + { + "idiom" : "ipad", + "size" : "20x20", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "20x20", + "scale" : "2x" + }, { "idiom" : "ipad", "size" : "29x29", @@ -64,6 +84,11 @@ "idiom" : "ipad", "size" : "83.5x83.5", "scale" : "2x" + }, + { + "idiom" : "ios-marketing", + "size" : "1024x1024", + "scale" : "1x" } ], "info" : { diff --git a/examples/ASDKgram/Sample/PhotoCellNode.m b/examples/ASDKgram/Sample/PhotoCellNode.m index 5353da65..ed220ca0 100644 --- a/examples/ASDKgram/Sample/PhotoCellNode.m +++ b/examples/ASDKgram/Sample/PhotoCellNode.m @@ -35,7 +35,7 @@ @implementation PhotoCellNode { PhotoModel *_photoModel; - ASNetworkImageNode *_userAvatarImageNode; + ASImageNode *_userAvatarImageNode; ASNetworkImageNode *_photoImageNode; ASTextNode *_userNameLabel; ASTextNode *_photoLocationLabel; @@ -54,15 +54,16 @@ _photoModel = photo; - _userAvatarImageNode = [[ASNetworkImageNode alloc] init]; - _userAvatarImageNode.URL = photo.ownerUserProfile.userPicURL; // FIXME: make round - - // FIXME: autocomplete for this line seems broken - [_userAvatarImageNode setImageModificationBlock:^UIImage *(UIImage *image) { - CGSize profileImageSize = CGSizeMake(USER_IMAGE_HEIGHT, USER_IMAGE_HEIGHT); - return [image makeCircularImageWithSize:profileImageSize backgroundColor:nil]; - }]; + _userAvatarImageNode = [[ASImageNode alloc] init]; +// _userAvatarImageNode.URL = photo.ownerUserProfile.userPicURL; // FIXME: make round + // FIXME: autocomplete for this line seems broken +// [_userAvatarImageNode setImageModificationBlock:^UIImage *(UIImage *image) { +// CGSize profileImageSize = CGSizeMake(USER_IMAGE_HEIGHT, USER_IMAGE_HEIGHT); +// return [[image makeCircularImageWithSize:profileImageSize backgroundColor:nil] imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate]; +// }]; +// + _userAvatarImageNode.image = [[UIImage as_imageNamed:@"profile"] imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate]; _photoImageNode = [[ASNetworkImageNode alloc] init]; _photoImageNode.delegate = self; _photoImageNode.URL = photo.URL; diff --git a/examples/ASDKgram/Sample/PhotoFeedViewController.m b/examples/ASDKgram/Sample/PhotoFeedViewController.m index 479749f5..47fa33f2 100644 --- a/examples/ASDKgram/Sample/PhotoFeedViewController.m +++ b/examples/ASDKgram/Sample/PhotoFeedViewController.m @@ -74,6 +74,10 @@ static NSString *TableViewCellIdentifier = @"PhotoCell"; #pragma mark - UITableViewDataSource methods +- (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath { + +} + - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { return [self.photoFeed numberOfItemsInFeed]; diff --git a/examples/ASDKgram/Sample/PhotoTableViewCell.m b/examples/ASDKgram/Sample/PhotoTableViewCell.m index 4f7beba1..0d41492d 100644 --- a/examples/ASDKgram/Sample/PhotoTableViewCell.m +++ b/examples/ASDKgram/Sample/PhotoTableViewCell.m @@ -435,7 +435,7 @@ static NSURL *UserProfileURLForPhotoModel(PhotoModel *photoModel) { } CGSize profileImageSize = CGSizeMake(USER_IMAGE_HEIGHT, USER_IMAGE_HEIGHT); - _userAvatarImageView.image = [image makeCircularImageWithSize:profileImageSize backgroundColor:[UIColor backgroundColor]]; + _userAvatarImageView.image = [[image makeCircularImageWithSize:profileImageSize backgroundColor:[UIColor backgroundColor]] imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate]; }]; } diff --git a/examples/ASDKgram/Sample/TextureConfigDelegate.m b/examples/ASDKgram/Sample/TextureConfigDelegate.m index e2fabef4..d0e40c06 100644 --- a/examples/ASDKgram/Sample/TextureConfigDelegate.m +++ b/examples/ASDKgram/Sample/TextureConfigDelegate.m @@ -17,7 +17,8 @@ + (ASConfiguration *)textureConfiguration { ASConfiguration *config = [[ASConfiguration alloc] init]; - config.experimentalFeatures = ASExperimentalTextNode; + config.experimentalFeatures = ASExperimentalTextNode | ASExperimentalTraitCollectionDidChangeWithPreviousCollection; + config.delegate = [[TextureConfigDelegate alloc] init]; return config; } diff --git a/examples/ASDKgram/Sample/WindowWithStatusBarUnderlay.m b/examples/ASDKgram/Sample/WindowWithStatusBarUnderlay.m index 91670c29..e4167331 100644 --- a/examples/ASDKgram/Sample/WindowWithStatusBarUnderlay.m +++ b/examples/ASDKgram/Sample/WindowWithStatusBarUnderlay.m @@ -22,6 +22,7 @@ _statusBarOpaqueUnderlayView = [[UIView alloc] init]; _statusBarOpaqueUnderlayView.backgroundColor = [UIColor darkBlueColor]; [self addSubview:_statusBarOpaqueUnderlayView]; + self.tintColor = [UIColor systemRedColor]; } return self; }