Контакты
Местоположение
Россия

Достижения

Все достижения (5)

Наибольший вклад в теги

Все теги (24)

Лучшие ответы пользователя

Все ответы (70)
  • Как вы используете Mac OS?

    SnapSh0t
    @SnapSh0t
    iOS-Developer
    тоже всегда пользуюсь Spotlight для поиска каких-либо программ или выполнения каких-либо операций.

    Терминал немного проапгрейдил программой "oh my Zsh" его плюсы можно найти во всемирной паутине.
    Ответ написан
  • Как сделать выпадающий список?

    SnapSh0t
    @SnapSh0t
    iOS-Developer
    Я создавал 2 динамические ячейки в TableView и на нажатие добавлял кастомную ячейку ниже.
    TabelView
    5b5efcca68b1c646755063.png5b5efd0a45f87893330570.png
    func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
            if (destinationData?[indexPath.row]) != nil {
                if(indexPath.row + 1 >= (destinationData?.count)!) {
                    expandCell(tableView: tableView, index: indexPath.row)
                }
                else {
                    if(destinationData?[indexPath.row+1] != nil) {
                        expandCell(tableView: tableView, index: indexPath.row)
                        // Close Cell (remove ExpansionCells)
                    } else {
                        contractCell(tableView: tableView, index: indexPath.row)
                    }
                }
            }
        }
        
        /*  Expand cell at given index  */
        private func expandCell(tableView: UITableView, index: Int) {
            if let infoMain = destinationData?[index]?.infoMain {
                var indexesToInsert = [IndexPath]()
                for i in 1...infoMain.count {
                    destinationData?.insert(nil, at: index + 1)
                    indexesToInsert.append(IndexPath(row: index + i, section: 0))
                }
                tableView.insertRows(at: indexesToInsert , with: .left)
                tableView.scrollToRow(at: IndexPath(row: index + 1, section: 0), at: .bottom, animated: true)
            }
        }
        
        /*  Contract cell at given index    */
        private func contractCell(tableView: UITableView, index: Int) {
            if let infoMain = destinationData?[index]?.infoMain {
                var indexesToDelete = [IndexPath]()
                for i in 1...infoMain.count {
                    destinationData?.remove(at: index + 1)
                    indexesToDelete.append(IndexPath(row: index + i, section: 0))
                }
                tableView.deleteRows(at: indexesToDelete, with: .left)
            }
        }
    Ответ написан
    Комментировать
  • Как называется этот элемент в swift?

    SnapSh0t
    @SnapSh0t
    iOS-Developer
    1*nUOQv3AjroYhqdfnMTj-pA.jpeg
    Alert
    1*Apo2oPX3FytJSikiNQEX-Q.jpeg
    func showSimpleAlert() {
            let alert = UIAlertController(title: "Sign out?", message: "You can always access your content by signing back in",         preferredStyle: UIAlertControllerStyle.alert)
    
            alert.addAction(UIAlertAction(title: "Cancel", style: UIAlertActionStyle.default, handler: { _ in
                //Cancel Action
            }))
            alert.addAction(UIAlertAction(title: "Sign out",
                                          style: UIAlertActionStyle.default,
                                          handler: {(_: UIAlertAction!) in
                                            //Sign out action
            }))
            self.present(alert, animated: true, completion: nil)
        }

    ActionSheet
    1*jGNiuYQJkck_Nvv3Ir06fg.jpeg
    func showSimpleActionSheet(controller: UIViewController) {
            let alert = UIAlertController(title: "Title", message: "Please Select an Option", preferredStyle: .actionSheet)
            alert.addAction(UIAlertAction(title: "Approve", style: .default, handler: { (_) in
                print("User click Approve button")
            }))
    
            alert.addAction(UIAlertAction(title: "Edit", style: .default, handler: { (_) in
                print("User click Edit button")
            }))
    
            alert.addAction(UIAlertAction(title: "Delete", style: .destructive, handler: { (_) in
                print("User click Delete button")
            }))
    
            alert.addAction(UIAlertAction(title: "Dismiss", style: .cancel, handler: { (_) in
                print("User click Dismiss button")
            }))
    
            self.present(alert, animated: true, completion: {
                print("completion block")
            })
        }
    Ответ написан
    Комментировать
  • С чего начать изучение Swift, будучи новичком?

    SnapSh0t
    @SnapSh0t
    iOS-Developer
    Советую купить книгу Василия Усова "SWIFT основы разработки приложений под iOS и macOS" 3-е издание. Брал уже будучи ознакомленный с языком, но некоторые моменты объясняются очень доходчиво и узнал что-то даже новое. В книге описаны основы и далее по нарастающей. Понимаю что век техники и прочее, но информация с книги для меня усваивается как то более лучше, нежеле прочитать в интернет))
    5ae20d28d89ee439316484.jpeg
    Ответ написан
    Комментировать
  • Какой эмулятор для OSX использовать в качестве запуска windows?

    SnapSh0t
    @SnapSh0t
    iOS-Developer
    Всегда работаю в Parallels, очень удобная программа в плане настройки и использования. Советую.
    Ответ написан
    Комментировать

Лучшие вопросы пользователя

Все вопросы (66)