How do I check if passwords match in storyboard? [closed] - swift

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
I am basically making a login page, and want to make sure that passwords match before I can enable the continue button. I looked at the storyboard intro on the Apple website, but I didn't really understand exactly how I can link my storyboard to code and check if the passwords match.

You don't, exactly. In your storyboard you'd connect the various fields in your user interface to IBOutlets (for connecting things, the nouns of your UX) and IBActions (for responding to user actions, the verbs) to your view controller.
Fields like UItextField also can have a "delegate", an object that helps them manage their behavior. You'd hook up your view controller as a delegate of both of your password input fields, and when the passwords don't match, the view controller logic would disable the continue button.

Related

Detected when change page [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
I have a firstPage with BottomNavigationBar with 3 screens.
I want to detect when I change page from BottomNavigationBar inside a specific page, because when I leave this page, I must to execute a function contained inside this page.
One way to do it would be to create 3 boolean global variables(one for each page in the BottomNavigationBar) and initialize it to false. When the user goes to the second page from the first page set one of the boolean variables to true. Then check if that variable is true and execute your function. Be sure to set the variable back to false when the user leaves the page. Hope this helped.

"Swift Core Data" How to add a Scope Bars to UISearchBar? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 6 years ago.
Improve this question
So, I have a tableView with NSFetchedResultsController! I have also a UISearchController, and works perfectly! But I need a Scope Bars to the UISearchBar. How to create and how to add a Scope Bars in Swift Core Data?
Thanks!
Just give the search bar scopeButtonTitles at the time you obtain it from the UISearchController. As you present the search controller, set the search results controller as the search bar's delegate, so it will get searchBar:selectedScopeButtonIndexDidChange: when the user changes scope buttons, and there you just call updateSearchResultsForSearchController and deal with the search as you're already doing — taking account, now, of what the current scope button index is.

Repeatedly use view controller for online app and still have a back button [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 7 years ago.
Improve this question
I'm relatively new to programing in general and am currently designing a database project but now I ran into a logic problem which my head cant get straight.
The problem is that I have a view controller that loads in a list of things from the database and than when you click on it it opens a detail, from that detail there is a button that loads in a list like the previous one we came from so I use the same view controller and just request different data. So far, everything is nice and dandy.
But now comes the problem there is a back function so when I now press back once I go back to the detail and than when I press back a second time it loads the last data that I had loaded on that list so it loads the wrong data.
A good example of what I would like to have is the Facebook friend function when I click on my friends it loads a list and than I can click on their friends I see the same list with different data but when I go back two steps it loads in my friends again. I made it work with a very confusing and impractical system of registers but this is very bad because it sometimes throws errors.
So does anyone know how I could achieve what I want?
When you "reuse" this view controller, I would suggest creating a new instance of that view controller each time. This way, (assuming you avoid use of any global variables, but rather only use properties of the class) you're guaranteed that each time you create new instance of the view controller, it won't affect other instances that might exist elsewhere in the navigation controller's stack of previously instantiated view controllers.

Best practice for clear button in a UITextField [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 4 years ago.
Improve this question
When adding a clear button to a UITextField, which option do you normally select for when the clear button appears (appears while editing, appears unless editing, always visible)? I want to choose the one that is unintrusive but useful.
Usually I use "appear while editing" too. But it really depend of what is the purpose of the textfield.
For example:
- If you use the textfield for search like function, you may want to leave the clear button always visible, so if the use want to clear the text it's faster.
- If it's in a registration page, it's not really useful to have a clear button (you may press the x by mistake) because it's just one time competition.
(Sorry, my english is not the best :) )
I prefer it to appear while editing.

Is it possible to have a TextView without a system Keyboard but what i write by myself? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
I just want to use my own keyboard and input method when type word in a TextView in my own apps without jailbreak my iPhone
You can make your own view and set it as the inputView property of the text view. You'll need to write your own event handling code to update the text after each key press.
I have heard anecdotally on this site that Apple aren't too keen on keyboard replacements if your keyboard is still basically a keyboard (ie just qwerty buttons, but different shapes or looks) but if you have genuine different functionality in there you shouldn't have a problem.