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

can not set motionNavigationTransitionType in objc #70

Closed
StefaniOSApps opened this issue Jun 10, 2019 · 17 comments
Closed

can not set motionNavigationTransitionType in objc #70

StefaniOSApps opened this issue Jun 10, 2019 · 17 comments

Comments

@StefaniOSApps
Copy link

how to set motionNavigationTransitionType in objc?

[[self navigationController] setIsMotionEnabled:YES]; works, but

[[self navigationController] setMotionNavigationTransitionType:MotionNavigationTransitionTypeAuto]; not working

could you add @objc support? thx.

@OrkhanAlikhanov
Copy link
Contributor

Hey! It has been 5 years that swift is available. I think we don't support objective c anymore in favor of new features of swift which are not available in obj c. Thank you!

What do you think @DanielDahan?

@daniel-jonathan
Copy link
Member

@OrkhanAlikhanov yes that is correct, Swift has been out for a while, but that said, there are still projects out there that need Obj-C support by design.... not necessarily by desire. If it is as simple as adding @objc to the declaration, I don't see why adding it would be an issue. If it is a feature solely in Swift, well then we can't do anything about that. Thoughts?

Originally posted by @DanielDahan in CosmicMind/Material#1247 (comment)

@StefaniOSApps
Copy link
Author

All frameworks of Apple Inc. are written in Obj.-C. Yes, there are advantages in Swift but also many disadvantages. I only write UI in Swift and Classen in ObjC. It would be nice, if you provide at least basic functions in ObjC like other frameworks. I am of the opinion that this is the case here. Adding @objc should not be a big problem. Otherwise, I would have to create a repo because of this one function.

@daniel-jonathan
Copy link
Member

daniel-jonathan commented Jun 10, 2019

@StefaniOSApps your issue is one of 1200+ issues we solve, think about, and discuss... ultimately the easiest solution is to PR and provide reasoning... comparing our framework to others as a form of motivation is bad form in my opinion... personally we don't compare our thoughts of Obj-C to yours, we only aim to reason about them. Also, we are very familiar with how Apple does their work, considering the technical level of our projects.

That said, my comment above already supports your comment in a much more enjoyable fashion. Thank you!

@daniel-jonathan
Copy link
Member

@StefaniOSApps a PR with updates to fix your issue will be available later today, or latest tomorrow. Thank you!

@OrkhanAlikhanov
Copy link
Contributor

MotionTransitionAnimationType enum has some complex cases that cannot be represented in obj-c. I'll look into it more if I can work around.

public enum MotionTransitionAnimationType {
public enum Direction {
case left
case right
case up
case down
}
case none
case auto
case push(direction: Direction)
case pull(direction: Direction)
case cover(direction: Direction)
case uncover(direction: Direction)
case slide(direction: Direction)
case zoomSlide(direction: Direction)
case pageIn(direction: Direction)
case pageOut(direction: Direction)
case fade
case zoom
case zoomOut
indirect case selectBy(presenting: MotionTransitionAnimationType, dismissing: MotionTransitionAnimationType)

@StefaniOSApps
Copy link
Author

Ok, I understand the problem. Thanks anyway, for watching it. You could extract single enums and only provide them in ObjC. Thus, a function that refers in Swift back to the original function.

@daniel-jonathan
Copy link
Member

@StefaniOSApps how about you provide a PR with your desired solution and we will review it? It seems that you have this well understood.

@StefaniOSApps
Copy link
Author

ok, I work on it. Could you change state to pending? thx.

@daniel-jonathan
Copy link
Member

Thank you @StefaniOSApps :)

@StefaniOSApps
Copy link
Author

now I replaced this local var to a void function, which is splittet in with and without a direction. I think its ok. If you want renamings so I reupload this PR without the custom UI.

@daniel-jonathan
Copy link
Member

daniel-jonathan commented Jun 19, 2019

@StefaniOSApps thank you. We are currently working on some new tech for the community, and will add this to the queue for review and feedback, otherwise, merge it in.

@daniel-jonathan
Copy link
Member

@adamdahan @OrkhanAlikhanov what are we thinking about this issue?

@OrkhanAlikhanov
Copy link
Contributor

Hard to tell. I am for not dealing with supporting ObjC

@daniel-jonathan
Copy link
Member

I agree with @OrkhanAlikhanov. It also seems that Apple is not for dealing with it either. I would say that we can officially stop adding support for it, and in Material 4, go solely with Swift, if @adamdahan agrees.

@adamdahan
Copy link

@DanielDahan You have my blessing! The world is moving away from Objc - even though I love it :) @StefaniOSApps Perhaps you can migrate some of your view controllers to Swift one file at a time and begin the process of modernizing your application 👍

Thank you for making us aware - we appreciate it a lot :)

@inPhilly
Copy link

inPhilly commented May 21, 2020

That's too bad. Many developers that started early on and have very large projects still maintain them in objective-c. We are not vocal, but there are more than a few of us out there. I am in the process of migrating to Swift, slowly, but the controllers I need this in are still in Objective-C. It would be nice if this worked with them, and then when I migrate, I could keep using this. Now I will have to find another way. Just a suggestion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

5 participants