How to dismiss the number pad in swift? - swift

I just started learning swift and decided to build a simple BMI calculator just to kind of learn everything. I think I've got everything working, but I can't hit the calculate button to test it because I can't get the keyboard to dismiss.
I've been looking all over the place trying to find a straight forward answer to this but can't seem to find one.
Any help is greatly appreciated. I can add my code if need be.
Also, im using Xcode 11 and SwiftUI

Related

How to create tabs dynamically in Objective C

I am trying to implement the following kind of tabs into my Application. I have first tried it with creating buttons. So can anyone guide me how to create this kind of interface ?
I want to clarify that this are the groups & it will be dynamically created & it can be in any number.
Any suggestions & references will be highly appreciated.
Thanks in advance.
I've been implementing pretty much exactly what you are asking in an app im working on, i've uploaded the source files here. its pretty much plug-and-play, just make a TabView where you want your tabs and hook up the delegate methods. can swap out all the images with your own (my tabs were underneath something and not on top so they will look upside down initially for you).
Dont really have time to explain the inner workings of it all, but if you play around with the code im sure you will manage to customise it how you want. otherwise, just learn from it and implement your own.
edit: oh and there is some code that changes how the tabs look depending if iOS 7 or not, you will get an error when first importing it because i have a variable in my appDelegate isIOS7 which you can either implement in your app, or just take out all the relevant iOS 7 checks in the code

How to Make a function calculator in Xcode 4.2?

So I need to make a simple app in Xcode 4.2, I already have the layout set, there is just one thing I'm stuck on. I need to make a calculator in which someone could input several numbers which would go into an equation then when you click submit the result pops up on the page.
For example
Estimated Hourly rate:
Estimated material cost:
Estimated Hours:
then you would click submit and on the next page you would see
Approximate cost:
Now the thing I need to know is how to use that formula in Xcode and get the next screen to display that cost. Any help is appreciated!
Start with Empty View template, in IB add labels and UITextField for each of input value, then add UIButton. Connect everything to your variables in *.h, synthesize them in *.m file. Create IBAction for UIButton, where you read values user entered in UITextFields, perform your formula then display it to user.
I would suggest to You reading some basic tutorials, it's pretty simple App.
If you are looking for a tutorial about how to make a calculator on iPhone, check
iPad and iPhone Application Development iTunes U free courses here: http://itunes.apple.com/us/itunes-u/ipad-iphone-application-development/id473757255
It is on iTunes U by Paul Hegarty from Standford University. This is a great tutorial used by lots of developers, and I highly recommand this course. The very first or two classes was how to implement a calculator. That is a simple mathmatical calculator which is probably different from what you need, but you can get some useful ideas from it.
Hope this helps.

UISplitViewController display the popover from right instead of left

So I've implemented an iPad application it has a UISplitView implemented. i'm using the slide gesture to show the popover controller instead of a bar button. the problem is that by default the popover slides in from left I want the slider to move in from the right. I've tried finding a solution to this but couldn't find anything yet so I thought i better ask this myself and see if its even possible.
I know this exists: http://mattgemmell.com/2010/07/31/mgsplitviewcontroller-for-ipad/
but im not too keen on using a 3rd party library.
If you know any possible solution or a work around please let me know. Thanks in advance.
Guess theres no other way but to use a custom made uisplitview... In the end i had to re-design my whole app and this time I had to create a custom UISplitViewController from a scratch.
Apple should be a little more flexible with their publically

animation button moving in wheel like igun pro application for first screen iphone

I am newbie I stuck on one problem i want to make animation which have buttons and moving up and down as like wheel moving.You can see the application "iGun Pro" the same animation i want to make but i am not getting how to make this it's done in core animation or used open GL for the moving buttons.I am not interested now they given animation on text.So please help me if also try to give code or some reference example so i can understand batter.I am not getting how i will search on the web for this animation .Any help appreciated Thank You.
I am very sorry for my bad English.
Can you try this. The code is pasted here for moving a wheel up and down.
You can use the same logic to move the button too.
Link is here.

How do i change color of letters of sectionIndexTitlesForTableView?

Hope you all are fine and also in best of your moods.
I have a little problem kindly help me to get its solution.
my Problem is:
I am using vertical search in my application, using method sectionIndexTitlesForTableView() of tableview i get all Character listed from top to bottom at rightside.
But this letters have fixed color. i need to change this color. Since i newbie i don't know how to deal with it.
Please help to get solution.
Thanks, and sorry if you found me with wrong english.
There is no supported way to do this. Even if you had access to the index view (which you don't easily), it would not be possible because there is no NSAttributedString on iPhone, so you couldn't return color information.
The best way to achieve this is to turn off the tableview's index and generate your own from scratch, floating it over top of the tableview. But I would not recommend this approach for a new iPhone developer. It is best to spend some serious time learning to build UIs the way Apple intends you to. Once you understand Apple's UI and how it's implemented, then you can make informed decisions about whether you should break the UI rules.