All Projects → fphilipe → Phfcomposebarview

fphilipe / Phfcomposebarview

Licence: mit
Compose bar from iOS 7 Messages.app

Projects that are alternatives of or similar to Phfcomposebarview

Security Guard
The Guard component brings many layers of authentication together, making it much easier to create complex authentication systems where you have total control.
Stars: ✭ 1,157 (-3.34%)
Mutual labels:  component
React Native Appstate Hook
React Native appSate hook
Stars: ✭ 73 (-93.9%)
Mutual labels:  component
Console
The Console component eases the creation of beautiful and testable command line interfaces.
Stars: ✭ 8,988 (+650.88%)
Mutual labels:  component
French Press Editor
☕ An offline-first rich text editor component.
Stars: ✭ 69 (-94.24%)
Mutual labels:  component
Swifttwitch
👾 The New Twitch API for iOS; wrapped in Swift goodness 👾
Stars: ✭ 72 (-93.98%)
Mutual labels:  cocoapod
Vue Router Layout
Lightweight layout resolver for Vue Router
Stars: ✭ 74 (-93.82%)
Mutual labels:  component
Vue Autonumeric
A Vue.js component that wraps the awesome autoNumeric input formatter library
Stars: ✭ 68 (-94.32%)
Mutual labels:  component
Security
The Security component provides a complete security system for your web application.
Stars: ✭ 1,195 (-0.17%)
Mutual labels:  component
Config
Configure a system using EDN files and clojure.spec
Stars: ✭ 72 (-93.98%)
Mutual labels:  component
Uskin
A front-end framework aims at developing web projects based on CSS3 and provides common components.
Stars: ✭ 74 (-93.82%)
Mutual labels:  component
React Frame Component
Render your React app to an iFrame
Stars: ✭ 1,163 (-2.84%)
Mutual labels:  component
React Json Graph
React component for rendering graphs
Stars: ✭ 71 (-94.07%)
Mutual labels:  component
Vue Breakpoint
😸 A renderless Vue.js component for composing CSS breakpoints
Stars: ✭ 74 (-93.82%)
Mutual labels:  component
Utils
🛠 Lightweight utilities for string & array manipulation, image handling, safe JSON encoding/decoding, validation, slug or strong password generating etc.
Stars: ✭ 1,158 (-3.26%)
Mutual labels:  component
Vue Standalone Component
Vuejs template to build components with livecoding, tests, documentation and demos
Stars: ✭ 75 (-93.73%)
Mutual labels:  component
Prelodr
A simple Material preloader inspired by Google Inbox.
Stars: ✭ 68 (-94.32%)
Mutual labels:  component
Http Client
The HttpClient component provides powerful methods to fetch HTTP resources synchronously or asynchronously.
Stars: ✭ 1,186 (-0.92%)
Mutual labels:  component
React Mde
📝 React Markdown Editor
Stars: ✭ 1,196 (-0.08%)
Mutual labels:  component
Component Pattern For Angular Js 1 X
Example of implementation of Component pattern for Angular JS 1.X using ES6 & Webpack
Stars: ✭ 75 (-93.73%)
Mutual labels:  component
Mao Rn Android Kit
⚙️ Android Native (ui components and modules) wrap in React Native
Stars: ✭ 74 (-93.82%)
Mutual labels:  component

PHFComposeBarView

demo

More screenshots: without text and with text.


This is a precise reconstruction of the compose bar from the iOS Messages.app, mimicking the behaviors and graphics while also allowing you to customize many aspects of it.

It basically consists of a text view, a placeholder label, a utility button located to the left of the text view, and a main button located to the right of the text view.

If you're looking for something that works with iOS 5 and 6 featuring the old look and feel, have a look at version 1.1.1.

Features

  • title of main button (the one on the right) can be changed
  • tint color of main button can be changed
  • title of the placeholder can be changed
  • placeholder is exposed as a property for further customization
  • text view is exposed as a property for further customization
  • utility button (the one on the left) can be shown by setting the utility button image (best results for gray images (~56% white) on transparent background with up to 50pt side length)
  • optional character counter when specifying a max character count (similar to typing an SMS in Messages.app; the max char count limit is not imposed)
  • uses delegation to notify of button presses
  • forwards delegation methods from the text view
  • automatically grows when text wraps
  • posts notifications and sends delegate messages about frame changes before and after the change so you can adjust your view setup
  • by default grows upwards, alternatively downwards
  • max height for growth can be specified in terms of points or line numbers
  • has a translucent blurred background

Installation

The prefered way is to use CococaPods.

pod 'PHFComposeBarView', '~> 2.0.1'

If you can't use CocoaPods for some reason (you really should though, it's the cool kid on the block), then grab the files in Classes/ and put it in your project. The code uses ARC, so make sure to turn that on for the files if you're not already using ARC. There's a dependency on PHFDelegateChain, so make sure to add that to your project, too.

Usage

The compose bar visible in the demo above was created as follows:

CGRect viewBounds = [[self view] bounds];
CGRect frame = CGRectMake(0.0f,
                          viewBounds.size.height - PHFComposeBarViewInitialHeight,
                          viewBounds.size.width,
                          PHFComposeBarViewInitialHeight);
PHFComposeBarView *composeBarView = [[PHFComposeBarView alloc] initWithFrame:frame];
[composeBarView setMaxCharCount:160];
[composeBarView setMaxLinesCount:5];
[composeBarView setPlaceholder:@"Type something..."];
[composeBarView setUtilityButtonImage:[UIImage imageNamed:@"Camera"]];
[composeBarView setDelegate:self];

To get notified of button presses, implement the optional methods from the PHFComposeBarViewDelegate protocol:

- (void)composeBarViewDidPressButton:(PHFComposeBarView *)composeBarView;
- (void)composeBarViewDidPressUtilityButton:(PHFComposeBarView *)composeBarView;

To get notified of frame changes, either listen to the notifications (PHFComposeBarViewDidChangeFrameNotification and PHFComposeBarViewWillChangeFrameNotification) or implement the optional delegate methods:

- (void)composeBarView:(PHFComposeBarView *)composeBarView
   willChangeFromFrame:(CGRect)startFrame
               toFrame:(CGRect)endFrame
              duration:(NSTimeInterval)duration
        animationCurve:(UIViewAnimationCurve)animationCurve;
- (void)composeBarView:(PHFComposeBarView *)composeBarView
    didChangeFromFrame:(CGRect)startFrame
               toFrame:(CGRect)endFrame;

Note that all methods from the UITextViewDelegate protocol are forwarded, so you can add your own behavior to the text view such as limiting the text length etc.

Refer to PHFComposeBarView.h for the available properties and their descriptions.

Small Print

License

PHFComposeBarView is released under the MIT license.

Dependencies

Author

Philipe Fatio (@fphilipe)

Sponsors

These people and companies have sponsored the development so far:

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].