Re: Best way to put a fixed view in a UITableViewController scene?

2013-11-27 Thread Rick Mann

On Nov 27, 2013, at 01:37 , Ray Raphaël  wrote:

> I do the following, the property *tableView in UITableViewController is not 
> backed by a _tableView instance variable, so I synthesize that (@synthesize 
> tableView = _tableView;) and then in viewDidLoad:
> 
> if (!_tableView && [self.view isKindOfClass:[UITableView class]]) 
> self.tableView = (UITableView *)self.view;
> self.view = [[[UIView alloc] initWithFrame:[UIScreen 
> mainScreen].applicationFrame] autorelease];
> self.tableView.frame = self.view.bounds;
> [self.view addSubview:self.tableView];
> 
> Then add whatever fixed view to self.view.

Yeah, that's what I used to do. But in this era of autolayout, I can't make it 
work any more.

> Better maybe is adding a view to self.tableView and then offset the view 
> while scrolling, as described in the WWDC 2011 Session 125...

I've been experimenting with this approach. You can drop a tableHeaderView into 
the view in IB, and I've been offsetting that. Got it all pretty much working, 
but I'm not sure I can slide-hide/show with animation in that approach. Maybe a 
view that's NOT the tableViewHeader will work a bit better. iOS 7 complicates 
things by having the table view up under the top bar, which requires an extra 
scroll offset that doesn't get set until sometime well after viewDidLoad.

-- 
Rick





signature.asc
Description: Message signed with OpenPGP using GPGMail
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Best way to put a fixed view in a UITableViewController scene?

2013-11-27 Thread Ray Raphaël
I do the following, the property *tableView in UITableViewController is not 
backed by a _tableView instance variable, so I synthesize that (@synthesize 
tableView = _tableView;) and then in viewDidLoad:

if (!_tableView && [self.view isKindOfClass:[UITableView class]]) 
self.tableView = (UITableView *)self.view;
self.view = [[[UIView alloc] initWithFrame:[UIScreen 
mainScreen].applicationFrame] autorelease];
self.tableView.frame = self.view.bounds;
[self.view addSubview:self.tableView];

Then add whatever fixed view to self.view.

Better maybe is adding a view to self.tableView and then offset the view while 
scrolling, as described in the WWDC 2011 Session 125...

HTH


On Nov 27, 2013, at 10:14 AM, Rick Mann  wrote:

> Multiple sections.
> 
> -- 
> Rick
> 
> 
>> On Nov 27, 2013, at 1:03, Diederik Meijer | Ten Horses 
>>  wrote:
>> 
>> Not if your UITableView has only one section and you use the section's 
>> header view in the way Marcelo suggests. Sections headers scroll up to the 
>> top and then remain there - visible - while additional cells scroll 
>> underneath it…





___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Best way to put a fixed view in a UITableViewController scene?

2013-11-27 Thread Rick Mann
Multiple sections.

-- 
Rick


> On Nov 27, 2013, at 1:03, Diederik Meijer | Ten Horses 
>  wrote:
> 
> Not if your UITableView has only one section and you use the section's header 
> view in the way Marcelo suggests. Sections headers scroll up to the top and 
> then remain there - visible - while additional cells scroll underneath it…
> 
> 
> 
> 
>> Op Nov 27, 2013, om 4:30 AM heeft Rick Mann  het 
>> volgende geschreven:
>> 
>> 
>>> On Nov 26, 2013, at 19:18 , Marcelo Alves  wrote:
>>> 
>>> Probably I’m missing something or I’m just naïve (or stupid), but what 
>>> about the tableHeaderView (or tableFooterView) property? (not the same as 
>>> section headers)
>> 
>> It scrolls with the table content.
>> 
>> -- 
>> Rick
>> 
>> 
>> 
>> ___
>> 
>> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
>> 
>> Please do not post admin requests or moderator comments to the list.
>> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>> 
>> Help/Unsubscribe/Update your Subscription:
>> https://lists.apple.com/mailman/options/cocoa-dev/diederik%40tenhorses.com
>> 
>> This email sent to diede...@tenhorses.com
> 

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Best way to put a fixed view in a UITableViewController scene?

2013-11-27 Thread Diederik Meijer | Ten Horses
Not if your UITableView has only one section and you use the section's header 
view in the way Marcelo suggests. Sections headers scroll up to the top and 
then remain there - visible - while additional cells scroll underneath it…




