UA-17470720-3

Jump to content


Photo
- - - - -

How to pick a presentation for the default add view/edit details view?

view-controllers

  • Please log in to reply
3 replies to this topic

#1 RaduGrama

RaduGrama

    Jr. Member

  • STV 5.0 Pro
  • PipPip
  • 29 posts
  • LocationTampa, FL
Reputation: 6
Good

Posted 09 March 2016 - 09:52 PM

[Beginner's question most likely - apologies in advance!]

 

I have a Tab Bar Controller, then a Navigation Controller inside, and finally a SCTableViewController. Inside the SCTableViewController I have a SCArrayOfObjectsSection with the Data Definition set to a Class Definition based on a basic class called Company (derived from NSObject, contains a handful of String properties). No customization of the detail view at all.

 

On an iPad, when I add a new company I see a Page Sheet/Form Sheet:

 

Attached File  Screen Shot 2016-03-09 at 10.41.14 PM.png   37.18K   16 downloads

 

When I edit a company I see a strangely looking Full Screen/Current Context (?) view:

 

Attached File  Screen Shot 2016-03-09 at 10.40.42 PM.png   75.41K   19 downloads

 

How can I chose if I want one or the other, and how do I get the Full Screen one to actually fill the entire width of the screen? Are there any actions I need to use or can I configure this in IB? Or is this the default/expected behavior?

 

Thank you,

Radu



#2 Dave Guerin

Dave Guerin

    Forum Master

  • STV 5.0 Pro
  • PipPipPipPipPipPipPip
  • 539 posts
  • LocationIreland
Reputation: 134
Popular

Posted 10 March 2016 - 12:21 AM

Hi Radu,

 

 

The Full Screen not filling the actual entire width is an iOS 9 feature:

 

http://sensiblecocoa...row/#entry13176

 

Setting cellLayoutMarginsFollowReadableWidth to NO will make the cells in that view full width.


  • Tarek likes this
Cheers,

Dave

www.dgapps.ie

#3 RaduGrama

RaduGrama

    Jr. Member

  • STV 5.0 Pro
  • PipPip
  • 29 posts
  • LocationTampa, FL
Reputation: 6
Good

Posted 10 March 2016 - 07:19 AM

Hi Dave,
 

I had to go with the Form Sheet/Page Sheet version for the Details View as well and I had to Generate the Details View, based on my customer's end needs. So now my requirements are pretty set: Page Sheet for both Add and View Details.

 

I generated the Detail View and by default Add displays in Page Sheet, and View Details in Full Screen (without the narrow trimming any longer - not sure why that changed). I played around with the Kind and Presentation settings of the 2 segues created to the Details View, with no effect at all. Also I changed the Presentation setting of the Details View Controller with no effect al al. This is all very confusing.

 

The only thing that worked is:

 

tableViewModel.sectionAtIndex(0).detailViewControllerOptions.presentationMode = SCPresentationMode.Modal
tableViewModel.sectionAtIndex(0).detailViewControllerOptions.modalPresentationStyle = UIModalPresentationStyle.PageSheet

 

Very confusing why this works and the settings in IB do not. Also, now both the Add and Details View are popups but the Details View is wider for whatever reason.

 

I guess I'm a bit puzzled and don't know how to control all these aspects and trying to figure out if I'm doing things wrong, taking the wrong approach, etc.

 

Thank you,

Radu


  • Tarek likes this

#4 Tarek

Tarek

    Forum Admin

  • Administrators
  • 3670 posts
Reputation: 452
Popular

Posted 10 March 2016 - 10:39 AM

Hi Radu,

 

Dave was spot on here that this is an iOS 9 feature.

 

What you did by setting detailViewControllerOptions is the best way to achieve what you want. What IB settings are you trying out before? Were you setting that in the Segue properties?







Also tagged with one or more of these keywords: view-controllers

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users