3 Replies
      Latest reply: Nov 22, 2016 2:13 AM by eskimo RSS
      nitisha Level 1 Level 1 (0 points)

        Hi,

        My application is wriiten in swift 2.2.it's working fine on devices below 10.0.but crashes above 10.0.crashes occuring in google maps frameworks.do i need to update my application code to swift 3.0?

        • Re: Do swift 2.2 supports on ios 10.1.1 ?
          eskimo Apple Staff Apple Staff (7,005 points)

          Currently Swift apps include the Swift runtime library.  This means that the language and the OS are pretty decoupled; you can run an app built with any version of Swift on any version of iOS 7 and later.  There’s certainly no requirement that apps running on iOS 10.1.1 must be built with Swift 3.

          Whatever is causing your app to crash on iOS 10 is probably unrelated to Swift; I recommend you investigate it like any other OS incompatibility.

          Share and Enjoy

          Quinn “The Eskimo!”
          Apple Developer Relations, Developer Technical Support, Core OS/Hardware
          let myEmail = "eskimo" + "1" + "@apple.com"

            • Re: Do swift 2.2 supports on ios 10.1.1 ?
              nitisha Level 1 Level 1 (0 points)

              i've implemented marker clustering(Google-maps Utils Library) along with google maps.crash i'm getting is on deallocating cluster manager object.i'm deallocating google map and cluster manager objects and delegate in viewDidDisappear as i'm initialising it in viewDidLoad.it works fine upto 10.0,but for higher when i'm doing same in deinit it's not crashing meanwhile it crashes in lower version.below is my code                                                               

               

              
              

              deinit{

                      print("DEINIT")

                    

                      if(googleMapView != nil){

                          googleMapView!.removeObserver(self, forKeyPath: "myLocation")

                      }

                      if(clusterManager != nil)

                      {

                          clusterManager.clearItems()

                          clusterManager.setDelegate(nil, mapDelegate: nil)

                          clusterManager = nil

                      }

                  }`

              How do i manage this by putting condition for version?

                • Re: Do swift 2.2 supports on ios 10.1.1 ?
                  eskimo Apple Staff Apple Staff (7,005 points)

                  Honestly, I’m not the right person to help you with Google libraries.  In general, third-party libraries have their own support facilities and I recommend you ask there.  However, I have some general points that I hope you'll find helpful.

                  Firstly, viewDidDisappear(_:) is not the logical opposite of viewDidLoad().  The latter is called once, as your view loads, but the former can be called multiple of times as your view goes and off screen.  So, you can:

                  • Set things up in viewWillDisappear(_:) and tear them down in viewDidDisappear(_:)

                  • Set things up in viewDidLoad() and tear them down in deinit

                  • Explicitly manage the setup/teardown state

                  How do i manage this by putting condition for version?

                  Conditionalising for the OS version is trivial (search the docs for #available) but it’s almost certainly the wrong approach in situations like this.  In general the rules for object lifecycle management don’t change from release to release of the OS.  If things have broken on iOS 10, it’s probably the case that you weren’t following the rules properly and just happened to get away with it on iOS 9.

                  However, I can’t be 100% sure because I don’t know anything about the third-party library you’re using; there could be some OS-specific edge case there.  Which brings me back to my first point: you’d probably be better off asking this via that library’s support channel.

                  Share and Enjoy

                  Quinn “The Eskimo!”
                  Apple Developer Relations, Developer Technical Support, Core OS/Hardware
                  let myEmail = "eskimo" + "1" + "@apple.com"