UA-17470720-3

Jump to content


Photo
- - - - -

uiElement Nib for Top Level Section


  • Please log in to reply
3 replies to this topic

#1 wizgod

wizgod

    I'm what you guys call a User

  • STV 5.0 Pro
  • PipPipPipPipPipPipPip
  • 575 posts
  • LocationThe Grid
Reputation: 149
Popular

Posted 12 January 2016 - 11:38 AM

Greetings Programs!

 

I was wondering if we could get a uiElement Nib property at the top level so when we don't want to use the cell (like in the Account section) we can set the property and it will override the cell and use the nib.

 

Currently if I want to use a custom nib (like in the Activity section), I have to delete the cell and code in the action:

 

tableViewModel.sectionActions.cellForRowAtIndexPath = {
    (itemsSection, indexPath) in

    return SCCustomCell(text: nil, objectBindingsString: nil, nibName: "ActivityCell")
}

 

I prefer the lazy method if possible :D .

 

Thanks!

 

Wg

 

Attached File  Storyboard.png   360.68K   7 downloads


P.S. I love Swift... talk Swift.. Never too old school to learn yet another programming language. LOL! ;-)


#2 Tarek

Tarek

    Forum Admin

  • Administrators
  • 3670 posts
Reputation: 452
Popular

Posted 12 January 2016 - 03:10 PM

Hi Wg,

 

You mean you want an additional 'Custom Cell Xib'/'Custom Cell Class' property for SCArrayOfObjectsSection in IB?



#3 wizgod

wizgod

    I'm what you guys call a User

  • STV 5.0 Pro
  • PipPipPipPipPipPipPip
  • 575 posts
  • LocationThe Grid
Reputation: 149
Popular

Posted 12 January 2016 - 04:40 PM

Hi Tarek!

 

No, not the ones in the Property Definition which show in the detail view(s).

 

In the screenshot, I have the Array Of Objects Section highlighted in the Activities Scene; I was thinking perhaps a uiElement Nib property could be placed in the right pane along with the other Array of Objects Section properties (or any other type of Section). If the property is set then all cells in that section will use that nib (unless it's overridden in the action).

 

When you add in a section to the view controller, it also adds that one cell to modify when you change the style to Custom. I don't really want to go through the trouble of laying out that cell if I already have a nib that I can reuse; and most times I tend not to use that cell and use the cellForRowAtIndexPath action instead.

 

I just thought it would be a nice thing to have and have you add dozens of lines of code and IB integration and testing just so I don't have to add 3 lines of code ;) .

 

Wg


P.S. I love Swift... talk Swift.. Never too old school to learn yet another programming language. LOL! ;-)


#4 Tarek

Tarek

    Forum Admin

  • Administrators
  • 3670 posts
Reputation: 452
Popular

Posted 13 January 2016 - 06:42 AM

Hey Wg,

 

I'd be delighted to save you even 1 line of code :)

 

The main thing I am worried about here is user confusion. Storyboard users are used to setting up their cells right there inside the table view, and seeing an additional option of a 'Cell Class' there might confuse them into setting their cell's class there, instead of selecting their cell and setting it's class as they normally do. This would result in STV ignoring all their work and using their entered class instead.

 

Having said that, we're seriously thinking of a simple user friendly way of providing sectionActions/cellActions right from IB. All suggestions are welcome.






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users