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

iOS 13 Support #334

Closed
JacobSyndeo opened this issue Jun 4, 2019 · 57 comments
Closed

iOS 13 Support #334

JacobSyndeo opened this issue Jun 4, 2019 · 57 comments

Comments

@JacobSyndeo
Copy link

Description

When presenting a popupController on iOS 13, the application crashes. The device log says:

Terminating app due to uncaught exception 'NSGenericException', reason: 'Access to _UIBarBackground's _shadowView ivar is prohibited. This is an application bug'

An exception breakpoint reveals the issue to be caused in LNPopupController.m:924:

self.popupBar.systemShadowColor = [_bottomBar valueForKeyPath:str2];

So apparently we can't set that property anymore.

Steps to Reproduce

Present a popupBar on iOS 13

Device, OS and Xcode Versions

iPhone Xs
iOS 13 beta 1
Xcode 11 beta 1

@LeoNatan LeoNatan changed the title iOS 13 API changes iOS 13 Support Jun 5, 2019
@LeoNatan
Copy link
Owner

LeoNatan commented Jun 5, 2019

Thanks
I will sherlock your thread for the entire initial iOS 13 support tracking.

I will start looking at this soon, once the iOS beta and Xcode are a bit more stable.

@MacMark
Copy link

MacMark commented Jun 7, 2019

I have this issue too:

[General] CRASH: Access to _UIBarBackground's _shadowView ivar is prohibited. This is an application bug

8   LNPopupController                   0x00000001032d6d20 -[LNPopupController _configurePopupBarFromBottomBar] + 1396
9   LNPopupController                   0x00000001032d9a18 -[LNPopupController presentPopupBarAnimated:openPopup:completion:] + 1168
10  LNPopupController                   0x00000001032ebac8 -[UIViewController(LNPopupSupport) presentPopupBarWithContentViewController:openPopup:animated:completion:] + 284
11  LNPopupController                   0x00000001032ebb94 -[UIViewController(LNPopupSupport) presentPopupBarWithContentViewController:animated:completion:] + 144

It seems to be an already known issue with previous iOS versions because the code obfuscates the acccess to the shadowView ivar here in _configurePopupBarFromBottomBar:


#ifndef LNPopupControllerEnforceStrictClean
	//backgroundView
	static NSString* const bV = @"X2JhY2tncm91bmRWaWV3";
	//backgroundView.shadowView.backgroundColor
	static NSString* const bVsVbC = @"YmFja2dyb3VuZFZpZXcuc2hhZG93Vmlldy5iYWNrZ3JvdW5kQ29sb3I=";
	
	NSString* str1 = _LNPopupDecodeBase64String(bV);
	
	if([_bottomBar respondsToSelector:NSSelectorFromString(str1)])
	{
		NSString* str2 = _LNPopupDecodeBase64String(bVsVbC);
		
		if([[NSProcessInfo processInfo] operatingSystemVersion].majorVersion >= 10)
		{
			self.popupBar.systemShadowColor = [_bottomBar valueForKeyPath:str2];
		}
		else
		{
			self.popupBar.systemShadowColor = [UIColor lightGrayColor];
		}
	}
#endif

Looks like iOS 13 cannot be tricked by this anymore ;-)

Possible workarounds:

  • Enabling LNPopupControllerEnforceStrictClean in LNPopupControllerEnforceStrictClean
  • Adding -LNPopupControllerEnforceStrictClean 1 in Run configuration

@LeoNatan
Copy link
Owner

LeoNatan commented Jun 7, 2019

There is always object_getIvar(). 😂

@LeoNatan
Copy link
Owner

LeoNatan commented Jun 7, 2019

I will look into this soon.

@MacMark
Copy link

MacMark commented Jun 7, 2019

iOS 13 has the card appearance style as a default for modal presentations. Maybe an option to configure the appearance style of the popup would be useful to enforce the "old" look of the popup?

@LeoNatan
Copy link
Owner

LeoNatan commented Jun 7, 2019

The popup does not currently use the normal presentation methods of iOS (e.g., UIPresentationController), so it shouldn't trigger that card presentation. Since I haven't looked at the iOS 13 runtime at all to see how this card presentation is achieved, I cannot say whether it is possible to use for the popup in a way that does not require rewriting everything.

In any way, SwiftUI support seems out of the question, as they completely abstract view controllers from the user, despite using them heavily themselves.

@iDevelopper
Copy link
Contributor

@MacMark , Actually the framework does not use presentViewController:animated method for presenting the popup content view controller.

@MacMark
Copy link

MacMark commented Jun 7, 2019

Yes, you're right, the popup is not affected by the card stuff and looks the same like before. My mistake.

@iDevelopper
Copy link
Contributor

@LeoNatan , they just added a new value for the modalPresentationStyle property (UIModalPresentationAutomatic).