Op Nov 27, 2013, om 4:30 AM heeft Rick Mann  het 
volgende geschreven:

> 
> On Nov 26, 2013, at 19:18 , Marcelo Alves  wrote:
> 
>> Probably I’m missing something or I’m just naïve (or stupid), but what about 
>> the tableHeaderView (or tableFooterView) property? (not the same as section 
>> headers)
> 
> It scrolls with the table content.
> 
> -- 
> Rick
> 
> 
> 
> ___
> 
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
> 
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
> 
> Help/Unsubscribe/Update your Subscription:
> https://lists.apple.com/mailman/options/cocoa-dev/diederik%40tenhorses.com
> 
> This email sent to diede...@tenhorses.com


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Best way to put a fixed view in a UITableViewController scene?

2013-11-26 Thread Kyle Sluder
> On Nov 26, 2013, at 6:06 PM, Rick Mann  wrote:
> 
> Augh, it's even worse than I thought. The embedded view controller doesn't 
> get to set the navigation bar's items from IB. This is a terrible solution.
> 

Yeah, this is getting more and more tedious.

My guess is there's a lot of code out there that relies on UITVC.view pointing 
at the table view. You'll notice they did not repeat that mistake with 
UICollectionViewController. But even if they were to divorce the view and 
tableView properties, you shouldn’t muck with the internal layout of a view 
controller’s view hierarchy unless explicitly documented.

Perhaps your best bet at this point is to ditch UITVC and static cells 
altogether, and file a set of radars asking for 1) static cell support for 
non-UITVC-controlled table views, 2) separation of UITVC.view from 
UITVC.tableView, 3) explicit permission override -[UITVC 
viewWillLayoutSubviews] to do custom layout without calling super.

My mantra is that storyboards are the bindings of iOS. They get you 80% of the 
way to covering 80% of use cases; but if you fall off the golden path, you get 
to backtrack all the way.

--Kyle Sluder
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Best way to put a fixed view in a UITableViewController scene?

2013-11-26 Thread Rick Mann

On Nov 26, 2013, at 19:18 , Marcelo Alves  wrote:

> Probably I’m missing something or I’m just naïve (or stupid), but what about 
> the tableHeaderView (or tableFooterView) property? (not the same as section 
> headers)

It scrolls with the table content.

-- 
Rick





signature.asc
Description: Message signed with OpenPGP using GPGMail
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Best way to put a fixed view in a UITableViewController scene?

2013-11-26 Thread Marcelo Alves

> Dynamically at runtime, I'd like to put a fixed banner across the top of a 
> UITableViewController scene with some status information. I want this banner 
> to remain fixed at the top, and for the UITableView to live in a frame below 
> it.
> 

Probably I’m missing something or I’m just naïve (or stupid), but what about 
the tableHeaderView (or tableFooterView) property? (not the same as section 
headers)

:: marcelo.alves
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Best way to put a fixed view in a UITableViewController scene?

2013-11-26 Thread Rick Mann
Augh, it's even worse than I thought. The embedded view controller doesn't get 
to set the navigation bar's items from IB. This is a terrible solution.

On Nov 26, 2013, at 11:32 , Rick Mann  wrote:

> 
> On Nov 26, 2013, at 08:12 , Luther Baker  wrote:
> 
>> For the most part, UITVC is a convenience view controller. If it doesn't 
>> work out of the box, not hard to roll your own and get the behavior you are 
>> looking for ... Even still with Xibs.
> 
> Unfortunately, this does not work if you want to use static table content. 
> You can wire it up in IB, but the table calls the data source methods and 
> fails (UITVC implements the necessary methods to handle the static content).
> 
> If you try to subclass UITVC, then it complains its view is not a UITableView 
> (obviously).
> 
> -- 
> Rick
> 
> 
> 
> ___
> 
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
> 
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
> 
> Help/Unsubscribe/Update your Subscription:
> https://lists.apple.com/mailman/options/cocoa-dev/rmann%40latencyzero.com
> 
> This email sent to rm...@latencyzero.com


-- 
Rick





signature.asc
Description: Message signed with OpenPGP using GPGMail
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Best way to put a fixed view in a UITableViewController scene?

2013-11-26 Thread Rick Mann

On Nov 25, 2013, at 21:16 , Luther Baker  wrote:

> Does the UITableViewController provide something more I'm not seeing?

Yes. Support for static (and probably dynamic) cells.

I'm implementing this using view controller containment, but it's 
extraordinarily cumbersome. First, the non-scrolling view I want to display is 
fairly tightly coupled to the state of the content of the table view.

Second, in one place I have a push segue from a dynamic table view cell to this 
container. In that push, I want to set a model object on the embedded TVC, but 
I can't get at it (the container's childViewControllers is empty at the time of 
the push).

All this because UITVC insists that its table view also be its root view, and 
there's no good reason for that.

-- 
Rick





signature.asc
Description: Message signed with OpenPGP using GPGMail
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Best way to put a fixed view in a UITableViewController scene?

2013-11-26 Thread Rick Mann

On Nov 26, 2013, at 08:12 , Luther Baker  wrote:

> For the most part, UITVC is a convenience view controller. If it doesn't work 
> out of the box, not hard to roll your own and get the behavior you are 
> looking for ... Even still with Xibs.

Unfortunately, this does not work if you want to use static table content. You 
can wire it up in IB, but the table calls the data source methods and fails 
(UITVC implements the necessary methods to handle the static content).

If you try to subclass UITVC, then it complains its view is not a UITableView 
(obviously).

-- 
Rick





signature.asc
Description: Message signed with OpenPGP using GPGMail
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Best way to put a fixed view in a UITableViewController scene?

2013-11-26 Thread Luther Baker
Right, that seems obviously like fighting the SDK.

My suggestion is around rolling your own. IE, I would wire up and drop a 
"UITableView" on a parent view controller, I wouldn't drop a 
"UITableViewController" on a parent.

For the most part, UITVC is a convenience view controller. If it doesn't work 
out of the box, not hard to roll your own and get the behavior you are looking 
for ... Even still with Xibs.

On Nov 26, 2013, at 12:53 AM, Rick Mann  wrote:

> 
> On Nov 25, 2013, at 21:11 , Luther Baker  wrote:
> 
>> Maybe I am missing something - but I just created a new Tab based project
>> and dropped a UITableView directly on the FirstViewController, under the
>> "View" node in the expanding tree. If I right click on the UITableView, I
>> see both the delegate and datasource outlets. I can click them and easily
>> drag/connect to the parent "First View Controller."
>> 
>> Do you mean something else?
> 
> You can't put a UITableViewController into a Container View, and link from 
> the UITVC back to the containing view controller.
> 
> -- 
> Rick
> 
> 
> 

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Best way to put a fixed view in a UITableViewController scene?

2013-11-26 Thread Fritz Anderson
On 26 Nov 2013, at 12:53 AM, Rick Mann  wrote:

> On Nov 25, 2013, at 21:11 , Luther Baker  wrote:
> 
>> Maybe I am missing something - but I just created a new Tab based project
>> and dropped a UITableView directly on the FirstViewController, under the
>> "View" node in the expanding tree. If I right click on the UITableView, I
>> see both the delegate and datasource outlets. I can click them and easily
>> drag/connect to the parent "First View Controller."
>> 
>> Do you mean something else?
> 
> You can't put a UITableViewController into a Container View, and link from 
> the UITVC back to the containing view controller.

Sure you can (if I understand you correctly). The containment segue has an 
identifier, and you can capture the .destinationViewController in 
-prepareForSegue:sender:. Bear in mind that no other NIB loading has been done 
at that point.

— F


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Best way to put a fixed view in a UITableViewController scene?

2013-11-25 Thread Rick Mann

On Nov 25, 2013, at 21:11 , Luther Baker  wrote:

> Maybe I am missing something - but I just created a new Tab based project
> and dropped a UITableView directly on the FirstViewController, under the
> "View" node in the expanding tree. If I right click on the UITableView, I
> see both the delegate and datasource outlets. I can click them and easily
> drag/connect to the parent "First View Controller."
> 
> Do you mean something else?

You can't put a UITableViewController into a Container View, and link from the 
UITVC back to the containing view controller.

-- 
Rick





signature.asc
Description: Message signed with OpenPGP using GPGMail
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Best way to put a fixed view in a UITableViewController scene?

2013-11-25 Thread Luther Baker
Yes, thanks for inserting the "not".

If I drop a UITableView on an existing UIViewController in the default
storyboard for a new Tab based application, I can click on the UITableView
and select from "static cells" or "dynamic content" in the TableView
content section in the right hand Utilities pane.

Does the UITableViewController provide something more I'm not seeing?



On Mon, Nov 25, 2013 at 8:43 PM, Rick Mann  wrote:

>
> On Nov 25, 2013, at 18:40 , Luther Baker  wrote:
>
> > UITableViewController is convenient but at all necessary.
>
> Is there a missing "not" in there?
>
> It's necessary if you want to use the static and dynamic cell creation
> stuff in IB.
>
> --
> Rick
>
>
>
>
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Best way to put a fixed view in a UITableViewController scene?

2013-11-25 Thread Luther Baker
Maybe I am missing something - but I just created a new Tab based project
and dropped a UITableView directly on the FirstViewController, under the
"View" node in the expanding tree. If I right click on the UITableView, I
see both the delegate and datasource outlets. I can click them and easily
drag/connect to the parent "First View Controller."

Do you mean something else?


On Mon, Nov 25, 2013 at 8:48 PM, Rick Mann  wrote:

> I'm not convinced this is the best way. I can't drag-connect the table
> view controller's delegate and dataSource in IB when it's done this way.
>
> On Nov 25, 2013, at 18:40 , Luther Baker  wrote:
>
> > Dropping a UITableView inside of a UIViewController that conforms to the
> tableview's delegate and datasource is literally as easy as it sounds ...
> and immensely more flexible.
> >
> > UITableViewController is convenient but at all necessary.
> >
> > On Nov 25, 2013, at 8:16 PM, Kyle Sluder  wrote:
> >
> >>> On Nov 25, 2013, at 6:08 PM, Rick Mann  wrote:
> >>>
> >>> Dynamically at runtime, I'd like to put a fixed banner across the top
> of a UITableViewController scene with some status information. I want this
> banner to remain fixed at the top, and for the UITableView to live in a
> frame below it.
> >>>
> >>> IB doesn't let you construct this. I wrote this as a bug/enhancement
> request, and it came back that I should embed a sub view controller in it.
> But this is incredibly cumbersome, as it forces me to create another view
> controller to contain it.
> >>
> >> Except that’s precisely what UIViewController expects.
> >>
> >> Let’s say you have a navigation controller. It is in charge of
> positioning its child view controllers’ views. You can’t intervene and say
> “sorry nav controller, but that table view should be 40pt below where you
> want to put it.” That’s not how view controller containment works.
> >>
> >>>
> >>> What do you guys suggest?
> >>
> >> Use an custom container view controller, and watch the WWDC videos on
> view controller containment to learn why this is the right thing to do.
> >>
> >> --Kyle Sluder
> >> ___
> >>
> >> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
> >>
> >> Please do not post admin requests or moderator comments to the list.
> >> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
> >>
> >> Help/Unsubscribe/Update your Subscription:
> >>
> https://lists.apple.com/mailman/options/cocoa-dev/lutherbaker%40gmail.com
> >>
> >> This email sent to lutherba...@gmail.com
>
>
> --
> Rick
>
>
>
>
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Best way to put a fixed view in a UITableViewController scene?

2013-11-25 Thread Kyle Sluder
> On Nov 25, 2013, at 6:51 PM, Rick Mann  wrote:

> 
> 
>> On Nov 25, 2013, at 18:48 , Kyle Sluder  wrote:
>> 
>> Sure, you could, but why? Then your container VC has to reach in to your 
>> table view controller and point its table view at itself.
>> 
>> Why not just do the sensible thing and make the container VC responsible for 
>> managing the bar and positioning of the table view relative to it, leaving 
>> the management of the table view itself to the child table view controller?
>> 
>> If you have other objects that need to access the table view controller, it 
>> is not hard to expose it as a public property of your container VC.
> 
> So, I have basically one property that needs to be reflected at the top of 
> the table. You're saying it's best to make a whole, separate view controller 
> just to do this?

If you want to use UITableViewController, yes. Which, as you mentioned, is the 
only way to get static cell support in a storyboard.

> This doesn't seem useful at all, especially since in days of old I could 
> easily make a view controller that controlled a view, and manage a table view 
> as one of the many subviews within that.

You can still do that if you like. My suggestions held the assumption that you 
wanted to continue using UITVC.

--Kyle Sluder

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Best way to put a fixed view in a UITableViewController scene?

