0

I am a new to iOS development, and I recently came across QuickDialog. From what it seems, it creates the dialog page for you automatically.

My recent learning has taught me to use the Storyboard to create the views. I was wondering, would QuickDialog integrate with Storyboard? So say I had a login form made by quick dialog, would the login view appear on the storyboard?

Thanks!

Karan
  • 14,824
  • 24
  • 91
  • 157

2 Answers2

2

Your link seems broken. But I guess you are talking about this library?

Well, storyboard doesn't change much of the development environment. It just handles some transition between view controllers for you. So, yes, you can use QuickDialog with storyboard.

But it will not just appear in your storyboard. You need to add view controllers implemented with QuickDialog in it by yourself.

Selkie
  • 1,773
  • 1
  • 14
  • 21
1

You have to create the QRootElement when storyboard is creating the controller in initWithCoder, and if you want to use the grouped option, it has to be set there, for the rest of the options, you can set them in the viewload, apart from that it's as usual:

  1. Create a new class inheriting from QuickDialogController
  2. Add in your class implementation the following code:

    -(id) initWithCoder:(NSCoder *)aDecoder {
        if ((self = [super initWithCoder:aDecoder])) {
            QRootElement *_root = [[QRootElement alloc] init];
            _root.grouped = YES;
    
            /* Put your init code here or in viewDidLoad */
            self.root = _root;
        }
        return self;
    }
    
    - (void)viewDidLoad
    {
        [super viewDidLoad];
    
        QSection *section = [[QSection alloc] init];
        QLabelElement *label = [[QLabelElement alloc] initWithTitle:@"Hello" Value:@"world!"];
        [section addElement:label];
    
        self.root.title = @"Hello World";
        [self.root addSection:section];
    }
    
  3. Set the custom class of your storyboard UIViewController to be the one you just created

Bluedays
  • 151
  • 5