rFlex / SCRecorder

iOS camera engine with Vine-like tap to record, animatable filters, slow motion, segments editing
Apache License 2.0
3.06k stars 583 forks source link

swipe gesture of swipeable filter view works weird on iOS 10 betas #339

Open toddoh opened 8 years ago

toddoh commented 8 years ago

On iOS 10 betas, the swipe gesture of swipeablefilterview works very choppy, without any swipe transition at all.

twomedia commented 8 years ago

I don't seem to be experiencing this in IOS 10 Beta 4, could you confirm that when testing on the latest version of IOS 9 this issue doesn't occur?

toddoh commented 8 years ago

It works okay on iOS 9.3.4, but not on iOS 10 Beta 5 (Public beta 4)

twomedia commented 8 years ago

Are you able to upload an example project with the issue? I'll take a look at it.

toddoh commented 8 years ago

I've enabled 'showsHorizontalScrollIndicator' option in SCSwipeableFilterView.m to see what's the reason behind it. Turns out, the scrollView works okay as the scroll bar moves as you drag. However, the filter overlay doesn't follow the offset until it reaches the drag end point.

I've implemented in a very basic way.

_filterSwitcherView = [[SCSwipeableFilterView alloc] initWithFrame:CGRectMake(0,0, self.view.frame.size.width, self.view.frame.size.height)]; _filterSwitcherView.scaleAndResizeCIImageAutomatically = YES; _filterSwitcherView.contentMode = UIViewContentModeScaleAspectFill; [_filterSwitcherView setImageByUIImage:image]; [_filterSwitcherView setClipsToBounds:YES]; [self.view addSubview:_filterSwitcherView];

_filterSwitcherView.filters = @[
                                [SCFilter emptyFilter],
                                [SCFilter filterWithCIFilterName:@"CIPhotoEffectNoir"],
                                [SCFilter filterWithCIFilterName:@"CIPhotoEffectChrome"],
                                [SCFilter filterWithCIFilterName:@"CIPhotoEffectInstant"],
                                [SCFilter filterWithCIFilterName:@"CIPhotoEffectTonal"],
                                [SCFilter filterWithCIFilterName:@"CIPhotoEffectFade"]
                                ];
toddoh commented 8 years ago

This seems like a bug of contentOffset codes in scrollViewDidScroll. Anyone has any solution or idea about this issue?

toddoh commented 8 years ago

I found out that iOS default CIFilters are causing the issue. Custom filters are working OK.

UIApplicationMain commented 7 years ago

Can confirm I am having this problem too, it looks to only be linked to the CIPhotoEffect filters, the swipe view works fine for other iOS default filters like CISepiaTone, etc that don't have "PhotoEffect" in the name.

Anyone have any luck with this? iOS 10

mayuur commented 7 years ago

I can confirm this happens on Custom Filters as well. I had some LUTs which I have used as CIFilters and faced the same issue. Is there any fix or workaround for this?

Amalous commented 7 years ago

Any luck with this problem?

mayuur commented 7 years ago

@sulamatraore Creating Luts with CoreImageShop and then using them with SCRecorder fixed the issue for me!

Amalous commented 7 years ago

@mayuur Thanks!

ptescher commented 7 years ago

I dug into this and it seems to be a bug with Core Image. Specifically https://github.com/rFlex/SCRecorder/blob/master/Library/Sources/SCSwipeableFilterView.m#L178 where we call [CIImage imageByCroppingToRect:] and then [CIImage imageByCompositingOverImage:] doesn't work with some filters.

subinspathilettu commented 7 years ago

Is there any solution for this problem? The filter swipe action is working in iOS 9, but not in iOS 10.

Amalous commented 7 years ago

Unfortunately, the swipe action only works when you create custom filters instead of using the CI Effects provided by Apple on iOS 10. You can create these custom filters by using CoreImageShop