Re: iOS AVPlayerViewController and AVPlayer Documentation/Help

2017-05-11 Thread Peter Tomaselli
Hi Dave, not at all an expert on this but I think if you want “windowed” playback on iOS you need to abandon AVPlayerViewController and instead use your “own” AVPlayer instance pointed at an arbitrary AVPlayerLayer (which some custom view of yours would host). Never done it myself but searching on

Re: Problem Playing Movie File on iOS

2017-05-09 Thread Peter Tomaselli
e wrote: > > > On 9 May 2017, at 15:41, Peter Tomaselli wrote: > > > > I don't believe you can present a view controller in viewDidLoad. I am > away from my computer, so I can't confirm right now, but I do not believe > the presenting view controller's

Re: Problem Playing Movie File on iOS

2017-05-09 Thread Peter Tomaselli
I don't believe you can present a view controller in viewDidLoad. I am away from my computer, so I can't confirm right now, but I do not believe the presenting view controller's view is in the view hierarchy yet during viewDidLoad (exactly as the error message says). On Tue, May 9, 2017 at 8:31 AM

Re: Basic Question about iOS View Controllers/Storyboards

2017-05-08 Thread Peter Tomaselli
Sounds like a great way to get started getting up to speed on the new stuff (as in, not too complex to start out with)! Awesome. I'm sure there will be a bevy of opinions on this, but I always start with “Single view application” as the template, since it gets you past the really tedious setup, bu

Re: Prioritizing drawing of the important stuff

2016-10-29 Thread Peter Tomaselli
Not at all my area of expertise, but I was going to suggest some sort of debounce-style approach as well. That is, there is somewhere an event stream that is firing off “please redraw everything” events (I think you said this was a KVO subscription) at some potentially excessive rate, right? So

Re: Dynamic-width Collection View

2016-08-10 Thread Peter Tomaselli
I definitely remember feeling like there was a bit of a mismatch between the “declarative” feel of auto layout and the more procedural feel of all the necessary collection view layout overrides and whatnot. Bridging that gap was the main reason for all the shenanigans in that code (well, that an

Re: Dynamic-width Collection View

2016-08-10 Thread Peter Tomaselli
Sorry if this is kind of a cheesy reply, but a while ago I believe we were speaking about “left-justifying” a collection view as well? I think I replied to that thread with a link to a very unattractive toy repo of mine on GitHub to illustrate the approach I’d taken with that. Anyway that repo doe

Re: Justification of collection cells in sections

2016-08-03 Thread Peter Tomaselli
I remain a non-expert on this topic, but my assumption has always been that the current “look” is by design. Ugly, but by design. “Equally distribute cells across the row” could be taken to mean that in the case of one cell, it belongs in the middle… [shrug] This is some of the first Cocoa code I

Re: Justification of collection cells in sections

2016-08-02 Thread Peter Tomaselli
I’ve been in the same situation too (wanting a “left-justified” flow layout) and the only way I am aware of to tackle it is to subclass UICollectionViewFlowLayout and tweak the frames yourself. Luckily this is not nearly as complicated as handling the whole layout yourself! Peter On Aug 2, 201

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

2016-06-28 Thread Peter Tomaselli
I have not a lot of Cocoa experience here, so I am legitimately asking this question, no snark intended: what’s the advantage to building a home-made “serial” “queue” as opposed to just using an actual serial operation queue? Haven’t you just described the first few steps one would take were one

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

2016-06-28 Thread Peter Tomaselli
In the past I’ve used NSOperation for this — wrap each request in an async NSOperation that only signals completion to its queue when its DataTask completion handler is complete. Then you can blast a bunch of them at a serial queue and they will come out serially until they are done. On Tue, Jun 2

Re: Storyboard weakness

2016-03-09 Thread Peter Tomaselli
I might be misunderstanding, but why not just use a regular UIViewController scene, throw a collection view in it, throw your other view into it too, and then conform to UICollectionViewDataSource and -Delegate “manually”? It’s a few more outlets to connect by hand but isn’t UICollectionViewCont

Re: Two Problems

2016-02-12 Thread Peter Tomaselli
You'll probably need a… what is it nowadays? “@objc”? annotation on that func? Apologies that I can't be more specific, I am on my Grim Windows Work Computer atm… On Fri, Feb 12, 2016 at 11:31 AM, Charles Jenkins wrote: > Alex, > > The suggestion of changing the graphic’s name is a terrific one.

Re: UISearchBar covers status bar

2016-02-02 Thread Peter Tomaselli
Isn't this just the thing (apologies, can't actually try it right now) where the easiest way to keep the status bar tidy when doing a modal presentation is to actually present your modal controller inside its own navigation controller, even if you don't plan on pushing anything onto it? Again, apo

