This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var body: some View { | |
VStack{ | |
ScrollView(.horizontal){ | |
HStack { | |
ForEach(names, id: \.self) {name in | |
ZStack{ | |
LinearGradient(colors: [.pink.opacity(0.5),.purple.opacity(0.7)], startPoint: .top, endPoint: .bottom) | |
.frame(width: 90, height: 90, alignment: .center) | |
.clipShape(RoundedRectangle(cornerRadius: 25)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Images' names | |
var names: [String] = ["heart.fill", | |
"star.fill", | |
"circle.hexagongrid.fill", | |
"leaf.fill", | |
"sun.max.fill", | |
"ladybug.fill", | |
"moon.fill", | |
"sparkles", | |
"snowflake" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Calculator { | |
/** | |
@return height of the view containing the keyboard buttons | |
*/ | |
static func getKeyboardHeight()->CGFloat{ | |
if UIDevice.current.userInterfaceIdiom == .phone { | |
// Portrait Landscape | |
return getWidth() < getHeight() ? 216 : 162 | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// LocalizedStrings.swift | |
// Localization | |
// | |
// Created by Federica Benacquista on 09/06/21. | |
// | |
import UIKit | |
extension String{ | |
/*Here goes the previous code, you can find it at: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// LocalizedStrings.swift | |
// Localization | |
// | |
// Created by Federica Benacquista on 09/06/21. | |
// | |
import UIKit | |
extension String{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct ScreenSize { | |
static let width = UIScreen.main.bounds.size.width | |
static let height = UIScreen.main.bounds.size.height | |
static let maxLength = max(ScreenSize.width, ScreenSize.height) //Gets the Height | |
static let minLength = min(ScreenSize.width, ScreenSize.height) //Gets the Width | |
} | |
//Contains the dimensions of the devices | |
fileprivate struct KeybDimensions{ | |
//iPod touch(7), iPhone 5, iPhone 5s, iPhone 5C, iPhone SE |