Skip to content

Instantly share code, notes, and snippets.

View d0z0's full-sized avatar
🌴
On vacation

Schubert d0z0

🌴
On vacation
  • Earth
View GitHub Profile
@d0z0
d0z0 / tableViewKeyboardHandling.m
Created May 8, 2018 07:39 — forked from TimMedcalf/tableViewKeyboardHandling.m
The easy & reliable way of handling UITableView insets when the keyboard is shown. This works unchanged no matter where the table view is on the screen (including dealing with orientation, hierarchy, container view controllers & all devices)
/*
One of the first things someone new to iOS Development finds is that dealing with the keyboard is trickier
than they think it should be. Simply changing the scrolling extents of a UITableView (or UIScrollView, or
UICollectionView) that is partially covered by they keyboard reveals a lot about the internals of how iOS
works and highlights various "gotchas" that need to be considered.
There are various ways to know that a keyboard has been shown - but observing some specific notifications
provides a reliable way to allow you to modify your views to deal with it.
//
// TwilioChatManager.m
// Floh
//
// Created by Schubert on 01/02/17.
// Copyright © 2017 Floh Network Private Limited. All rights reserved.
//
#import "TwilioChatManager.h"
#import "API.h"
- (void)doPubNubTest {
[self.client publish: @"Hello from PubNub iOS!" toChannel: @"dummy_ios_channel" storeInHistory:YES
withCompletion:^(PNPublishStatus *status) {
if (!status.isError) {
initialTime = [[NSDate date] timeIntervalSince1970];
// Message successfully published to specified channel.
}
else {