Swift 2 to 3 Migration for prepareForSegue [duplicate]









up vote
2
down vote

favorite
1













This question already has an answer here:



  • prepare(for segue: UIStoryboardSegue, sender: AnyObject?) missing in swift 3.0/Xcode 8 b6

    1 answer



This question might have been answered already but I could not find it.



override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) 



This code worked fine in swift 2 but now gives me an error to remove the override.



Exact Error: "Method does not override any method from its superclass"



What is the new correct method for swift 3 for this? I can't seem to find any documentation on it anywhere.










share|improve this question













marked as duplicate by Oleg Gordiichuk, vacawama swift
Users with the  swift badge can single-handedly close swift questions as duplicates and reopen them as needed.

StackExchange.ready(function()
if (StackExchange.options.isMobile) return;

$('.dupe-hammer-message-hover:not(.hover-bound)').each(function()
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');

$hover.hover(
function()
$hover.showInfoMessage('',
messageElement: $msg.clone().show(),
transient: false,
position: my: 'bottom left', at: 'top center', offsetTop: -7 ,
dismissable: false,
relativeToBody: true
);
,
function()
StackExchange.helpers.removeMessages();

);
);
);
Sep 28 '16 at 9:35


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.














  • thanks was looking all over for the answer on here.
    – Joseph Astrahan
    Sep 28 '16 at 9:33










  • You also could have used this feature of Xcode: Edit > Convert > To Current Swift Syntax...
    – Tobi
    Sep 28 '16 at 9:46










  • That feature didn't work for some reason when I tried.
    – Joseph Astrahan
    Sep 30 '16 at 19:38














up vote
2
down vote

favorite
1













This question already has an answer here:



  • prepare(for segue: UIStoryboardSegue, sender: AnyObject?) missing in swift 3.0/Xcode 8 b6

    1 answer



This question might have been answered already but I could not find it.



override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) 



This code worked fine in swift 2 but now gives me an error to remove the override.



Exact Error: "Method does not override any method from its superclass"



What is the new correct method for swift 3 for this? I can't seem to find any documentation on it anywhere.










share|improve this question













marked as duplicate by Oleg Gordiichuk, vacawama swift
Users with the  swift badge can single-handedly close swift questions as duplicates and reopen them as needed.

StackExchange.ready(function()
if (StackExchange.options.isMobile) return;

$('.dupe-hammer-message-hover:not(.hover-bound)').each(function()
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');

$hover.hover(
function()
$hover.showInfoMessage('',
messageElement: $msg.clone().show(),
transient: false,
position: my: 'bottom left', at: 'top center', offsetTop: -7 ,
dismissable: false,
relativeToBody: true
);
,
function()
StackExchange.helpers.removeMessages();

);
);
);
Sep 28 '16 at 9:35


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.














  • thanks was looking all over for the answer on here.
    – Joseph Astrahan
    Sep 28 '16 at 9:33










  • You also could have used this feature of Xcode: Edit > Convert > To Current Swift Syntax...
    – Tobi
    Sep 28 '16 at 9:46










  • That feature didn't work for some reason when I tried.
    – Joseph Astrahan
    Sep 30 '16 at 19:38












up vote
2
down vote

favorite
1









up vote
2
down vote

favorite
1






1






This question already has an answer here:



  • prepare(for segue: UIStoryboardSegue, sender: AnyObject?) missing in swift 3.0/Xcode 8 b6

    1 answer



This question might have been answered already but I could not find it.



override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) 



This code worked fine in swift 2 but now gives me an error to remove the override.



Exact Error: "Method does not override any method from its superclass"



What is the new correct method for swift 3 for this? I can't seem to find any documentation on it anywhere.










share|improve this question














This question already has an answer here:



  • prepare(for segue: UIStoryboardSegue, sender: AnyObject?) missing in swift 3.0/Xcode 8 b6

    1 answer



This question might have been answered already but I could not find it.



override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) 



This code worked fine in swift 2 but now gives me an error to remove the override.



Exact Error: "Method does not override any method from its superclass"



What is the new correct method for swift 3 for this? I can't seem to find any documentation on it anywhere.





This question already has an answer here:



  • prepare(for segue: UIStoryboardSegue, sender: AnyObject?) missing in swift 3.0/Xcode 8 b6

    1 answer







