• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: iMovie-like sliding ready for drag
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: iMovie-like sliding ready for drag


  • Subject: Re: iMovie-like sliding ready for drag
  • From: SA Dev <email@hidden>
  • Date: Fri, 1 Jul 2005 16:06:15 -0400

Keith:

I was interested in this same thing for a project I had hoped to get to more than a year ago (and by the looks of things, it's still at least a good year away).

The best approach I've considered so far is to make the 'track view' responsible for the animation while dragging. That's about all the further I'd gotten because I don't have much of an animation background. The thought here is that your track view moves the 'clip' (or in your case 'card') subviews around. Assuming the cards are a uniform size (unlike iMovie's clips), you can calculate the pointer position and determine which card you're over. From there, you can figure out whether it's to the left or right of the horizontal middle of your card. If the pointer's to the left, move the current card (and all cards after it) aside. If the pointer's more to the right of the current card, just move every card after it aside. I don't know how efficient this is (not very, if you force each card view to redraw, rather than the currently-visible ones) ...

The problem *I* have is actually working out how to smoothly animate the card movement while the user hovers over the track. What happens if the animation's half-way through and the pointer moves to a new separator ... etc. I just can't get my head around it.

I agree, however. This is most certainly a Frequently Unanswered Question. < inappropriate joke >I took one look at the sheer number of times this request has gone unanswered and muttered to myself, "Aw, F.U.Q.". < /inappropriate joke >

  ;-)




On Jul 1, 2005, at 3:48 PM, Keith Blount wrote:

I didn't think I'd get much response to this given
that it's a FUQ (Frequently Unanswered Question). :) I
am thinking of giving up on this for now as it is
really just eye-candy when I should be concentrating
on functionality at this stage, but if anyone does
have any pointers, I would be really grateful. For
instance, I don't even know whether I would have to
dig into Quartz etc to achieve this, or whether I
would just set up a timer to increment the placement
of the image of the "card" over a few seconds (but
then, wouldn't this result in the spinning beach ball
as the single-thread locks up in animation?).

Any help much appreciated (but maybe I should put this
on my future list),
All the best,
Keith

--- ORIGINAL MESSAGE ---

Hello,

Having searched the archives, Cocoadev and Google, I
know that this is a question that has been frequently
asked, but I have yet to find an answer.

I have a storyboard view that contains a row of
"cards", much like the clip tray in iMovie. Like in
iMovie, whenever the user drags a card between two
other cards, I would like the cards to slide apart to
allow room for the  one that is being dropped.

Does anybody have any ideas on what the best approach
to this would be? Do I need to explore NSAnimation, or
can I set up a simple timer and just keep redrawing in
drawRect: as soon as my view detects a potential mouse
operation? I think my problem is that I don't know
where to look - I've never handled any kind of
animation in Cocoa before, so just some pointers would
be really appreciated.

Many thanks in advance,
Keith



____________________________________________________
Yahoo! Sports
Rekindle the Rivalries. Sign up for Fantasy Football
http://football.fantasysports.yahoo.com
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40silentalcove.net


This email sent to email@hidden


_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >Re: iMovie-like sliding ready for drag (From: Keith Blount <email@hidden>)

  • Prev by Date: Re: CoreData - constraint?
  • Next by Date: Re: CoreData - constraint?
  • Previous by thread: Re: iMovie-like sliding ready for drag
  • Next by thread: RE: iMovie-like sliding ready for drag
  • Index(es):
    • Date
    • Thread