Skip to main content

Instantly parse JSON

You must know about the JSON  . Don't worry I am not here to teach this because I am not a good teacher 😉. If you are really interested to learn about it then just search on the Google or check   Parsing complex JSON in Flutter  (Personally recommended) because she covers almost all things. Now, do you have time to write such classes in such a digital age?? Great 👍 then just see  https://app.quicktype.io/ . Really a good job 👏 What you need to do  Copy JSON   Paste in JSON area Give the Model name Copy code Let me explain it to you. They have a text area in which you need to copy the JSON and then Copy the dart code. They also have other language support also.  Thanks.  Please comment below how I can improve this article

Launch Activity View And Alert View

import UIKit
class ViewController: UIViewController {

 1.   @IBAction func experiment(_ sender: Any) {

 2.       let image = UIImage()
 3.       let controller = UIActivityViewController(activityItems:
             [image],applicationActivities: nil)
 4.       self.present(controller, animated: true, completion: nil)
    }

}
Step 3: Make a object of controller for the Activity class


Launch Alert View

import UIKit

class ViewController: UIViewController {

    @IBAction func experiment(_ sender: Any) {

        let controller = UIAlertController()
        controller.title = "Test Alert"
        controller.message = "This is a test"

        let okAction = UIAlertAction<br />(title: "ok", style: UIAlertActionStyle.default) { action in self.dismiss(animated: true, completion: nil)
        }

        controller.addAction(okAction)        
        self.present(controller, animated: true, completion: nil)
    }

}

Comments

Popular posts from this blog