Decide to copy the interface and functionality from ios calculator app and got up to following stage. I`m trying to use lazyVgrid for buttons I can make exact same interface but without lazyVgrid...if you compile the code and run youll see that "0" is not in right shape. I tried roundedrectangle playing with cornerradius and frame width but each time I couldnt make it work with lazyVgrid.
I watched some videos on youtube who implemented calculator app nobody used lazygrids. Also functionality was overly complicated I tried to keep it simple.
Didnt finish functionality for percent,decimal and negative/positive sign. Thats why all calculations are done with Ints.
And other issue I`m trying to solve is the actual textfield that I used I want to keep it up to 9 chars as native calculator app is doing in portrait mode. I can fit some digits up to 9 chars but some cant fit I need a way to readjust the textfields frame or ???
3 files myButtons.swift for just array of buttons, ButtonView.swift for making views in foreach for each button, and contentView.
SPONSORED Let’s face it, SwiftUI previews are limited, slow, and painful. Judo takes a different approach to building visually—think Interface Builder for SwiftUI. Build your interface in a completely visual canvas, then drag and drop into your Xcode project and wire up button clicks to custom code. Download the Mac App and start your free trial today!
This topic has been closed due to inactivity, so you can't reply. Please create a new topic if you need to.
All interactions here are governed by our code of conduct.
Link copied to your pasteboard.