A presentation style chosen by the system. And this is the default value.

@LeoNatan
Copy link
Owner

LeoNatan commented Jun 7, 2019

@iDevelopper So there is no way to reproduce this manually using some UIPresentationController subclass? It's all private?

@iDevelopper
Copy link
Contributor

@LeoNatan , no way. It is like it was before except this new value for modalPresentationStyle property.

@LeoNatan
Copy link
Owner

LeoNatan commented Jun 7, 2019

Thanks

@iDevelopper
Copy link
Contributor

iOS 13 beta: Also, It seems that Apple has removed the swipe gesture to present the maxi player in Music App. But she was not very good in fact ... A lot of glitch effects...

@LeoNatan
Copy link
Owner

LeoNatan commented Jun 7, 2019

You mean drag?

@iDevelopper
Copy link
Contributor

Yes from the popup bar to open the popup content view controller by dragging up.

@iDevelopper
Copy link
Contributor

iDevelopper commented Jun 7, 2019

But it is the first beta and in my implementation, the drag does not work properly when modalPresentationStyle is set to the default value (UIModalPresentationAutomatic) for the presenting view controller. They will surely correct...

@LeoNatan
Copy link
Owner

LeoNatan commented Jun 8, 2019

I've found the issue and will push a fix soon.
I've also noticed another issue, where trying to dismiss the popup actually dismisses the container controller itself, due to the new presentation stuff by Apple.

@LeoNatan
Copy link
Owner

LeoNatan commented Jun 8, 2019

iOS 13 is presenting … challenges. 🙃

@LeoNatan
Copy link
Owner

LeoNatan commented Jun 9, 2019

Dark mode support will be coming later, as there are currently bugs in the system: https://twitter.com/smileyborg/status/1137511042949365761

@LeoNatan
Copy link
Owner

LeoNatan commented Jun 9, 2019

Pushed a fix on master with support for iOS 13.

@LeoNatan
Copy link
Owner

Added support for iOS 13 dark mode.
There is one issue that I know of that I need to fix, and that's UITabBarController+UINavigationController pop animation.

@LeoNatan
Copy link
Owner

5DA55869-A29B-4725-9CBE-D4C4264176F8

Quick GIF from the phone running beta 2.

LeoNatan added a commit that referenced this issue Jul 11, 2019
@LeoNatan LeoNatan pinned this issue Jul 11, 2019
@LeoNatan
Copy link
Owner

v2.7.2 is out with initial support for iOS 13 (up to and including beta 3)
Please test and report back how it works for you. Thanks

@funkenstrahlen
Copy link
Contributor

I am running 2.7.3 for some time now in my app and it runs perfectly fine without any issues. Thanks and thumbs up from my side! 😊

@LeoNatan
Copy link
Owner

Thank you!

@LeoNatan
Copy link
Owner

Heh

Screen Shot 2019-08-21 at 20 43 29

@funkenstrahlen
Copy link
Contributor

Do not understand, missing something?

He is happy this code works on Catalina via Catalyst.

@LeoNatan
Copy link
Owner

I worked on it further. It works great now on macOS. I don't believe it's a good ux for a Mac app, but if someone wants to use it, they can.

@iDevelopper
Copy link
Contributor

Sorry, I have not looked enough. I did not notice the three buttons on the Mac interface. But this this thread concerns iOS 13 however. So, bravo! I'll have a look with a Mac updated with the Catalina beta. It will be better with a splitViewController, yes.

What are the things to modify so that the interfarce user also appears on Mac OS X while the framework was developed for iOS?

@LeoNatan
Copy link
Owner

You enable macOS as a platform in the project. Then your iOS app runs on the Mac like it’s an iPad app. It doesn’t look like a Mac app but runs.

@LeoNatan
Copy link
Owner

I suggest you look at WWDC videos on the subject.

@iDevelopper
Copy link
Contributor

Ah ok, thanks!

It is like an iPhone application can be run on a iPad in a emulate mode?

@iDevelopper
Copy link
Contributor

Hi @LeoNatan , I don't understand what is for these delegate methods (never called):

- (nullable UIContextMenuConfiguration *)tableView:(UITableView *)tableView contextMenuConfigurationForRowAtIndexPath:(NSIndexPath *)indexPath point:(CGPoint)point API_AVAILABLE(ios(13.0))
{
	return [UIContextMenuConfiguration configurationWithIdentifier:@"Preview" previewProvider:^ UIViewController* {
		NSString* cellIdentifier = [tableView cellForRowAtIndexPath:indexPath].reuseIdentifier;
		id segueTemplate = [self _segueTemplateWithIdentifier:cellIdentifier];
		return [segueTemplate instantiateOrFindDestinationViewControllerWithSender:self];;
	} actionProvider:nil];
}

