Here is a solution to produce values between 100 and 1000, distant of 50 at least, and using only one call to arc4random to guarantee a fixed execution time:
/// Return a new random height between 100 and 1000, at least 50 space from previous one.
+ (uint32_t)randomHeight {
/// initial value is given equiprobability (1000 - 100 + 50)
static uint32_t _randomHeight = 950;
uint32_t lowValues = MAX(_randomHeight - 50, 0);
uint32_t highValues = MAX(850 - _randomHeight, 0);
uint32_t aRandom = arc4random_uniform(lowValues + highValues + 1);
_randomHeight = aRandom < lowValues ? aRandom : _randomHeight + 50 + aRandom - lowValues;
return _randomHeight + 100;
}