Closed rromanchuk closed 5 years ago
Here's the entirety of legacy code, maybe i'm translating the intent incorrectly, makes it a bit harder when code you're reading isn't yours ;)
guard let dialogue = storyboard?.instantiateViewController(withIdentifier: "StartChallengeDialogueVC") else { return }
var presentation = JellySlideInPresentation()
presentation.directionShow = .bottom
presentation.directionDismiss = .bottom
presentation.widthForViewController = .custom(value: 295)
presentation.heightForViewController = .custom(value: 173)
presentation.cornerRadius = 6
presentation.presentationCurve = .easeInEaseOut
presentation.dismissCurve = .easeInEaseOut
presentation.backgroundStyle = .blur(effectStyle: .dark)
presentation.jellyness = .jelly
jellyAnimator = JellyAnimator(presentation: presentation)
jellyAnimator?.prepare(viewController: dialogue)
present(dialogue, animated: true, completion: nil)
Hi Roman, thanks for finding out that the wiki example is incorrect. I'll take care of it.
As for your code, I first noticed that you had a slide presentation back then.
Slide
became Cover
in Jelly 2.0.0
and ShiftIn
-> Slide
.
Slide just uses a Size Object because it has just one dimension of size depending on the direction. Cover takes a PresentatinSize with width and height encapsulated and will be used on fade and cover presentations.
This should represent your old presentation in Jelly 2.0 @rromanchuk
let uiConfiguration = PresentationUIConfiguration(cornerRadius: 6, backgroundStyle: .blurred(effectStyle: .dark))
let size = PresentationSize(width: .custom(value: 295), height: .custom(value: 173))
let timing = PresentationTiming(duration: .normal, presentationCurve: .easeInOut, dismissCurve: .easeInOut)
let presentation = CoverPresentation(directionShow: .bottom,
directionDismiss: .bottom,
uiConfiguration: uiConfiguration,
size: size,
timing: timing,
spring: .medium)
Attributes are your friend
@available(*, deprecated: 2.0.0, renamed: "whatever(meh:)")
@rob-nash Thanks. Thanks, I didn't know about that yet.
No worries @SebastianBoldt thanks for building this. Looks great.
Public API implications is worth reading. This YouTube rant by Rich Hickey is also great.
I'm looking forward to what you do next.
@rromanchuk Did the code help? I would close the ticket as soon as you give positive feedback ;)
Thanks! I'll get back to it today. Closing for now
Couple issues while upgrading
When running the exact example in the wiki for customizable options shown below
I had to hint to the compiler it was an options set with
I'm also not sure how to migrate old usage to new usage, for example:
The new signature of
SlidePresentation
takes a size of typeSize
whereCoverPresentation
takes a size ofPresentationSize
, so i'm not sure what to do here