Re: Modernising dragging problem

2015-02-01 Thread Graham Cox

> On 1 Feb 2015, at 5:23 am, Markus Spoettl  wrote:
> 
> I did the same conversion a while back and have had no such issue. I found it 
> completely straight forward and surprisingly painless. Are you sure you're 
> implementing all the required protocols?
> 
> + In the view starting dragging NSDraggingDestination (if it wants to receive 
> something, too), also are you calling -registeringForDraggedTypes: in that 
> view
> + In you object you're calling "obj" NSPasteboardWriting
> + In the object you're calling "source" NSDraggingSource
> 
> In my implementation "obj" and "source" are the same object, but that should 
> not matter. Looking at my code, I think that's all the needs to be done.
> 


Hi Markus,

Yes, I'm conforming to all the protocols, and I'm registering for the dragged 
types - actually that pertains to receiving only, but I can drag and receive 
the same types. Temporarily turning off the registering for dragged types (so 
that the same view won't immediately start responding to the drag it started) 
doesn't fix things, so that isn't a cause of what I'm seeing.

It's most odd - nothing is logged that might give a clue. The legacy code still 
works perfectly.

--Graham



___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Allow tap events outside a custom UIPresentationController on iPad(iOS 8)

2015-02-01 Thread Mazzaroth M.
Thanks for the thoughtful response. I ended-up implementing a
UIPopoverPresentationController and I implemented -passthroughViews. It's
OK but I wish there was a way to NOT dim the views that are part of the
passthroughViews arrays. Perhaps I could file a bug/request.

The benefit to all of this is when the keyboard appears, the popover
automagically changes shape.

What I have noticed is, unless you have enough forethought to make your
UISplitViewController a child view controller of, say, a giant container
view controller from the outset of your storyboard creation, you now have
few options with respect to child view controller containment in general ..
which is too bad.

I understand this is the way Apple wants to go with all of this; a much
higher-level of consistency in terms of how view controllers behave but it
does hamper customization. It seems that either you need to make app
navigation completely custom, or live with Apple's new way of managed view
controllers(at least with respect to UISplitViewContoller).


On Sat, Jan 31, 2015 at 6:05 PM, Mike Abdullah 
wrote:

> Since iOS 8, custom presentations we write completely block events to the
> presenter. I assume Apple have done this because it’s the behaviour we’d
> mostly like. Besides, it matches Apple’s own presentations:
>
> Alerts ignore taps outside of the alert
> Action sheets treat a tap on the background area as equivalent to hitting
> cancel
> Popovers treat taps outside the the popover as a cue to dismiss
>
> There is an important exception here though: popovers offer the
> passthroughViews property, as a means to allow events through to certain
> specific views. How are Apple achieving this?
>
> I have to admit I don’t actually know. But my hunch is they’re supplying a
> custom view as part of the presentation, that fills the container. It’s job
> is to override -hitTest:event: to return one of the passthrough views if
> appropriate. That would have the desired effect of allowing events through
> to those specific views.
>
> I don’t know if that’s how it’s actually being done, or if it’s a good
> idea for you to do the same. Just a theory!
>
> > On 29 Jan 2015, at 14:15, Mazzaroth M.  wrote:
> >
> > I forgot to add the overridden methods:
> >
> > - (CGRect)frameOfPresentedViewInContainerView
> > {
> >CGRect presentedViewFrame = CGRectZero;
> >CGRect containerBounds = [[self containerView] bounds];
> >
> >presentedViewFrame.size = [self
> > sizeForChildContentContainer:(UIViewController
> *)[self
> > presentedViewController]
> >
> > withParentContainerSize:containerBounds.size];
> >
> >presentedViewFrame.origin.x = containerBounds.size.width -
> > presentedViewFrame.size.width;
> >NSLog(@"presentedViewFrame: %@",
> > NSStringFromCGRect(presentedViewFrame));
> >return presentedViewFrame;
> >
> > }
> >
> >
> > - (CGSize)sizeForChildContentContainer:(id )container
> > withParentContainerSize:(CGSize)parentSize
> > {
> >return CGSizeMake(floorf(parentSize.width / 3.0),
> >  parentSize.height);
> > }
> >
> >
> > On Wed, Jan 28, 2015 at 7:20 PM, Mazzaroth M. 
> wrote:
> >
> >> I want to have a custom `modal` appear over the Master portion of a
> >> UISplitViewController. So far, I've managed to cobble together a
> >> UIViewControllerTransitioningDelegate, a UIPresentationController
> subclass.
> >>
> >>chartSummaryNavigationController.transitioningDelegate =
> >> _transitioningDelegate;
> >>[self presentViewController:chartSummaryNavigationController
> >> animated:YES completion:NULL];
> >>
> >> in the UIPresentationViewController subclass, I override
> >>
> >> -frameOfPresentedViewInContainerView
> >>and
> >> -sizeForChildContentContainer:withParentContainerSize:
> >>
> >> so far. Just hoping to get it `working` and in
> >> -sizeForChildContentContainer:withParentContainerSize: return a smaller
> >> width than the landscape iPad. Voila, the modal does a standard
> >> presentation transition from the bottom of the screen. However, tapping
> >> anywhere around the presented modal results in no events, which is what
> I
> >> actually want. In -frameOfPresentedViewInContainerView I noticed that
> >> self.containerView.frame returns a frame the size of the entire iPad. Is
> >> that why I get no events around the presentedViewController? If so, how
> do
> >> I reduce the frame of self.containerView to match that of the presented
> >> controller?
> >>
> >> If that's not the problem, is there another way to allow tap events
> >> outside a presented view controller?
> >>
> >> Michael
> >>
> >>
> > ___
> >
> > Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
> >
> > Please do not post admin requests or moderator comments to the list.
> > Contact the moderators at cocoa-dev-admins(at)lists.apple.com
> >
> > Help/Unsubscribe/Update your Subscription:
> >
> https://lists.apple.com/mailman/options/cocoa-dev/mabdullah%40karelia.com
> >
> > This email s