How to retain data when switching ViewControllers and backHow can I make a UITextField move up when the keyboard is present - on starting to edit?calling setCoordinate on MKPlacemark crashes app with 'unrecognized selector'Swift compiler error on mapView declarationToolbar not displayed when segue back to tabviewcontroller (iOS Swift)redefine outlet mkmapview in viewdidappearMKViewMap custom annotation disappears on clickHow to update annotations when in mapview on zoom?Change annotation pin color on MKMapView when you select annotation pinmacOS: mouse click MKAnnotationView with modifier keyPass annotation title to embedded containerview when selected Swift

Why was the small council so happy for Tyrion to become the Master of Coin?

How old can references or sources in a thesis be?

What are these boxed doors outside store fronts in New York?

Is it legal for company to use my work email to pretend I still work there?

Test whether all array elements are factors of a number

Adding span tags within wp_list_pages list items

Why are electrically insulating heatsinks so rare? Is it just cost?

"to be prejudice towards/against someone" vs "to be prejudiced against/towards someone"

Smoothness of finite-dimensional functional calculus

Why does Kotter return in Welcome Back Kotter?

Collect Fourier series terms

What typically incentivizes a professor to change jobs to a lower ranking university?

How to format long polynomial?

Fencing style for blades that can attack from a distance

Why can't I see bouncing of a switch on an oscilloscope?

Is this a crack on the carbon frame?

Why "Having chlorophyll without photosynthesis is actually very dangerous" and "like living with a bomb"?

Watching something be written to a file live with tail

Mathematical cryptic clues

Why not use SQL instead of GraphQL?

Which models of the Boeing 737 are still in production?

Do I have a twin with permutated remainders?

How do we improve the relationship with a client software team that performs poorly and is becoming less collaborative?

How does strength of boric acid solution increase in presence of salicylic acid?



How to retain data when switching ViewControllers and back


How can I make a UITextField move up when the keyboard is present - on starting to edit?calling setCoordinate on MKPlacemark crashes app with 'unrecognized selector'Swift compiler error on mapView declarationToolbar not displayed when segue back to tabviewcontroller (iOS Swift)redefine outlet mkmapview in viewdidappearMKViewMap custom annotation disappears on clickHow to update annotations when in mapview on zoom?Change annotation pin color on MKMapView when you select annotation pinmacOS: mouse click MKAnnotationView with modifier keyPass annotation title to embedded containerview when selected Swift






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








0















I am working on an app that uses an MKMapView populated with MKPlacemarks. When a user clicks on one of these MKPlacemarks, they segue to another ViewController. If they click 'cancel' on this ViewController, they segue back to the original one. The only issue with this is that when they click 'cancel', I want the original ViewController to look the same as the instant they clicked on the MKPlacemarks. What I mean by this is that the MKPlacemarks should still be selected, views should be in the same positions (one moves up when the MKPlacemarks is clicked before performing the segue), etc. This is what I am using to detect if an MKAnnotation has been clicked (I don't think it is of any use, but I thought I'd put it just to be safe):



func mapView(_ mapView: MKMapView, didSelect view: MKAnnotationView) 
guard let ann = view.annotation as? MKPlacemark else return
...










share|improve this question
























  • Open the second guy as a modal view over the first one.

    – El Tomato
    Mar 21 at 23:54


















0















I am working on an app that uses an MKMapView populated with MKPlacemarks. When a user clicks on one of these MKPlacemarks, they segue to another ViewController. If they click 'cancel' on this ViewController, they segue back to the original one. The only issue with this is that when they click 'cancel', I want the original ViewController to look the same as the instant they clicked on the MKPlacemarks. What I mean by this is that the MKPlacemarks should still be selected, views should be in the same positions (one moves up when the MKPlacemarks is clicked before performing the segue), etc. This is what I am using to detect if an MKAnnotation has been clicked (I don't think it is of any use, but I thought I'd put it just to be safe):



func mapView(_ mapView: MKMapView, didSelect view: MKAnnotationView) 
guard let ann = view.annotation as? MKPlacemark else return
...










share|improve this question
























  • Open the second guy as a modal view over the first one.

    – El Tomato
    Mar 21 at 23:54














0












0








0








I am working on an app that uses an MKMapView populated with MKPlacemarks. When a user clicks on one of these MKPlacemarks, they segue to another ViewController. If they click 'cancel' on this ViewController, they segue back to the original one. The only issue with this is that when they click 'cancel', I want the original ViewController to look the same as the instant they clicked on the MKPlacemarks. What I mean by this is that the MKPlacemarks should still be selected, views should be in the same positions (one moves up when the MKPlacemarks is clicked before performing the segue), etc. This is what I am using to detect if an MKAnnotation has been clicked (I don't think it is of any use, but I thought I'd put it just to be safe):



func mapView(_ mapView: MKMapView, didSelect view: MKAnnotationView) 
guard let ann = view.annotation as? MKPlacemark else return
...










share|improve this question
















I am working on an app that uses an MKMapView populated with MKPlacemarks. When a user clicks on one of these MKPlacemarks, they segue to another ViewController. If they click 'cancel' on this ViewController, they segue back to the original one. The only issue with this is that when they click 'cancel', I want the original ViewController to look the same as the instant they clicked on the MKPlacemarks. What I mean by this is that the MKPlacemarks should still be selected, views should be in the same positions (one moves up when the MKPlacemarks is clicked before performing the segue), etc. This is what I am using to detect if an MKAnnotation has been clicked (I don't think it is of any use, but I thought I'd put it just to be safe):



func mapView(_ mapView: MKMapView, didSelect view: MKAnnotationView) 
guard let ann = view.annotation as? MKPlacemark else return
...







ios swift xcode mapkit mkmapview






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 22 at 10:13









Kaushik Makwana

956623




956623










asked Mar 21 at 23:50









Bob SamuelsBob Samuels

407




407












  • Open the second guy as a modal view over the first one.

    – El Tomato
    Mar 21 at 23:54


















  • Open the second guy as a modal view over the first one.

    – El Tomato
    Mar 21 at 23:54

















Open the second guy as a modal view over the first one.

– El Tomato
Mar 21 at 23:54






Open the second guy as a modal view over the first one.

– El Tomato
Mar 21 at 23:54













0






active

oldest

votes












Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55290882%2fhow-to-retain-data-when-switching-viewcontrollers-and-back%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55290882%2fhow-to-retain-data-when-switching-viewcontrollers-and-back%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript