swift2 - Swift 2 API Availability Check for storyboard -


i have existing ios application supports ios 8. want add new features ios 9.

i have created new storyboard ios 9 using ios 9 features uistackview. appropriate storyboard file instantiated based on device os version.

func application(application: uiapplication, didfinishlaunchingwithoptions launchoptions: [nsobject: anyobject]?) -> bool {      let storyboard: uistoryboard     if #available(ios 9, *, *) {         storyboard = uistoryboard(name: "main", bundle: nil)     } else {         storyboard = uistoryboard(name: "mainold", bundle: nil)     }     let mainviewcontroller = storyboard.instantiateinitialviewcontroller()     window?.rootviewcontroller = mainviewcontroller     window?.makekeyandvisible()     return true } 

but getting compilation error on main.storyboard "uistackview before ios 9.0"

i using xcode 7 beta 5.

how use ios 9 related features on ios 8 supported projects using swift 2 #availability check

you cannot use such #availability feature in storyboard. if support ios 8 uistackview, should construct uistackview code, or use third party's compatible libraries. oastackview or tzstackview.


Comments

Popular posts from this blog

dns - How To Use Custom Nameserver On Free Cloudflare? -

python - Pygame screen.blit not working -

c# - Web API response xml language -