2013-11-25 Thread Rick Mann

On Nov 25, 2013, at 18:48 , Kyle Sluder  wrote:

> Sure, you could, but why? Then your container VC has to reach in to your 
> table view controller and point its table view at itself.
> 
> Why not just do the sensible thing and make the container VC responsible for 
> managing the bar and positioning of the table view relative to it, leaving 
> the management of the table view itself to the child table view controller?
> 
> If you have other objects that need to access the table view controller, it 
> is not hard to expose it as a public property of your container VC.

So, I have basically one property that needs to be reflected at the top of the 
table. You're saying it's best to make a whole, separate view controller just 
to do this? This doesn't seem useful at all, especially since in days of old I 
could easily make a view controller that controlled a view, and manage a table 
view as one of the many subviews within that.

And, I've done it as I described, by ensuring self.tableView always returned 
the table view, and self.view returned the containing view.

-- 
Rick





signature.asc
Description: Message signed with OpenPGP using GPGMail
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Best way to put a fixed view in a UITableViewController scene?

2013-11-25 Thread Rick Mann
I'm not convinced this is the best way. I can't drag-connect the table view 
controller's delegate and dataSource in IB when it's done this way.

On Nov 25, 2013, at 18:40 , Luther Baker  wrote:

> Dropping a UITableView inside of a UIViewController that conforms to the 
> tableview's delegate and datasource is literally as easy as it sounds ... and 
> immensely more flexible.
> 
> UITableViewController is convenient but at all necessary.
> 
> On Nov 25, 2013, at 8:16 PM, Kyle Sluder  wrote:
> 
>>> On Nov 25, 2013, at 6:08 PM, Rick Mann  wrote:
>>> 
>>> Dynamically at runtime, I'd like to put a fixed banner across the top of a 
>>> UITableViewController scene with some status information. I want this 
>>> banner to remain fixed at the top, and for the UITableView to live in a 
>>> frame below it.
>>> 
>>> IB doesn't let you construct this. I wrote this as a bug/enhancement 
>>> request, and it came back that I should embed a sub view controller in it. 
>>> But this is incredibly cumbersome, as it forces me to create another view 
>>> controller to contain it.
>> 
>> Except that’s precisely what UIViewController expects.
>> 
>> Let’s say you have a navigation controller. It is in charge of positioning 
>> its child view controllers’ views. You can’t intervene and say “sorry nav 
>> controller, but that table view should be 40pt below where you want to put 
>> it.” That’s not how view controller containment works.
>> 
>>> 
>>> What do you guys suggest?
>> 
>> Use an custom container view controller, and watch the WWDC videos on view 
>> controller containment to learn why this is the right thing to do.
>> 
>> --Kyle Sluder
>> ___
>> 
>> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
>> 
>> Please do not post admin requests or moderator comments to the list.
>> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>> 
>> Help/Unsubscribe/Update your Subscription:
>> https://lists.apple.com/mailman/options/cocoa-dev/lutherbaker%40gmail.com
>> 
>> This email sent to lutherba...@gmail.com


-- 
Rick





signature.asc
Description: Message signed with OpenPGP using GPGMail
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Best way to put a fixed view in a UITableViewController scene?

2013-11-25 Thread Kyle Sluder
> On Nov 25, 2013, at 6:33 PM, Rick Mann  wrote:

> 
> 
>> On Nov 25, 2013, at 18:16 , Kyle Sluder  wrote:
>> 
>> Use an custom container view controller, and watch the WWDC videos on view 
>> controller containment to learn why this is the right thing to do.
> 
> Can I put an unsubclasses UITableViewController in there, and let my 
> container VC be the dataSource and delegate?

Sure, you could, but why? Then your container VC has to reach in to your table 
view controller and point its table view at itself.

Why not just do the sensible thing and make the container VC responsible for 
managing the bar and positioning of the table view relative to it, leaving the 
management of the table view itself to the child table view controller?

If you have other objects that need to access the table view controller, it is 
not hard to expose it as a public property of your container VC.

--Kyle Sluder
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Best way to put a fixed view in a UITableViewController scene?

2013-11-25 Thread Rick Mann

On Nov 25, 2013, at 18:40 , Luther Baker  wrote:

> UITableViewController is convenient but at all necessary.

Is there a missing "not" in there?

It's necessary if you want to use the static and dynamic cell creation stuff in 
IB.

