Skip to content

Samle iOS application in Swift to implement focusing on the last chat message and correct chat offset when keyboard is visible

Notifications You must be signed in to change notification settings

kornerr/ios-chat-last-message-focus-and-keyboard-offset

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Overview

This is a sample iOS application with the following features:

  • scroll to the last message upon entering chat window
  • scroll to the last message upon receiving new message
  • lift messages when keyboard is visible
  • work with iOS11 "famous" adjusted content inset

Here's preview of the application running on:

  • iOS 10

preview

  • iOS 11 (iPhone X)

preview

Details

Here's a simplified hierarchy of most important parts of Chat VC:

  • UITabBarController
    • UINavigationController
      • UIViewController
        • UITableView
        • SendView

The application makes use of the following classes/components in External directory:

  • Keyboard
    • Provides notifications of keyboard show/hide states
    • Provides keyboard height
  • TableViewCellTemplate
    • Provides an easy way to display any view inside UITableView's cell
  • UIView+Embed
    • Embeds child view into parent one by binding corresponding top, bottom, left, right anchors
  • UIView+NibFile
    • Allows to easily load NIB (XIB) for later embedding into host UIView

About

Samle iOS application in Swift to implement focusing on the last chat message and correct chat offset when keyboard is visible

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages