Dynamic version and copyright information for launch screen implemented with storyboard

alexeyNalexeyN UAMember ✭✭

Hello All,

I have a storyboard file for the launch screen with static information about the app version and copyright.
Every time before releasing a new version I need to update the version info and check copyright information.
It would be great if i could set it programmatically.
I would like to set up the launch screen storyboard so it would get CFBundleShortVersionString from Info.plist and a year of build from my computer.

Is there any possibility to achieve that?

Thanks

Tagged:

Answers

  • JohnMillerJohnMiller USForum Administrator, Xamarin Team Xamurai
    edited November 2016

    @alexeyN,

    I don't believe that is possible. The content for the launch screen must be static. You could make the first screen in your app have a dynamic label though so it appears right after the launch screen. If the screens look the same, it would not be very obvious to the user that this was a different screen.

    However, if you find some information that iOS supports dynamic content like this in that storyboard send me a link. If yes, it will be possible in Xamarin.iOS too - I didn't find any.

  • BerayBentesenBerayBentesen TRUniversity ✭✭✭✭

    @alexeyN someone did with XCode by using xib. Maybe you can convert since Xamarin allows using xib for LaunchScreen Storyboard

    Code :

      class AppDelegate: UIResponder, UIApplicationDelegate {
    
     var window: UIWindow?
     var customizedLaunchScreenView: UIView?
    
      func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?)     -> Bool {
    
        // Override point for customization after application launch.
        application.statusBarHidden = true
    
        // customized launch screen
        if let window = self.window {
            self.customizedLaunchScreenView = UIView(frame: window.bounds)
            self.customizedLaunchScreenView?.backgroundColor = UIColor.greenColor()
    
            self.window?.makeKeyAndVisible()
            self.window?.addSubview(self.customizedLaunchScreenView!)
            self.window?.bringSubviewToFront(self.customizedLaunchScreenView!)
            UIView.animateWithDuration(1, delay: 2, options: .CurveEaseOut,
                                       animations: { () -> Void in
                                        self.customizedLaunchScreenView?.alpha = 0 },
                                       completion: { _ in
                                        self.customizedLaunchScreenView?.removeFromSuperview() })
            }
    
          return true
      }
    
        // other stuff ...
    
    }
    

    How to use xib is here

  • alexeyNalexeyN UAMember ✭✭

    @JohnMiller , @BerayBentesen Many thanks for the contribution.

    We found a way that works for us. We use a pre-build line command that runs an app. The app parses Info.plist and update the LaunchScreen.storyboard.

  • KrishGemKrishGem Member
    @alexeyN,

    I need to achieve exactly same contents on launchscreen.storyboard with dynamic version fetched from info.plist in purely native code using Swift.

    Could you please let me know how could u achieve this in ur code so that I can give a try in my swift code.

    Thanks & Regards
  • alexeyNalexeyN UAMember ✭✭

    Hi @KrishGem

    I implemented a small app that parses Info.plist and updates the LaunchScreen.storyboard.
    Then I wrote a pre-build line command that runs the app.
    This command is executed every time before building the project.

    I hope it helps.

Sign In or Register to comment.