- (void)tableView:(UITableView *)tableView willPerformPreviewActionForMenuWithConfiguration:(UIContextMenuConfiguration *)configuration animator:(id<UIContextMenuInteractionCommitAnimating>)animator API_AVAILABLE(ios(13.0))
{
	UIViewController* vc = animator.previewViewController;
	
	[animator addCompletion:^{
		[self presentViewController:vc animated:YES completion:nil];
	}];
}

@LeoNatan
Copy link
Owner

Again, please watch the WWDC videos describing new iOS 13 features. UIContextMenuConfiguration is used in the demo project as an example for users, and is most definitely called on iOS 13.

@iDevelopper
Copy link
Contributor

I wanted to say that in your sample, these two UITableView delegate methods are never called (of course I test with iOS 13).

The delegate methods of UIContextMenuInteractionDelegate are called.

@LeoNatan
Copy link
Owner

Try long pressing a cell, then tap the preview.

@iDevelopper
Copy link
Contributor

Ok, my apologies! I was expecting after a long pressing on a music cell...

@LeoNatan
Copy link
Owner

But it's not in the same class. :) The music app sits in Swift land.

@iDevelopper
Copy link
Contributor

Yes sorry, and? We can't do it in the Music app in Swift?

@LeoNatan
Copy link
Owner

What? Why not?
You pointed to code in an Objective C class unrelated to Music, and claimed it was never called.

@iDevelopper
Copy link
Contributor

Yes you are right but I think the best place for this demo should be in the music demo, no?

@LeoNatan
Copy link
Owner

The whole point why I added that was because in the storyboard, I have the old peek/pop API (3D touch), but there is no such API currently for context menus. So I wanted to have the same functionality as before.

I also added the context menu in the normal stuff.

In iOS music app, 3D touching a song displays an activity view controller, not a preview.

@iDevelopper
Copy link
Contributor

iDevelopper commented Sep 8, 2019

Hi @LeoNatan ,

Nothing major, but I wanted to show it to you (Mac OS Dark Mode):

Capture d’écran 2019-09-08 à 06 58 20

Capture d’écran 2019-09-08 à 07 07 15

@iDevelopper
Copy link
Contributor

Also your navigation controllers are gone:

Capture d’écran 2019-09-08 à 07 21 30

@LeoNatan
Copy link
Owner

LeoNatan commented Sep 8, 2019

I don't know why it looks like that on your end on macOS. It's not how it looks for me. Make sure you are running on the latest version of macOS Catalina and compiling with the latest version of Xcode.

The navigation bar is not gone, it's the new navigation appearance stuff they introduced. Please read the docs:
https://developer.apple.com/documentation/uikit/uinavigationitem?changes=latest_minor&language=objc

Image-2

@LeoNatan
Copy link
Owner

LeoNatan commented Sep 8, 2019

Hmm just reproduced the color issue on Catalina. Will fix @iDevelopper. Thanks!

@LeoNatan
Copy link
Owner

LeoNatan commented Sep 8, 2019

This seems like a bug in either Xcode or macOS. Wasn't there when I was working on v3 two weeks ago...

@LeoNatan
Copy link
Owner

LeoNatan commented Sep 8, 2019

I won't fight the system bugs. Apple's software quality is ridiculous at this point. Once they fix Xcode, it will look as it is intended to on Catalyst.

The problem is that Xcode produces hardcoded RGB colors on Mac, rather than dynamic colors. This is why you see white backgrounds and dark text color.

@funkenstrahlen
Copy link
Contributor

+1 for not fighting system bugs especially for such a new technology like catalyst.

@LeoNatan
Copy link
Owner

LeoNatan commented Sep 8, 2019

Yes, but Apple state of tooling and software is embarrassing. iOS 13 and tvOS 13 are full of bugs. Xcode is a crashfest and bugfest. And that's not even discussing SwiftUI and Combine, which are comedies of errors. Apple has obviously bitten way, way more than they can chew.

@iDevelopper
Copy link
Contributor

I'am using the last bata version of Catalina and the last beta version of Xcode (beta 7) but in About it is beta 6! Your table view background color is not set to systemBackgroundColor.

@LeoNatan
Copy link
Owner

LeoNatan commented Sep 9, 2019

Duplicate feedback to Apple:

FB7233302 (Xcode / Interface Builder produces broken results on macOS Catalyst)

@LeoNatan
Copy link
Owner

LeoNatan commented Oct 3, 2019

The dark mode issue has been resolved in Xcode 11.2 beta and macOS 15.0 beta 10.

@LeoNatan
Copy link
Owner

LeoNatan commented Oct 3, 2019

I think I will close this issue. I am not aware of any outstanding iOS 13 issues. Please open a new issue if you find new issues.

@LeoNatan LeoNatan closed this as completed Oct 3, 2019
@LeoNatan LeoNatan unpinned this issue Nov 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants