Remove keyboard notification when ViewController disappearsHow do you dismiss the keyboard when editing a UITextFieldHow can I make a UITextField move up when the keyboard is present - on starting to edit?How to navigate through textfields (Next / Done Buttons)Eliminate extra separators below UITableViewAndroid: remove notification from notification barPassing Data between View ControllersperformSelector may cause a leak because its selector is unknownNSNotificationCenter addObserver in SwiftClose iOS Keyboard by touching anywhere using SwiftMove view with keyboard using Swift

Telling my mother that I have anorexia without panicking her

Sort files in a given folders and provide as a list

What is my breathable atmosphere composed of?

Make 2019 with single digits

Difference in using Lightning Component <lighting:badge/> and Normal DOM with slds <span class="slds-badge"></span>? Which is Better and Why?

Why is the Digital 0 not 0V in computer systems?

Does deswegen have another meaning than "that is why"?

What is this gigantic dish at Ben Gurion airport?

Cannot find Database Mail feature in SQL Server Express 2012 SP1

My research paper filed as a patent in China by my Chinese supervisor without me as inventor

Planar regular languages

Some Prime Peerage

What hard drive connector is this?

Is a suit against a University Dorm for changing policies on a whim likely to succeed (USA)?

Why is the T-1000 humanoid?

Why don't Wizards use wrist straps to protect against disarming charms?

Parallel resistance in electric circuits

How do I get rid of distortion in pictures of distant objects photographed with a telephoto lens?

Why did it become so much more expensive to start a university?

What was the motivation for the invention of electric pianos?

In what state are satellites left in when they are left in a graveyard orbit?

Has SHA256 been broken by Treadwell Stanton DuPont?

What's 待ってるから mean?

Mutable named tuple with default value and conditional rounding support



Remove keyboard notification when ViewController disappears


How do you dismiss the keyboard when editing a UITextFieldHow can I make a UITextField move up when the keyboard is present - on starting to edit?How to navigate through textfields (Next / Done Buttons)Eliminate extra separators below UITableViewAndroid: remove notification from notification barPassing Data between View ControllersperformSelector may cause a leak because its selector is unknownNSNotificationCenter addObserver in SwiftClose iOS Keyboard by touching anywhere using SwiftMove view with keyboard using Swift






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








1















How can I remove keyboard notification?



I put observer on keyboard open and close.



I change the view size depend on keyboard is open or close.










share|improve this question


























  • self.view.endEditing(true) to simply hide keyboard

    – NavinBagul
    Mar 28 at 11:27

















1















How can I remove keyboard notification?



I put observer on keyboard open and close.



I change the view size depend on keyboard is open or close.










share|improve this question


























  • self.view.endEditing(true) to simply hide keyboard

    – NavinBagul
    Mar 28 at 11:27













1












1








1








How can I remove keyboard notification?



I put observer on keyboard open and close.



I change the view size depend on keyboard is open or close.










share|improve this question
















How can I remove keyboard notification?



I put observer on keyboard open and close.



I change the view size depend on keyboard is open or close.







ios swift notifications uikeyboard






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 28 at 12:57









Onur Tuna

6646 silver badges23 bronze badges




6646 silver badges23 bronze badges










asked Mar 28 at 10:27









Vijay KaharVijay Kahar

62 bronze badges




62 bronze badges















  • self.view.endEditing(true) to simply hide keyboard

    – NavinBagul
    Mar 28 at 11:27

















  • self.view.endEditing(true) to simply hide keyboard

    – NavinBagul
    Mar 28 at 11:27
















self.view.endEditing(true) to simply hide keyboard

– NavinBagul
Mar 28 at 11:27





self.view.endEditing(true) to simply hide keyboard

– NavinBagul
Mar 28 at 11:27












3 Answers
3






active

oldest

votes


















1
















Try this to remove keyboard open show observers,



NotificationCenter.default.removeObserver(self, name: NSNotification.Name.UIKeyboardWillShow, object: nil)
NotificationCenter.default.removeObserver(self, name: NSNotification.Name.UIKeyboardWillHide, object: nil)


you should remove observers either in deinit Or viewDidDisappear as per your requirement.






