Gerty tells Edy Boardman to catch it while it’s flying, implying that Edy is too slow to have realised what is going on around her: time has passed and the moment has gone. It wasn’t a “ladylike” thing to say, which perhaps explains why documentary evidence for the expression before Joyce is quite hard to find. It seems, however, that he alighted upon a printed example in late 1919 or early 1920, as he listed the phrase in one of his notesheets for the Nausicaa episode.1
The expression had been in use for at least forty years by this time. In 1880 Peter Cobden wrote a short story called “An Angel in a Garret” for the New York Independent. It was widely syndicated, and the text is cited below from the Milan Exchange (Milan, Tennessee) on 25 March of that year. John Claverhouse laments the collapse of the stock market. His aunt Prilly has just dropped by:
"Thank you, Mr. John, for letting me know that my time for getting hold of some of that money of yours is short," replied Aunt Prilly […] "I’m glad I happened in this afternoon, to catch it while it’s flying. I want all I can get of it for my poor people in Water Street."
It is not clear from the context whether the expression is Irish American, though Water Street in south Manhattan was an area populated by many Irish and Italian immigrants.
Later nineteenth-century examples are predominantly American and in the context of commercial advertisements offering bargain prices for a short period:
Fine gauge Half Hose, black grounds with white stripes […] Very rarely are we in a position to sell such Half Hose at 12½ cents a pair. "Catch it while it's flying."
New Haven (Connecticut) Evening Register (1894), 19 September p. 4
For at least ten years, from 1897 until 1910, the variant “Catch it while it flies” was a standard slogan employed by a number of fuel companies to call attention to their special offers:
There is a time in buying FUEL when you can lay in your winter supply to the best advantage.
Now is the time. Catch it while it flies, and go to 219 Salem avenue, where you will find the belled teams of W. K. ANDREWS & CO. ready to supply you with the best coal and wood nice and dry.
Roanoke Times (Roanoke, Virginia) (1897), 16 October p. 3
There is a time in buying your coal when you can lay in your Winter supply at a large discount – now is the time! Catch it while it flies, and go to Weller’s where you will find the best grade Carbonado coal.
Morning Olympian (Olympia, Washington) (1908), 8 July p. 4
Later examples (post-Joyce) are Irish rather than American, such as this one from William Kelley’s Gemini (1959: p. 65):
The girl had to have awful luck to have drawn the only three males in the City of New York who didn’t know the rudiments of venery. So maybe there was something wrong with her at that. But at this point it made very little difference. As Sean would have said, you've got to catch it while it's flying.
In modern use the expression is often found in Irish contexts, though is not clear whether usage has been influenced by the occurrence of the phrase in Ulysses.