PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Tuesday, July 12, 2022

[FIXED] How to display a message on startup about new feature only to pervious users

 July 12, 2022     message, swift, uialertview, xcode     No comments   

Issue

I am adding new features and want to create a message (like a UIAlertController) at app startup that explains the new features.

Is there anyway to do this to users that have already downloaded the app? New users that download the app don't need to see the new features message because to them every feature is new since they've never used the app before. Or perhaps I would have a message but the content would be different.

Thanks!


Solution

The easiest way is to save the current version in UserDefaults:

var defaults = UserDefaults.standard
defaults.set(2.2, forKey: "lastVersion")

Then on your Initial View Controller check to see if they have the latest version:

override func viewDidLoad() {
     super.viewDidLoad()
     if let lastVersion = NSUserDefaults.standard(forKey: "lastVersion") {
        print(lastVersion)
     }
}

Then it's up to you on how you wish to present the list of new features.



Answered By - Martin Muldoon
Answer Checked By - Mary Flores (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home
View mobile version

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing