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

iOS10.3.3 and 12.5.2 crash with datepicker #1419

Closed
ckarmy opened this issue May 26, 2021 · 6 comments
Closed

iOS10.3.3 and 12.5.2 crash with datepicker #1419

ckarmy opened this issue May 26, 2021 · 6 comments

Comments

@ckarmy
Copy link
Contributor

ckarmy commented May 26, 2021

I get this when the app start and crash on iOS10.3.3 and 12.5.2...

-[UIDatePicker setPreferredDatePickerStyle:]: unrecognized selector sent to instance

image

@ckarmy
Copy link
Contributor Author

ckarmy commented May 26, 2021

I think this feature #1384 is not supported in all iOS versions...

@ichan-mb
Copy link
Member

Hi.. thanks for reporting, we will investigate it

@ckarmy
Copy link
Contributor Author

ckarmy commented May 27, 2021

@ichan-mb to solve the problem we need to modify iOS/DatePicker.uno from line 153 to 198 to:

                [Foreign(Language.ObjC)]
		int GetDatePickerStyle(ObjC.Object datePickerHandle)
		@{
			if (@available(iOS 13.4, *)) {
				UIDatePicker *dp = (UIDatePicker *)datePickerHandle;
				UIDatePickerStyle style = dp.datePickerStyle;
				switch(style)
				{
					case UIDatePickerStyleAutomatic:
						return 0;
					case UIDatePickerStyleCompact:
						return 1;
					case UIDatePickerStyleInline:
						return 2;
					case UIDatePickerStyleWheels:
						return 3;
				}
			}else {
				return 0;
			}
		@}

		[Foreign(Language.ObjC)]
		void SetDatePickerStyle(ObjC.Object datePickerHandle, int style)
		@{
			if (@available(iOS 13.4, *)) {
				UIDatePicker *dp = (UIDatePicker *)datePickerHandle;
				UIDatePickerStyle datePickerStyle = UIDatePickerStyleAutomatic;
				switch (style)
				{
					case 0:
						datePickerStyle = UIDatePickerStyleAutomatic;
						break;
					case 1:
						datePickerStyle = UIDatePickerStyleCompact;
						break;
					case 2:
						datePickerStyle = UIDatePickerStyleInline;
						break;
					case 3:
						datePickerStyle = UIDatePickerStyleWheels;
						break;
				}
				[dp setPreferredDatePickerStyle:datePickerStyle];
			}
		@}

basically add if (@available(iOS 13.4, *)) { and else

@ichan-mb
Copy link
Member

ichan-mb commented Jun 2, 2021

yeah.. I've made PR hopefully to fix this issue

@ckarmy
Copy link
Contributor Author

ckarmy commented Aug 26, 2021

yeah.. I've made PR hopefully to fix this issue

This is not available yet in FuseX? How can implement it?

@ckarmy
Copy link
Contributor Author

ckarmy commented Aug 26, 2021

Solved by downloading Fuselibs and uno files and replacing it in the FuseX contents folder

@ckarmy ckarmy closed this as completed Aug 26, 2021
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants