Re: UINavigationBar content margins in UIPresentationController subclass

2016-12-07 Thread Daniel Stenmark
The most relevant looking bug I can find seems to involve pushing & popping view controllers. That said, setting the preferredContentSize on the navigation controller directly should always work. Setting preferredContentSize directly on the navigation controller works as expected. I’m more

Re: UINavigationBar content margins in UIPresentationController subclass

2016-12-07 Thread Daniel Stenmark
Thanks, David. Unfortunately, UINavigationController isn’t currently an option as it doesn’t reliably bubble up preferredContentSize changes, which we have a strong dependency on and is fairly dynamic in our use case. As of 10.0, it only seems to adapt and forward the very first

Re: UINavigationBar content margins in UIPresentationController subclass

2016-12-07 Thread Daniel Stenmark
ately backed by a view controller, then it won’t have the correct information to do its layout. On Nov 7, 2016, at 12:42 PM, Daniel Stenmark <dstenm...@opentable.com<mailto:dstenm...@opentable.com>> wrote: I have a UIPresentationController subclass with a UINavigationBar embedde

UINavigationBar content margins in UIPresentationController subclass

2016-12-06 Thread Daniel Stenmark
I have a UIPresentationController subclass with a UINavigationBar embedded in the container view. However, when setting the rightBarButtonItem, the spacing I usually expect from the item to the screen isn't there. http://imgur.com/LHcqhyd Anyone have an idea where I

Re: Stupid objective-c question

2016-09-21 Thread Daniel Stenmark
It’s doing a pointer comparison while making poor assumptions about how the compiler will optimize the storage of string constants. This is bad; DO NOT DO THIS. Dan > On Sep 21, 2016, at 4:44 PM, Gabriel Zachmann wrote: > > I've got a stupid, curious question regarding

Re: NSFileHandle and thread safety

2016-07-25 Thread Daniel Stenmark
> As long as each thread has a separate file handle, they’re independent of > each other, since each file handle remembers its own offset in the file. Ah, durr, you’re right. Apologies, I once had the displeasure of debugging an ancient codebase that used the same Unix file descriptor with

Re: NSFileHandle and thread safety

2016-07-25 Thread Daniel Stenmark
1. Can I write to two different files using two NSFIleHandles from two threads at the same time? Yes. 2. Can I read from a single file using two NSFileHandles on two threads at the same time? Why would you need to do that in the first place? Unless you’re reading a single byte at a time, it

Re: Ending NSTask doesn't release file handle opened by the task it wraps.

2016-07-21 Thread Daniel Stenmark
Do you have any NSPipes or NSFileHandles set on the NSTask’s I/O channels? (standardOutput, standardError, and standardInput) Dan > On Jul 21, 2016, at 8:20 AM, Graham Cox wrote: > > One of my apps uses NSTask to wrap a command line utility that is embedded in > the

Re: UIStackView: Variable Spacing

2016-07-06 Thread Daniel Stenmark
that’s just another refactoring branch I’ll have to shelve for now. Dan > On Jul 6, 2016, at 4:45 PM, Roland King <r...@rols.org> wrote: > > >> On 7 Jul 2016, at 04:37, Daniel Stenmark <dstenm...@opentable.com> wrote: >> >> What’s the best way to ac

Re: UIStackView: Variable Spacing

2016-07-06 Thread Daniel Stenmark
re.com>> wrote: On Jul 6, 2016, at 15:41 , Daniel Stenmark <dstenm...@opentable.com<mailto:dstenm...@opentable.com>> wrote: This would require my UIStackView’s children to have children of their own, which just means even more layout constraints to resolve at scroll-time. C

Re: UIStackView: Variable Spacing

2016-07-06 Thread Daniel Stenmark
ote: On Jul 6, 2016, at 13:37 , Daniel Stenmark <dstenm...@opentable.com<mailto:dstenm...@opentable.com>> wrote: What’s the best way to achieve variable spacing between children of a UIStackView? I’ve had success placing leading/trailing/top/bottom constraints on the child view,

UIStackView: Variable Spacing