Re: Subclassing/Override question

2016-01-04 Thread Peter Tomaselli
Method return types are covariant though, yes? So you should always be able to return a more-derived type from a method that is declared to return a less-derived type. If I read your example right, ClassA is "Animal" and ClassB is "Cat" (in covariance-blog-post lingo). So that is legal, unless I'm

Re: Custom time picker

2015-12-02 Thread Peter Tomaselli
One of the WWDC videos from back when collection views were introduced tackles a similar situation (a “flickable” cover-flow-ish collection view layout that centers at the end). Sorry that I can't be more specific about which video. > On Dec 2, 2015, at 7:22 PM, Eric Dolecki wrote: > > I need

Re: Self and associated type requirements (yes again!)

2015-11-30 Thread Peter Tomaselli
I have no answer here, but there is a blog post I continually refer to whenever I get confused about this. In case you haven't already read it (although I suspect you have) it is called "Swift: Associated Types" by Russ Bishop [0]. Rob Napier has also had a few nice posts about type erasure that ma

Re: Multiple simultaneous UIAlertControllers

2015-11-05 Thread Peter Tomaselli
Pretty sure the WWDC 2015 video on NSOperations tackles a similar scenario in a quite elegant way. That might be worth investigating. Peter > On Nov 5, 2015, at 6:42 PM, Carl Hoefs wrote: > > A queue of what? I would think that if only a single alert view can be > presented at a time, then iOS

Re: Can't get dynamically sized Collection View cells

2015-10-02 Thread Peter Tomaselli
[re-sending because my last message had size problems] Nifty way of demoing there, Roland, I’ll have to try that! I’d still be curious to know if anyone is using this feature “in production”. Because those crashes, problems rotating (at least for me), and also this, which I definitely ran into

Re: Can't get dynamically sized Collection View cells

2015-09-30 Thread Peter Tomaselli
erty of the flow layout. Is this a lie from a WWDC presenter? Are there a > number of other steps that aren’t documented that one needs to do? Any Apple > sample code that implements this? > > Apple experts please chime in! > > Doug Hill > >> On Sep 29, 2015, at 7:

Re: Can't get dynamically sized Collection View cells

2015-09-29 Thread Peter Tomaselli
Hi Doug! Funny you mention this, I was trying and failing to do the same thing just tonight. Thing is, I’ve done it before and have a toy implementation on GitHub[0] to prove it! Not that that was helping me just now, of course, but perhaps a link to that repo can help you out? There are addi

Re: Work with AddressBook without blocking the main thread

2015-04-25 Thread Peter Tomaselli
> showed that creating and destroying them was causing performance issues. > >> On 26 Apr 2015, at 09:51, Peter Tomaselli > <mailto:peter.tomase...@icloud.com>> wrote: >> >> Thanks for the reply. Well, now you’ve got me doubting myself. This is for >> i

Re: Work with AddressBook without blocking the main thread

2015-04-25 Thread Peter Tomaselli
like that’s maybe what is available on OS X already? But this is an iPhone app. I’ll check out the threading stuff; sounds like that might be fun to try anyway. Appreciate the help, Peter > On Apr 25, 2015, at 9:23 PM, Quincey Morris > wrote: > > On Apr 25, 2015, at 17:54 , Pet

Re: Work with AddressBook without blocking the main thread

2015-04-25 Thread Peter Tomaselli
me): is it NSThread I should look at? Appreciate it, Peter > On Apr 25, 2015, at 8:33 PM, Quincey Morris > wrote: > > On Apr 25, 2015, at 17:06 , Peter Tomaselli <mailto:peter.tomase...@icloud.com>> wrote: > >> The crux of my problem

Work with AddressBook without blocking the main thread

2015-04-25 Thread Peter Tomaselli
Hi there. I’m writing my first iPhone application and trying to figure out how to best work—asynchronously—with the AddressBook API. I’m building against iOS 8. I’m not experienced with Cocoa, but based on the docs, as well as seemingly-credible SO answers (particularly this one[0]), my underst