share|improve this answer


































    1
















    You can put the code at two place.



    override func viewDidDisappear(_ animated: Bool) 
    super.viewDidDisappear(animated)
    NotificationCenter.default.removeObserver(self, name: NSNotification.Name.UIKeyboardWillShow, object: nil)
    NotificationCenter.default.removeObserver(self, name: NSNotification.Name.UIKeyboardWillHide, object: nil)



    And on this one



    deinit
    NotificationCenter.default.removeObserver(self, name: NSNotification.Name.UIKeyboardWillShow, object: nil)
    NotificationCenter.default.removeObserver(self, name: NSNotification.Name.UIKeyboardWillHide, object: nil)






    share|improve this answer
































      0
















      try below code hope it works for you



      override func viewDidDisappear(animated: Bool) 
      NSNotificationCenter.defaultCenter().removeObserver(self)






      share|improve this answer



























        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/4.0/"u003ecc by-sa 4.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%2f55395298%2fremove-keyboard-notification-when-viewcontroller-disappears%23new-answer', 'question_page');

        );

        Post as a guest















        Required, but never shown

























        3 Answers
        3






        active

        oldest

        votes








        3 Answers
        3






        active

        oldest

        votes









        active

        oldest

        votes






        active

        oldest

        votes









        1
















        Try this to remove keyboard open show observers,



        NotificationCenter.default.removeObserver(self, name: NSNotification.Name.UIKeyboardWillShow, object: nil)
        NotificationCenter.default.removeObserver(self, name: NSNotification.Name.UIKeyboardWillHide, object: nil)


        you should remove observers either in deinit Or viewDidDisappear as per your requirement.






        share|improve this answer































          1
















          Try this to remove keyboard open show observers,



          NotificationCenter.default.removeObserver(self, name: NSNotification.Name.UIKeyboardWillShow, object: nil)
          NotificationCenter.default.removeObserver(self, name: NSNotification.Name.UIKeyboardWillHide, object: nil)


          you should remove observers either in deinit Or viewDidDisappear as per your requirement.






          share|improve this answer





























            1














            1










            1









            Try this to remove keyboard open show observers,



            NotificationCenter.default.removeObserver(self, name: NSNotification.Name.UIKeyboardWillShow, object: nil)
            NotificationCenter.default.removeObserver(self, name: NSNotification.Name.UIKeyboardWillHide, object: nil)


            you should remove observers either in deinit Or viewDidDisappear as per your requirement.






            share|improve this answer















            Try this to remove keyboard open show observers,



            NotificationCenter.default.removeObserver(self, name: NSNotification.Name.UIKeyboardWillShow, object: nil)
            NotificationCenter.default.removeObserver(self, name: NSNotification.Name.UIKeyboardWillHide, object: nil)


            you should remove observers either in deinit Or viewDidDisappear as per your requirement.







            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited Mar 28 at 11:25

























            answered Mar 28 at 10:47









            Dhaval BhimaniDhaval Bhimani

            5081 gold badge6 silver badges18 bronze badges




            5081 gold badge6 silver badges18 bronze badges


























                1
















                You can put the code at two place.



                override func viewDidDisappear(_ animated: Bool) 
                super.viewDidDisappear(animated)
                NotificationCenter.default.removeObserver(self, name: NSNotification.Name.UIKeyboardWillShow, object: nil)
                NotificationCenter.default.removeObserver(self, name: NSNotification.Name.UIKeyboardWillHide, object: nil)



                And on this one



                deinit
                NotificationCenter.default.removeObserver(self, name: NSNotification.Name.UIKeyboardWillShow, object: nil)
                NotificationCenter.default.removeObserver(self, name: NSNotification.Name.UIKeyboardWillHide, object: nil)






                share|improve this answer





























                  1
















                  You can put the code at two place.



                  override func viewDidDisappear(_ animated: Bool) 
                  super.viewDidDisappear(animated)
                  NotificationCenter.default.removeObserver(self, name: NSNotification.Name.UIKeyboardWillShow, object: nil)
                  NotificationCenter.default.removeObserver(self, name: NSNotification.Name.UIKeyboardWillHide, object: nil)



                  And on this one



                  deinit
                  NotificationCenter.default.removeObserver(self, name: NSNotification.Name.UIKeyboardWillShow, object: nil)
                  NotificationCenter.default.removeObserver(self, name: NSNotification.Name.UIKeyboardWillHide, object: nil)






                  share|improve this answer



























                    1














                    1










                    1









                    You can put the code at two place.



                    override func viewDidDisappear(_ animated: Bool) 
                    super.viewDidDisappear(animated)
                    NotificationCenter.default.removeObserver(self, name: NSNotification.Name.UIKeyboardWillShow, object: nil)
                    NotificationCenter.default.removeObserver(self, name: NSNotification.Name.UIKeyboardWillHide, object: nil)



                    And on this one



                    deinit
                    NotificationCenter.default.removeObserver(self, name: NSNotification.Name.UIKeyboardWillShow, object: nil)
                    NotificationCenter.default.removeObserver(self, name: NSNotification.Name.UIKeyboardWillHide, object: nil)






                    share|improve this answer













                    You can put the code at two place.



                    override func viewDidDisappear(_ animated: Bool) 
                    super.viewDidDisappear(animated)
                    NotificationCenter.default.removeObserver(self, name: NSNotification.Name.UIKeyboardWillShow, object: nil)
                    NotificationCenter.default.removeObserver(self, name: NSNotification.Name.UIKeyboardWillHide, object: nil)



                    And on this one



                    deinit
                    NotificationCenter.default.removeObserver(self, name: NSNotification.Name.UIKeyboardWillShow, object: nil)
                    NotificationCenter.default.removeObserver(self, name: NSNotification.Name.UIKeyboardWillHide, object: nil)







                    share|improve this answer












                    share|improve this answer



                    share|improve this answer










                    answered Mar 28 at 11:30









                    chirag shahchirag shah

                    2,07517 silver badges44 bronze badges




                    2,07517 silver badges44 bronze badges
























                        0
















                        try below code hope it works for you



                        override func viewDidDisappear(animated: Bool) 
                        NSNotificationCenter.defaultCenter().removeObserver(self)






                        share|improve this answer





























                          0
















                          try below code hope it works for you



                          override func viewDidDisappear(animated: Bool) 
                          NSNotificationCenter.defaultCenter().removeObserver(self)






                          share|improve this answer



























                            0














                            0










                            0









                            try below code hope it works for you



                            override func viewDidDisappear(animated: Bool) 
                            NSNotificationCenter.defaultCenter().removeObserver(self)






                            share|improve this answer













                            try below code hope it works for you



                            override func viewDidDisappear(animated: Bool) 
                            NSNotificationCenter.defaultCenter().removeObserver(self)







                            share|improve this answer












                            share|improve this answer



                            share|improve this answer










                            answered Mar 28 at 12:36









                            vijay kaharvijay kahar

                            2379 bronze badges




                            2379 bronze badges































                                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%2f55395298%2fremove-keyboard-notification-when-viewcontroller-disappears%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

                                SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

                                은진 송씨 목차 역사 본관 분파 인물 조선 왕실과의 인척 관계 집성촌 항렬자 인구 같이 보기 각주 둘러보기 메뉴은진 송씨세종실록 149권, 지리지 충청도 공주목 은진현