Apple is partnering with the philanthropic arm of billionaire real estate developer John Sobrato and two other nonprofit groups to launch a $50 million fund intended to build or preserve affordable housing in the San Francisco Bay Area, where explosive tech sector growth has contributed to some of the nation’s highest housing prices.