-- 
Rick





signature.asc
Description: Message signed with OpenPGP using GPGMail
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Best way to put a fixed view in a UITableViewController scene?

2013-11-25 Thread Luther Baker
Dropping a UITableView inside of a UIViewController that conforms to the 
tableview's delegate and datasource is literally as easy as it sounds ... and 
immensely more flexible.

UITableViewController is convenient but at all necessary.

On Nov 25, 2013, at 8:16 PM, Kyle Sluder  wrote:

>> On Nov 25, 2013, at 6:08 PM, Rick Mann  wrote:
>> 
>> Dynamically at runtime, I'd like to put a fixed banner across the top of a 
>> UITableViewController scene with some status information. I want this banner 
>> to remain fixed at the top, and for the UITableView to live in a frame below 
>> it.
>> 
>> IB doesn't let you construct this. I wrote this as a bug/enhancement 
>> request, and it came back that I should embed a sub view controller in it. 
>> But this is incredibly cumbersome, as it forces me to create another view 
>> controller to contain it.
> 
> Except that’s precisely what UIViewController expects.
> 
> Let’s say you have a navigation controller. It is in charge of positioning 
> its child view controllers’ views. You can’t intervene and say “sorry nav 
> controller, but that table view should be 40pt below where you want to put 
> it.” That’s not how view controller containment works.
> 
>> 
>> What do you guys suggest?
> 
> Use an custom container view controller, and watch the WWDC videos on view 
> controller containment to learn why this is the right thing to do.
> 
> --Kyle Sluder
> ___
> 
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
> 
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
> 
> Help/Unsubscribe/Update your Subscription:
> https://lists.apple.com/mailman/options/cocoa-dev/lutherbaker%40gmail.com
> 
> This email sent to lutherba...@gmail.com

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Best way to put a fixed view in a UITableViewController scene?

2013-11-25 Thread Rick Mann

On Nov 25, 2013, at 18:16 , Kyle Sluder  wrote:

> Use an custom container view controller, and watch the WWDC videos on view 
> controller containment to learn why this is the right thing to do.

Can I put an unsubclasses UITableViewController in there, and let my container 
VC be the dataSource and delegate?

-- 
Rick





signature.asc
Description: Message signed with OpenPGP using GPGMail
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Best way to put a fixed view in a UITableViewController scene?

2013-11-25 Thread Kyle Sluder
> On Nov 25, 2013, at 6:08 PM, Rick Mann  wrote:
> 
> Dynamically at runtime, I'd like to put a fixed banner across the top of a 
> UITableViewController scene with some status information. I want this banner 
> to remain fixed at the top, and for the UITableView to live in a frame below 
> it.
> 
> IB doesn't let you construct this. I wrote this as a bug/enhancement request, 
> and it came back that I should embed a sub view controller in it. But this is 
> incredibly cumbersome, as it forces me to create another view controller to 
> contain it.

Except that’s precisely what UIViewController expects.

Let’s say you have a navigation controller. It is in charge of positioning its 
child view controllers’ views. You can’t intervene and say “sorry nav 
controller, but that table view should be 40pt below where you want to put it.” 
That’s not how view controller containment works.

> 
> What do you guys suggest?
> 

Use an custom container view controller, and watch the WWDC videos on view 
controller containment to learn why this is the right thing to do.

--Kyle Sluder
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Best way to put a fixed view in a UITableViewController scene?

2013-11-25 Thread Rick Mann
Dynamically at runtime, I'd like to put a fixed banner across the top of a 
UITableViewController scene with some status information. I want this banner to 
remain fixed at the top, and for the UITableView to live in a frame below it.

IB doesn't let you construct this. I wrote this as a bug/enhancement request, 
and it came back that I should embed a sub view controller in it. But this is 
incredibly cumbersome, as it forces me to create another view controller to 
contain it.

In the past, at run time (during view instantiation), I've inserted a container 
view as a parent of my UITableView, and pulled some shenanigans to trick the 
UITableViewController parent class to refer to the table view while my 
controller subclass's view property points to the top-level view. This has 
worked, but I don't like doing end-runs around iOS like that.

I could possibly do something with autolayout constraints and and offsets to 
put my banner view inside my table view, but that seems inelegant, too.

What do you guys suggest?

-- 
Rick





signature.asc
Description: Message signed with OpenPGP using GPGMail
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com