2016-07-06 Thread Daniel Stenmark
What’s the best way to achieve variable spacing between children of a UIStackView? I know that a popular approach is to add an empty dummy view to act as padding, but this is being used in a UITableView cell, so scrolling performance is critical and the implicit constraints created by adding a

Re: How can I get a single threaded network call in ObjC on iOS?

2016-06-28 Thread Daniel Stenmark
I agree with Gary, but if something about your structure makes that difficult, there’s also a queue suspend/resume approach: let queue = dispatch_queue_create("", DISPATCH_QUEUE_SERIAL) dispatch_async(queue) { dispatch_suspend(queue) myFirstNetworkCall({ (let result) in

Re: Storyboard weakness

2016-03-09 Thread Daniel Stenmark
If you’re still having issues, feel free to post up and send us a GitHub link to a sample project exhibiting this behavior. Setting up a UICollectionView fairly straight-forward; something’s being overlooked here. Dan > On Mar 9, 2016, at 5:55 PM, Daniel Stenmark <dstenm...@opentab

Re: Storyboard weakness

2016-03-09 Thread Daniel Stenmark
Did you set the prototype cell’s Reusability Identifier? http://i.imgur.com/1uLxYPo.png Dan On Mar 9, 2016, at 5:29 PM, Rick Mann <rm...@latencyzero.com<mailto:rm...@latencyzero.com>> wrote: On Mar 9, 2016, at 16:05 , Daniel Stenmark <dstenm...@opentable.com<mailto:dsten

Re: Storyboard weakness

2016-03-09 Thread Daniel Stenmark
> Because I want all the benefits the specific view controller gives me, namely > the ability to build the cells right in the view. What’re you talking about? You can still build custom UICollectionView cells right into the view when using a plain old UIViewController. Dan

Re: Storyboard weakness

2016-03-09 Thread Daniel Stenmark
Why are you locking yourself into a heavily customized UICollectionViewController? Why not just use a generic UIViewController and hook up your view elements the old fashioned way? Dan > On Mar 9, 2016, at 3:04 PM, Rick Mann wrote: > > There's a severe weakness in

UINavigationController: Clean interactive transition to view controller without navigation bar?

2016-02-20 Thread Daniel Stenmark
(Already asked on StackOverflow, but might as well cover my bases here as well.) I have a view controller navigation hierarchy where only the top view controller has its navigation bar hidden. Normal pushing/popping is fine and works as expected. However, when the pop is interactive

Re: KVO question

2015-11-17 Thread Daniel Stenmark
It seems like it *should* work. Are you sure you don’t have a typo in your addObserver: method? Considering that you’re using the dictionary’s property setter, keyPathsForValuesAffecting shouldn’t even be necessary. When I apply KVO, I try to mitigate the potential unsafely of key paths

Adding first Swift file to a framework ("Umbrella header not found")

2015-11-05 Thread Daniel Stenmark
We just added the first Swift file to our internal .framework, but now the build is completely broken, with Xcode complaining “Umbrella header ‘OTCommon.h’ not found.”

[UIResponder firstResponder] stuck in infinite loop?

2015-10-22 Thread Daniel Stenmark
I’m trying to remove a contained child view controller from it’s hierarchy and present it, but it’s resulting in [UIResponder firstResponder] getting stuck in an infinite loop. - (void)menuActionButtonTapped:(id)sender { [self.menuViewController removeFromParentViewController]; [self

Re: Contained UITableViewController doesn't animate (w/ CoreAnimation) frame change

2015-10-05 Thread Daniel Stenmark
Anyone? On Oct 1, 2015, at 11:30 AM, Daniel Stenmark <dstenm...@opentable.com<mailto:dstenm...@opentable.com>> wrote: I have a rather nested UITableViewController whose AutoLayout height change I’m trying to animate using CoreAnimation. (The final product will have a custom anim

Contained UITableViewController doesn't animate (w/ CoreAnimation) frame change

2015-10-01 Thread Daniel Stenmark
I have a rather nested UITableViewController whose AutoLayout height change I’m trying to animate using CoreAnimation. (The final product will have a custom animation timing function, so the UIView animation methods aren’t an option here.) However, when I update the height constraint to a