My app doesn't do the code I've been write Swift












1















I'm trying to understand why my code is not totally played by my application?



In fact I have a button on a viewController when the user press the button two textfield is normal become interactive and the background will change to show the possibility of interaction. When I've do the code and make the first test it work ! It work also in an other view but after some tests the button juste change his hidden property but do nothing else. Cf code :



 @IBAction func modifyBtnWasPressed(_ sender: UIButton) {

//We change the button by the save button

modifyBtn.isHidden = true
saveBtn.isHidden = false

//We enable 2 tf and we show to the user the 2 TF which will be enable

acftRegistrationTxt.isUserInteractionEnabled = true
acftModelTxt.isUserInteractionEnabled = true

acftRegistrationTxt.backgroundColor = UIColor(red: 0.9, green: 0.9, blue: 0.9, alpha: 1.0);
acftModelTxt.backgroundColor = UIColor(red: 0.9, green: 0.9, blue: 0.9, alpha: 1.0);


}


Now in this case only the isHidden property work the next 4 lines doesn't apply on the application.










share|improve this question

























  • What is your view background color ? Does it as same as UIColor(red: 0.9, green: 0.9, blue: 0.9, alpha: 1.0) ?

    – Sateesh
    Nov 27 '18 at 9:58













  • bad views connected?

    – Sulthan
    Nov 27 '18 at 10:20











  • @Sateesh It's totally white but the .isUserInteractionEnabled don't work too ... @sulthan, in this case the button will not change for the other one ?

    – flyer74
    Nov 27 '18 at 10:40













  • Put some breakpoints before and after you change the userInteractionEnabled and see if the textField interaction is effectively enabled by that two lines of code

    – Francesco Destino
    Nov 27 '18 at 11:12






  • 1





    Mm that's not okay! When your app is in debug type this on your Xcode terminal "po acftRegistrationTxt.isUserInteractionEnabled" and tell me what you get! Do the same for acftModelTxt Type this command when in debug before and after those two lines acftRegistrationTxt.isUserInteractionEnabled = true acftModelTxt.isUserInteractionEnabled = true

    – Francesco Destino
    Nov 27 '18 at 13:17


















1















I'm trying to understand why my code is not totally played by my application?



In fact I have a button on a viewController when the user press the button two textfield is normal become interactive and the background will change to show the possibility of interaction. When I've do the code and make the first test it work ! It work also in an other view but after some tests the button juste change his hidden property but do nothing else. Cf code :



 @IBAction func modifyBtnWasPressed(_ sender: UIButton) {

//We change the button by the save button

modifyBtn.isHidden = true
saveBtn.isHidden = false

//We enable 2 tf and we show to the user the 2 TF which will be enable

acftRegistrationTxt.isUserInteractionEnabled = true
acftModelTxt.isUserInteractionEnabled = true

acftRegistrationTxt.backgroundColor = UIColor(red: 0.9, green: 0.9, blue: 0.9, alpha: 1.0);
acftModelTxt.backgroundColor = UIColor(red: 0.9, green: 0.9, blue: 0.9, alpha: 1.0);


}


Now in this case only the isHidden property work the next 4 lines doesn't apply on the application.










share|improve this question

























  • What is your view background color ? Does it as same as UIColor(red: 0.9, green: 0.9, blue: 0.9, alpha: 1.0) ?

    – Sateesh
    Nov 27 '18 at 9:58













  • bad views connected?

    – Sulthan
    Nov 27 '18 at 10:20











  • @Sateesh It's totally white but the .isUserInteractionEnabled don't work too ... @sulthan, in this case the button will not change for the other one ?

    – flyer74
    Nov 27 '18 at 10:40













  • Put some breakpoints before and after you change the userInteractionEnabled and see if the textField interaction is effectively enabled by that two lines of code

    – Francesco Destino
    Nov 27 '18 at 11:12






  • 1





    Mm that's not okay! When your app is in debug type this on your Xcode terminal "po acftRegistrationTxt.isUserInteractionEnabled" and tell me what you get! Do the same for acftModelTxt Type this command when in debug before and after those two lines acftRegistrationTxt.isUserInteractionEnabled = true acftModelTxt.isUserInteractionEnabled = true

    – Francesco Destino
    Nov 27 '18 at 13:17
















1












1








1








I'm trying to understand why my code is not totally played by my application?



In fact I have a button on a viewController when the user press the button two textfield is normal become interactive and the background will change to show the possibility of interaction. When I've do the code and make the first test it work ! It work also in an other view but after some tests the button juste change his hidden property but do nothing else. Cf code :



 @IBAction func modifyBtnWasPressed(_ sender: UIButton) {

//We change the button by the save button

modifyBtn.isHidden = true
saveBtn.isHidden = false

//We enable 2 tf and we show to the user the 2 TF which will be enable

acftRegistrationTxt.isUserInteractionEnabled = true
acftModelTxt.isUserInteractionEnabled = true

acftRegistrationTxt.backgroundColor = UIColor(red: 0.9, green: 0.9, blue: 0.9, alpha: 1.0);
acftModelTxt.backgroundColor = UIColor(red: 0.9, green: 0.9, blue: 0.9, alpha: 1.0);


}


Now in this case only the isHidden property work the next 4 lines doesn't apply on the application.










share|improve this question
















I'm trying to understand why my code is not totally played by my application?



