Giter Club home page Giter Club logo

ios-calculator's Introduction

Welcome aboard 👋

Anurag's GitHub stats

Top Langs

ios-calculator's People

Contributors

kridan-coder avatar

Watchers

 avatar

ios-calculator's Issues

Review #1

  1. Кейсы в enum следует именовать с маленькой буквы (например, https://docs.swift.org/swift-book/LanguageGuide/Enumerations.html).

@IBAction func plusMinusButton(_ sender: UIButton) - если ссылка на кнопку внутри метода не нужна, ее можно убрать при генерации IBAction (в настройке нижнее поле Sender меняется на None).

  1. if (wasDividedByZero) - условие на Swift пишем без скобок!
  2. В enum Operation прописано rawValue (соответствующие строки). Следовательно, можно получать конкретный объект по строке с помощью конструктора (https://docs.swift.org/swift-book/LanguageGuide/Enumerations.html#ID149) и убрать вот это вот все:
 switch sender.currentTitle! {
        case "÷":
            operation = Operation.Divide
        case "x":
            operation = Operation.Multiply
        case "+":
            operation = Operation.Summarize
        case "-":
            operation = Operation.Substract
        case "%":
            operation = Operation.Remaind
        default:
            operation = Operation.Nothing
        }
  1. Подобный код:
 func basicDropShadow(button: UIButton){
        button.layer.shadowColor = #colorLiteral(red: 0.1764705926, green: 0.01176470611, blue: 0.5607843399, alpha: 1)
        button.layer.shadowOffset = CGSize(width: 1.0, height: 2.0)
        button.layer.shadowRadius = 2.0
        button.layer.cornerRadius = 4.0
    }

лучше убрать в extension для класса UIButton. Тогда он станет годным для повторного использования, то есть можно будет таскать из проекта в проект. Да и класс UIViewController к данному функционалу мало отношения имеет.

  1. Не забывай про сочетание ctrl + I для причесывания кода.
  2. На симуляторе (да и на устройстве) твои шрифты не отображаются, поскольку ты их не совсем корректно подключил. Нужно в структуре проекта создать не папку, а Group (желтая папка) и добавить файлы туда. Для каждого шрифта нужно проверить включение в Target (галочка справа).
  3. Проверь тени, у меня они не отобразились.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.