UICollectionView Moving

2016-03-07 Thread Luther Baker
I followed the directions here, http://nshint.io/blog/2015/07/16/uicollectionviews-now-have-easy-reordering/ - to add iOS9 style dragging to my UICollectionView - and it sort of works. As described in the article, I added a long press gesture recognizer and wired it in to make calls on the collect

Re: UICollectionView Moving

2016-03-07 Thread Luke Hiesterman
I’d check your return value for this method in your layout: - (UICollectionViewLayoutAttributes *)layoutAttributesForInteractivelyMovingItemAtIndexPath:(NSIndexPath *)indexPath withTargetPosition:(CGPoint)position NS_AVAILABLE_IOS(9_0); Luke On Mar 7, 2016, at 9:55 AM, Luther Baker mailto:lut

Re: Returning a string value from a c function to a Objective-C class method. Is there an approved approach?

2016-03-07 Thread Alex Zavatone
Just a formal note: You guys are awesome. THANK YOU. I've got a .m file that serves as a C and Objective-C layer (glue layer?) to the library methods. In it, I have one id that is the reference back to the object itself. Each static C function that returns data, constructs an Objective-C frie

Re: UICollectionView Moving

2016-03-07 Thread Luther Baker
Thanks Luke! That was it - I can drag and drop successfully now. One more question, how do I modify a property of the item I'm dragging around if the property is NOT currently in UICollectionViewLayoutAttributes ... I don't see a call to the datasource or delegate when I select the cell for moving

Re: State Restoration thinks all my windows closes prior to quit

2016-03-07 Thread Daryle Walker
On Mar 5, 2016, at 12:11 PM, Quincey Morris wrote: > > On Mar 5, 2016, at 01:36 , Daryle Walker > wrote: >> >> Default project Xcode 7 with OS X Cocoa app, with Storyboards but without >> Core Data nor Documents. Somewhere I messed up and State Restoration stopped >>

Re: State Restoration thinks all my windows closes prior to quit

2016-03-07 Thread Quincey Morris
On Mar 5, 2016, at 01:36 , Daryle Walker wrote: > > The “applicationOpenUntitledFile:” and “newDocument:” methods call this > method. On Mar 7, 2016, at 12:30 , Daryle Walker wrote: > > I haven’t set any restoration class. But that wasn’t a problem before; > Apple’s default code worked just

Re: UICollectionView Moving

2016-03-07 Thread Luke Hiesterman
You can create your own subclass of UICollectionViewLayoutAttributes and add something like an “isMoving” property to that. Then teach your cell classes to respond to that property by changing the background color. Luke On Mar 7, 2016, at 11:44 AM, Luther Baker mailto:lutherba...@gmail.com>> w

Re: UICollectionView Moving

2016-03-07 Thread Luther Baker
> teach your cell classes to respond to that property Want to think about this out loud. Wondering what would 'trigger' a lookup on the layout's layoutAttributesForItemAtIndexPath ... and where would I store the indexPath I am dragging around. If I were to be more literal - in my view controller,

Re: UICollectionView Moving

2016-03-07 Thread Luke Hiesterman
By teaching a cell to respond to an attribute I merely meant that it should override setLayoutAttributes: and do something in there with the relevant property. Hope that helps. Luke On Mar 7, 2016, at 9:39 PM, Luther Baker mailto:lutherba...@gmail.com>> wrote: > teach your cell classes to res

Re: UICollectionView Moving

2016-03-07 Thread Luther Baker
Now we're cooking with GAS!!! override func applyLayoutAttributes(layoutAttributes: UICollectionViewLayoutAttributes) { print("apply layout attributes!: \(titleLabel.text)") } Thanks Man! -Luther On Mon, Mar 7, 2016 at 11:54 PM, Luke Hiesterman wrote: > By teaching a cell to resp