In fact I have a button on a viewController when the user press the button two textfield is normal become interactive and the background will change to show the possibility of interaction. When I've do the code and make the first test it work ! It work also in an other view but after some tests the button juste change his hidden property but do nothing else. Cf code :



 @IBAction func modifyBtnWasPressed(_ sender: UIButton) {

//We change the button by the save button

modifyBtn.isHidden = true
saveBtn.isHidden = false

//We enable 2 tf and we show to the user the 2 TF which will be enable

acftRegistrationTxt.isUserInteractionEnabled = true
acftModelTxt.isUserInteractionEnabled = true

acftRegistrationTxt.backgroundColor = UIColor(red: 0.9, green: 0.9, blue: 0.9, alpha: 1.0);
acftModelTxt.backgroundColor = UIColor(red: 0.9, green: 0.9, blue: 0.9, alpha: 1.0);


}


Now in this case only the isHidden property work the next 4 lines doesn't apply on the application.







ios swift uitextfield






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 27 '18 at 10:20









Sulthan

97.4k16158202




97.4k16158202










asked Nov 27 '18 at 9:54









flyer74flyer74

678




678













  • What is your view background color ? Does it as same as UIColor(red: 0.9, green: 0.9, blue: 0.9, alpha: 1.0) ?

    – Sateesh
    Nov 27 '18 at 9:58













  • bad views connected?

    – Sulthan
    Nov 27 '18 at 10:20











  • @Sateesh It's totally white but the .isUserInteractionEnabled don't work too ... @sulthan, in this case the button will not change for the other one ?

    – flyer74
    Nov 27 '18 at 10:40













  • Put some breakpoints before and after you change the userInteractionEnabled and see if the textField interaction is effectively enabled by that two lines of code

    – Francesco Destino
    Nov 27 '18 at 11:12






  • 1





    Mm that's not okay! When your app is in debug type this on your Xcode terminal "po acftRegistrationTxt.isUserInteractionEnabled" and tell me what you get! Do the same for acftModelTxt Type this command when in debug before and after those two lines acftRegistrationTxt.isUserInteractionEnabled = true acftModelTxt.isUserInteractionEnabled = true

    – Francesco Destino
    Nov 27 '18 at 13:17





















  • What is your view background color ? Does it as same as UIColor(red: 0.9, green: 0.9, blue: 0.9, alpha: 1.0) ?

    – Sateesh
    Nov 27 '18 at 9:58













  • bad views connected?

    – Sulthan
    Nov 27 '18 at 10:20











  • @Sateesh It's totally white but the .isUserInteractionEnabled don't work too ... @sulthan, in this case the button will not change for the other one ?

    – flyer74
    Nov 27 '18 at 10:40













  • Put some breakpoints before and after you change the userInteractionEnabled and see if the textField interaction is effectively enabled by that two lines of code

    – Francesco Destino
    Nov 27 '18 at 11:12






  • 1





    Mm that's not okay! When your app is in debug type this on your Xcode terminal "po acftRegistrationTxt.isUserInteractionEnabled" and tell me what you get! Do the same for acftModelTxt Type this command when in debug before and after those two lines acftRegistrationTxt.isUserInteractionEnabled = true acftModelTxt.isUserInteractionEnabled = true

    – Francesco Destino
    Nov 27 '18 at 13:17



















What is your view background color ? Does it as same as UIColor(red: 0.9, green: 0.9, blue: 0.9, alpha: 1.0) ?

– Sateesh
Nov 27 '18 at 9:58







What is your view background color ? Does it as same as UIColor(red: 0.9, green: 0.9, blue: 0.9, alpha: 1.0) ?

– Sateesh
Nov 27 '18 at 9:58















bad views connected?

– Sulthan
Nov 27 '18 at 10:20





bad views connected?

– Sulthan
Nov 27 '18 at 10:20













@Sateesh It's totally white but the .isUserInteractionEnabled don't work too ... @sulthan, in this case the button will not change for the other one ?

– flyer74
Nov 27 '18 at 10:40







@Sateesh It's totally white but the .isUserInteractionEnabled don't work too ... @sulthan, in this case the button will not change for the other one ?

– flyer74
Nov 27 '18 at 10:40















Put some breakpoints before and after you change the userInteractionEnabled and see if the textField interaction is effectively enabled by that two lines of code

– Francesco Destino
Nov 27 '18 at 11:12





Put some breakpoints before and after you change the userInteractionEnabled and see if the textField interaction is effectively enabled by that two lines of code

– Francesco Destino
Nov 27 '18 at 11:12




1




1





Mm that's not okay! When your app is in debug type this on your Xcode terminal "po acftRegistrationTxt.isUserInteractionEnabled" and tell me what you get! Do the same for acftModelTxt Type this command when in debug before and after those two lines acftRegistrationTxt.isUserInteractionEnabled = true acftModelTxt.isUserInteractionEnabled = true

– Francesco Destino
Nov 27 '18 at 13:17







Mm that's not okay! When your app is in debug type this on your Xcode terminal "po acftRegistrationTxt.isUserInteractionEnabled" and tell me what you get! Do the same for acftModelTxt Type this command when in debug before and after those two lines acftRegistrationTxt.isUserInteractionEnabled = true acftModelTxt.isUserInteractionEnabled = true

– Francesco Destino
Nov 27 '18 at 13:17














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%2f53496970%2fmy-app-doesnt-do-the-code-ive-been-write-swift%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%2f53496970%2fmy-app-doesnt-do-the-code-ive-been-write-swift%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