swift swift2 segue swift3 ios10






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Sep 28 '16 at 9:29









Joseph Astrahan

3,13623278




3,13623278




marked as duplicate by Oleg Gordiichuk, vacawama swift
Users with the  swift badge can single-handedly close swift questions as duplicates and reopen them as needed.

StackExchange.ready(function()
if (StackExchange.options.isMobile) return;

$('.dupe-hammer-message-hover:not(.hover-bound)').each(function()
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');

$hover.hover(
function()
$hover.showInfoMessage('',
messageElement: $msg.clone().show(),
transient: false,
position: my: 'bottom left', at: 'top center', offsetTop: -7 ,
dismissable: false,
relativeToBody: true
);
,
function()
StackExchange.helpers.removeMessages();

);
);
);
Sep 28 '16 at 9:35


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.






marked as duplicate by Oleg Gordiichuk, vacawama swift
Users with the  swift badge can single-handedly close swift questions as duplicates and reopen them as needed.

StackExchange.ready(function()
if (StackExchange.options.isMobile) return;

$('.dupe-hammer-message-hover:not(.hover-bound)').each(function()
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');

$hover.hover(
function()
$hover.showInfoMessage('',
messageElement: $msg.clone().show(),
transient: false,
position: my: 'bottom left', at: 'top center', offsetTop: -7 ,
dismissable: false,
relativeToBody: true
);
,
function()
StackExchange.helpers.removeMessages();

);
);
);
Sep 28 '16 at 9:35


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.













  • thanks was looking all over for the answer on here.
    – Joseph Astrahan
    Sep 28 '16 at 9:33










  • You also could have used this feature of Xcode: Edit > Convert > To Current Swift Syntax...
    – Tobi
    Sep 28 '16 at 9:46










  • That feature didn't work for some reason when I tried.
    – Joseph Astrahan
    Sep 30 '16 at 19:38
















  • thanks was looking all over for the answer on here.
    – Joseph Astrahan
    Sep 28 '16 at 9:33










  • You also could have used this feature of Xcode: Edit > Convert > To Current Swift Syntax...
    – Tobi
    Sep 28 '16 at 9:46










  • That feature didn't work for some reason when I tried.
    – Joseph Astrahan
    Sep 30 '16 at 19:38















thanks was looking all over for the answer on here.
– Joseph Astrahan
Sep 28 '16 at 9:33




thanks was looking all over for the answer on here.
– Joseph Astrahan
Sep 28 '16 at 9:33












You also could have used this feature of Xcode: Edit > Convert > To Current Swift Syntax...
– Tobi
Sep 28 '16 at 9:46




You also could have used this feature of Xcode: Edit > Convert > To Current Swift Syntax...
– Tobi
Sep 28 '16 at 9:46












That feature didn't work for some reason when I tried.
– Joseph Astrahan
Sep 30 '16 at 19:38




That feature didn't work for some reason when I tried.
– Joseph Astrahan
Sep 30 '16 at 19:38












1 Answer
1






active

oldest

votes

















up vote
6
down vote



accepted










Method signature is changed in swift 3.0



Replace this



 override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {


With



 override func prepare(for segue: UIStoryboardSegue, sender: Any?) {





share|improve this answer



























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    6
    down vote



    accepted










    Method signature is changed in swift 3.0



    Replace this



     override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {


    With



     override func prepare(for segue: UIStoryboardSegue, sender: Any?) {





    share|improve this answer
























      up vote
      6
      down vote



      accepted










      Method signature is changed in swift 3.0



      Replace this



       override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {


      With



       override func prepare(for segue: UIStoryboardSegue, sender: Any?) {





      share|improve this answer






















        up vote
        6
        down vote



        accepted







        up vote
        6
        down vote



        accepted






        Method signature is changed in swift 3.0



        Replace this



         override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {


        With



         override func prepare(for segue: UIStoryboardSegue, sender: Any?) {





        share|improve this answer












        Method signature is changed in swift 3.0



        Replace this



         override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {


        With



         override func prepare(for segue: UIStoryboardSegue, sender: Any?) {






        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Sep 28 '16 at 9:32









        Sahil

        6,27931525




        6,27931525













            Popular posts from this blog

            Use pre created SQLite database for Android project in kotlin

            Darth Vader #20

            Ondo