CosmicMind / Motion

A library used to create beautiful animations and transitions for iOS.

Home Page:http://cosmicmind.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

can not set motionNavigationTransitionType in objc

StefaniOSApps opened this issue · comments

how to set motionNavigationTransitionType in objc?

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

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

could you add @objc support? thx.

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?

@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)

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.

@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!

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

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)

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.

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

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

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.

@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.

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

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

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.

@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 :)

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.