
Nuestra masa en la luna es una aplicación iOS desarrollada con Swift-5.5. Es una aplicación que aprende cuántos kilos pesa el usuario y calcula cuántos kilos habríamos tenido si estuviéramos en la luna. Para encontrar nuestra masa en la luna, encontramos la masa normal dividiendo por 6.

La aplicación utiliza muchos componentes diferentes, como imagen, botón, textfield y etiqueta. El usuario podrá encontrar su masa en la luna ingresando su masa en el campo requerido y luego presionando el botón de calcular.

El usuario puede ingresar su peso y ver el equivalente mensual. El usuario solo tiene una masa que es directamente divisible por 6, ya que sería absurdo pensar que lo ha hecho, definimos los valores como dobles y realizamos las operaciones.
Escribí una publicación de blog sobre la aplicación. Puede acceder al artículo desde el siguiente enlace:
Swift -4 ile iOS Uygulaması - Aydaki ağırlığımız ne kadar?
@ IBOutlet weak var kutleText : UITextField !
@ IBOutlet weak var sonucText : UILabel !Definimos un campo de texto para obtener el valor de masa. Definimos una etiqueta para procesar el valor recibido y mostrarlo al usuario.
@ IBAction func calculate ( _ sender : Any ) {
var kutle = Double ( kutleText . text! )
var sonuc = kutle! / 6.0
sonucText . text = " Aydaki kilonuz : ( sonuc ) "
}Queremos que se tome una acción cuando se presione el botón. El valor recibido del usuario se divide por 6 y se asigna a una variable. Mostramos este valor al usuario en la pantalla. Asignamos este valor a la etiqueta de resultados.
MIT License
Copyright (c) 2022 Halil OZEL
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.