UA-17470720-3

Jump to content


Photo
- - - - -

Sub-classing SCSelectionCell, SCObjectSelectionCell and SCDateCell


  • Please log in to reply
14 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 16 September 2015 - 02:49 PM

Greetings Programs!

 

I am sub-classing these cells for the layout and style so the title/label is on top and the value below (attached nib).

 

It was easy enough with the segmented cell but not sure with these.

 

Thanks!


Wg

 

Attached File  WGSelectionCell.xib.zip   1.46K   3 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 17 September 2015 - 09:05 AM

Hi Wg,

 

Keep in mind that you need to connect the value label to the cell's 'control' outlet. For an example, you can have STV generate its UI in IB using any of our samples, then check out how the selection cell was generated.



#3 wizgod

wizgod

    I'm what you guys call a User

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

Posted 17 September 2015 - 10:13 AM

Hi Tarek,

 

Here's the same app with the selection cell added. It still seems to be using the original STV cell.

 

Thanks!

 

Wg

 

Attached File  DictionaryApp.zip   61.87K   9 downloads

 

Edit:


Also, the normal and subclassed SCTextViewCell is freaking out when you type beyond the visible area and it moves the tableview up to view the text (starting on the 4th line in the app in the 5s simulator).


Edited by wizgod, 18 September 2015 - 07:04 AM.

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 22 September 2015 - 02:41 PM

Hi Wg,

 

You're right, SCSelectionCell does seem to have a glitch that ignores any custom cells. Will be fixed in our next release. Thanks!



#5 wizgod

wizgod

    I'm what you guys call a User

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

Posted 22 September 2015 - 05:59 PM

Thanks Tarek! Did you happen to check out the subclassed SCTextViewCell as well? When you type, it appears to re-position itself so that it's viewable but it jumps at every keypress.

 

Thanks!


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


#6 Tarek

Tarek

    Forum Admin

  • Administrators
  • 3670 posts
Reputation: 452
Popular

Posted 23 September 2015 - 12:49 PM

Hi Wg,

 

Yes, I apologize I missed that in your additional comments. It's a cell auto resizing while you type issue, as it seems that your custom text view cell doesn't follow the same constraints as the ones generated by STV in IB. UITableViewCell embedded UITextView dynamic resizing is very complex, so you should either:

 

a. Follow exactly the same layout as generated by the STV SCTextViewCell.

b. Disable auto resize by simply selecting your custom cell in IB and unchecking 'Auto Resize".

 

Hope this helps.



#7 wizgod

wizgod

    I'm what you guys call a User

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

Posted 23 September 2015 - 01:45 PM

Hi Tarek; that's what I did (#1). I generated a detail view in the coredata app and copied the textview cell which looked like it copied all the constraints.

 

Perhaps for this cell, a theme might be better since I don't need to add additional controls to the cell.

 

Wg


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


#8 wizgod

wizgod

    I'm what you guys call a User

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

Posted 23 September 2015 - 02:12 PM

Tarek, in that sample app I attached, if I don't use the custom cell, I will still get the issue with the STV cell; just keep pressing enter into the text field.


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


#9 Seth Vanderdrift

Seth Vanderdrift

    Advanced Member

  • STV 5.0 Pro
  • PipPipPipPipPip
  • 108 posts
Reputation: 20
Excellent

Posted 28 November 2015 - 02:08 PM

Tarek/wizGod,

 

Did the jumping SCTextViewCell ever get worked out?  I'm having that issue now.  I'm adding SCTextViewCell's via code.

I need the autoresizing.

 

I'm creating the cells with:

    SCTextViewCell *creatorEmails = [SCTextViewCell cellWithText:@"Emails" boundObject:appSettings boundPropertyName:@"creatorEmails"];

And manually adding to a manually created section.

 

Like wizgod reported, the cells jump up about 30-40 points, then immediately back down.

 

Thanks

Seth



#10 wizgod

wizgod

    I'm what you guys call a User

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

Posted 28 November 2015 - 09:49 PM

Greetings Program!

 

The issue was also being discussed in this thread and posted a workaround for it there:

 

http://sensiblecocoa...umping/?p=12911

 

Wg


  • Tarek likes this

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


#11 Seth Vanderdrift

Seth Vanderdrift

    Advanced Member

  • STV 5.0 Pro
  • PipPipPipPipPip
  • 108 posts
Reputation: 20
Excellent

Posted 29 November 2015 - 06:50 AM

wizgod,

 

THANK YOU.  The workaround makes it much better.  Still not perfect, jumps about a line or so then settles back.  Also, I have a SCTextView at the very bottom, and if you add a bunch of lines and and then delete them out, the added table footer scrolls up into view, instead of the tableview scrolling down to keep the base of the SCTextView anchored to the top of the keyboard.

 

But I can consider shipping with it like this.  Hopefully Tarek and crew will get a proper fix.  But at least I don't have to dig into the STV source code to try and fix it myself today...

 

Thanks again.

Seth



#12 Tarek

Tarek

    Forum Admin

  • Administrators
  • 3670 posts
Reputation: 452
Popular

Posted 01 December 2015 - 03:09 PM

Hey all,

 

Thank you so much for your code Wg, I'll definitely have a look now! (I haven't seen it before)



#13 Tarek

Tarek

    Forum Admin

  • Administrators
  • 3670 posts
Reputation: 452
Popular

Posted 01 December 2015 - 05:02 PM

@Wg: Do you have any idea why this isn't replicatable in our bundled TasksApp sample? I am now checking out the app you attached and couldn't figure out what you did differently.



#14 wizgod

wizgod

    I'm what you guys call a User

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

Posted 01 December 2015 - 07:51 PM

Hi Tarek!

 

Steps to recreate it in the TasksApp:

 

1. Add a third Property Group to the Task Class Definition and move the "details" property to it so the text view will be in the last cell.

3. Run in the 4s simulator so the text view is right at the bottom and start typing in the text view.

 

You'll notice the issue after the 1st line if the keyboard is present or after the 4th line if the keyboard is hidden on the simulator.

 

Wg


  • Tarek likes this

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


#15 Tarek

Tarek

    Forum Admin

  • Administrators
  • 3670 posts
Reputation: 452
Popular

Posted 05 December 2015 - 09:32 AM

Thank you so much Wg :)






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users