Skip to content

Instantly share code, notes, and snippets.

View arturlector's full-sized avatar

Artur Igberdin arturlector

  • Kazan
View GitHub Profile
@arturlector
arturlector / predictive_type.md
Last active February 3, 2016 09:19
Предиктивный набор

Предиктивный набор (Предсказательный)

You may disable the keyboard suggestions / autocomplete / QuickType for a UITextView which can block the text on smaller screens like the 4S as shown in this example

with the following line:

myTextView.autocorrectionType = UITextAutocorrectionTypeNo;
@arturlector
arturlector / tabbar.md
Last active February 3, 2016 19:54
TabBar

Как узнать индекс у таббара.

do you have UITabbar or UITabbarController?

if UITabbar then set tag for each item and then you see which item is selected using -

self.tabBarController.tabBar.selectedItem.tag

Реагирование на клавиатуру в custom tableview

Probably it was some sort of my mistake because of me messing with autolayouts and storyboard but I found an answer.

You have to take care of this little guy in View Controller's Attribute Inspector asvi

It must be unchecked so the default contentInset wouldn't be set after any change. After that it is just adding one-liner to viewDidLoad:

[self.tableView setContentInset:UIEdgeInsetsMake(108, 0, 0, 0)]; // 108 is only example

@arturlector
arturlector / keyboard_observer.md
Last active February 4, 2016 12:44
Keyboard Observer

Как внутри контроллера отслеживать размеры keyboard - чтобы подстраивать tableview.

- (void) addKeyboardObserver {
    
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillShow:) name:UIKeyboardWillShowNotification object:nil]; //nil - означает что observer-им всех
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardDidShow:) name:UIKeyboardDidShowNotification object:nil];
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardHidden:) name:UIKeyboardWillHideNotification object:nil];
}
@arturlector
arturlector / selection_background_cell.md
Created February 4, 2016 22:14
Selection background

При нажатии на ячейку - не подсвечиваем ее (отображаем прозрачный фон)

//Selection Background у Cell
UIImage *selectionBackground = [UIImage imageWithUIColor:[UIColor clearColor]];
UIImageView *bgview=[[UIImageView alloc] initWithImage:selectionBackground];
cell.selectedBackgroundView=bgview;
@arturlector
arturlector / ios_architecturing.md
Last active February 6, 2016 14:16
iOS Architecturing
  1. Ссылочное связывание файловой системы (файловых папок) с project navigator.

Навигация.

Расширение.

Консистентность.

@arturlector
arturlector / it_manager.md
Last active February 6, 2016 14:38
Задачи ИТ менеджера.

Функции ИТ-менеджера:

  1. определять приоритеты, очередность и значимость задач.

  2. налаживать сотрудничество в коллективе и решать спорные моменты.

  3. следить за карьерным ростом сотрудников.

@arturlector
arturlector / objc_runtime.md
Last active March 13, 2016 20:14
Objective-C Runtime. Суть Runtime? Отправка сообщений? Ассоциативные ссылки?

Как работает Objective-C Runtime? Суть Runtime? Что такое Runtime?

У нас есть класс Он открыт поэтому мы обращаемся к свойствам

Создали объектам, нажали . и выбрали свойство.

Некоторые классы спрятаны и некоторые свойства спрятаны.

@arturlector
arturlector / multi_backspace.md
Last active February 10, 2016 07:22
Multiline backspace in UITextField

Когда происходит мульти-удаление при нажатии backspace на клавиатуре.

Multiline backspace in UITextField

NSRange textFieldRange = NSMakeRange(0, [textField.text length]);
    if (NSEqualRanges(range, textFieldRange) && [string length] == 0) {
        // Game on: when you return YES from this, your field will be empty
 
@arturlector
arturlector / ios_platform_components.md
Last active August 10, 2016 19:00
iOS Platform Components

Внутренние компоненты iOS платформы? Из чего состоит iOS платформа?

Core OS (OSXKernel, Mach etc)
Core Services (Foundation, Networking etc)
Media (Core Audio, OpenAL, Quartz, Core Animation etc)
Cocoa Touch (UIKit, Camera, Controls, MapKit etc)

Core OS: