0

I want to create a UIViewController, that contains logic to present itself according to that logic.

Why?

I want this to be an isolated class that can be easily implemented into any project with minimum effort. Like just drag and drop into a project, add a simple #import and/or

myclassdelegate

and an instantiation in the AppDelegate.

Then, when the app is running, and the conditions of the logic are met, for instance, a specific date/time is reached, or the device exceeds a given speed, or the device is within a specified GPS range, the ViewController pops up.

Is this doable?

What would be the best approach for this?

Sjakelien
  • 2,255
  • 3
  • 25
  • 43
  • Of course it is doable. It is a normal thing for an app. What you should do is just create the view popup and in mainViewController, checks the condition periodically (like thru timer), and calls the segue to pop it up when the condition is met. – GeneCode Sep 02 '17 at 09:13
  • @ GeneCode. Yes, indeed. But I want all logic in some class files that I just drop in in an existing project. With minimum references in either the AppDelegate or the MainViewController – Sjakelien Sep 02 '17 at 12:00

0 Answers0