Code Monkey home page Code Monkey logo

Comments (11)

CooperRS avatar CooperRS commented on July 21, 2024

The latest git HEAD now contains a universal demo project. Could you please give it a try? If it works, you can close the ticket :)

from rmdateselectionviewcontroller.

sedwo avatar sedwo commented on July 21, 2024

So a few things to report:

  1. The project requires XCode 6 (still in Beta). And my work is still in XCode 5, so I can't truly run your example. Hence I'm using branch v1.3.x
  2. Looking at your example, I ported the single line of code to try it.
        if (IS_IPAD())
        {
            [dateSelectionVC showFromViewController:self.navigationController
                               withSelectionHandler:^(RMDateSelectionViewController *vc, NSDate *aDate)
             {
                 NSLog(@"Successfully selected date: %@ (With block)", aDate);

             } andCancelHandler:^(RMDateSelectionViewController *vc)
             {
                 NSLog(@"Date selection was canceled (with block)");
             }];

        }

Which resulted in the attached image.

rmdateselectionviewcontroller_ipad

  1. I did get it working (without blocks though) within a UIPopoverController, but for some strange reason cannot get it centered properly within the popover content. It also seems to frame itself larger in height.

rmdateselectionviewcontroller_offcenter

from rmdateselectionviewcontroller.

CooperRS avatar CooperRS commented on July 21, 2024

Ah, now I actually get what you expected!

At the moment my demo project opens a popover with the iPhone demo project content in it. From there you can select open date selection view controller and the result looks like follows:

bildschirmfoto 2014-08-22 um 11 11 41

That's not want you expected. What you expected is that RMDateSelectionViewController opens a popover itself and then displays itself in this popover, right? Well, that's a use case I did not have in mind so far. If I find some spare time in the next days, I'll see what I can do ;)

from rmdateselectionviewcontroller.

sedwo avatar sedwo commented on July 21, 2024

If RMDateSelectionViewController handled the popover itself and then displayed itself in this popover then that would surpass my expectations. :)

My initial thought is needing to put it into a popover:

        self.pickerPopover = [[UIPopoverController alloc] initWithContentViewController:self.dateSelectionVC];

        if (self.pickerPopover)
        {
            CGRect cellFrame = CGRectMake(self.frame.origin.x,
                                          self.frame.origin.y,
                                          self.frame.size.width,
                                          self.frame.size.height/2);    // position arrow within the cell middle.


            [self.pickerPopover presentPopoverFromRect:cellFrame
                                                inView:self.expandableTableView
                              permittedArrowDirections:UIPopoverArrowDirectionAny
                                              animated:YES];

But wanting to use its blocks too. But I couldn't figure out a way to do that using your showFromViewController: method. So I gave up on it.

Still, if RMDateSelectionViewController wants to handle the popover itself, then I won't mind. 👍

from rmdateselectionviewcontroller.

sedwo avatar sedwo commented on July 21, 2024

P.S. could it still kindly support XCode 5?
I don't intend to switch to XCode 6 until it comes out of beta. :|

FYI: I'm also not currently using AutoLayout. (I know, shocker!) will that break this control

from rmdateselectionviewcontroller.

CooperRS avatar CooperRS commented on July 21, 2024

Well Xcode 6 is needed because some features (like blur effects) are only available on iOS 8 SDK. As iOS 7 is supported at runtime and I did not want to use some nasty macros, I thought it would be fine to require iOS 8 SDK at compilation time. I'll take a look at it, but no promises ;)

from rmdateselectionviewcontroller.

sedwo avatar sedwo commented on July 21, 2024

Thank you. :)

I'll be at XCode 6 in most likely a few weeks anyways.

from rmdateselectionviewcontroller.

CooperRS avatar CooperRS commented on July 21, 2024

Little update from me: The git HEAD now contains an update for RMDateSelectionViewController that supports showing the date picker within a popover :). Looks like follows:

bildschirmfoto 2014-09-01 um 22 54 10

Unfortunately, it still needs iOS 8 SDK. I would appreciate if you could test the git HEAD as soon as Xcode 6 gets final ;).

As AutoLayout can be enabled and disabled on a per-view basis, the control should still work on non-AutoLayout apps. Let me know, if you encounter any problems!

from rmdateselectionviewcontroller.

sedwo avatar sedwo commented on July 21, 2024

Splendid and thank you. :)

I'll test it as soon as XCode 6 goes GM with iOS 8 shortly.

from rmdateselectionviewcontroller.

CooperRS avatar CooperRS commented on July 21, 2024

Did you have any chance to test the popover support for with iOS 8 GM and Xcode 6 GM?

from rmdateselectionviewcontroller.

sedwo avatar sedwo commented on July 21, 2024

Seems much better thank you. :)

from rmdateselectionviewcontroller.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.