master 25af9cd5a695 cached
23 files
38.5 KB
12.2k tokens
1 requests
Download .txt
Repository: ruddfawcett/RFKeyboardToolbar
Branch: master
Commit: 25af9cd5a695
Files: 23
Total size: 38.5 KB

Directory structure:
gitextract_q6pplms_/

├── .gitignore
├── LICENSE
├── README.md
├── RFKeyboardToolbar/
│   ├── RFKeyboardToolbar.h
│   ├── RFKeyboardToolbar.m
│   ├── RFToolbarButton.h
│   └── RFToolbarButton.m
├── RFKeyboardToolbar.podspec
└── RFKeyboardToolbarDemo/
    ├── RFKeyboardToolbar/
    │   ├── AppDelegate.h
    │   ├── AppDelegate.m
    │   ├── Images.xcassets/
    │   │   ├── AppIcon.appiconset/
    │   │   │   └── Contents.json
    │   │   └── LaunchImage.launchimage/
    │   │       └── Contents.json
    │   ├── RFKeyboardToolbarDemo-Info.plist
    │   ├── RFKeyboardToolbarDemo-Prefix.pch
    │   ├── ViewController.h
    │   ├── ViewController.m
    │   ├── en.lproj/
    │   │   └── InfoPlist.strings
    │   └── main.m
    ├── RFKeyboardToolbarDemo.xcodeproj/
    │   ├── project.pbxproj
    │   └── project.xcworkspace/
    │       └── contents.xcworkspacedata
    └── RFKeyboardToolbarTests/
        ├── RFKeyboardToolbarDemoTests-Info.plist
        ├── RFKeyboardToolbarTests.m
        └── en.lproj/
            └── InfoPlist.strings

================================================
FILE CONTENTS
================================================

================================================
FILE: .gitignore
================================================
# Xcode
.DS_Store
*/build/*
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
xcuserdata
profile
*.moved-aside
DerivedData
.idea/
*.hmap
*.xccheckout

#CocoaPods
Pods


================================================
FILE: LICENSE
================================================
The MIT License (MIT)

Copyright (c) 2013-2015 Rudd Fawcett

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


================================================
FILE: README.md
================================================
RFKeyboardToolbar<br /> [![RFGravatarImageView Version](http://img.shields.io/cocoapods/v/RFKeyboardToolbar.svg?style=flat)](http://cocoadocs.org/docsets/RFGravatarImageView/1.1/) ![License MIT](http://img.shields.io/badge/license-MIT-orange.svg?style=flat) ![reposs](https://reposs.herokuapp.com/?path=ruddfawcett/RFKeyboardToolbar&style=flat)
====================
This is a flexible UIView and UIButton subclass to add customized buttons and toolbars to your UITextFields/UITextViews.  This project was inspired by the toolbar seen in [iOctocat](http://ioctocat.com).

## Installation

### Installation with CocoaPods

[CocoaPods](http://cocoapods.org) is a dependency manager for Objective-C, which automates and simplifies the process of using 3rd-party libraries like RFKeyboardToolbar in your projects.

#### Podfile

```ruby
platform :ios, '7.0'
pod "RFKeyboardToolbar", "~> 1.3"
```

### Installation without CocoaPods

Just drag the RFKeyboardToolbar folder into your project and import it.

```obj-c
#import 'RFKeyboardToolbar.h'
```

## Use

RFKeyboardToolbar is pretty easy to use with your UITextFields or UITextViews.  After you've imported `RFKeyboardToolbar`, you can add a toolbar to anything that has an inputAccessoryView.  

I've commented on the initialization below, to help you get a better understanding of it.

```obj-c
// Create a new RFToolbarButton
RFToolbarButton *exampleButton = [RFToolbarButton buttonWithTitle:@"Example"];

// Add a button target to the exampleButton
[exampleButton addEventHandler:^{
    // Do anything in this block here
    [_textView insertText:@"You pressed a button!"];
} forControlEvents:UIControlEventTouchUpInside];

// Create an RFKeyboardToolbar, adding all of your buttons, and set it as your inputAcessoryView
_textView.inputAccessoryView = [RFKeyboardToolbar toolbarWithButtons:@[exampleButton]];

// Add the UITextView/UITextField
[self.view addSubview:_textView];
```

Hope you enjoy it!  Please Fork and send Pull Requests!

## Screenshots

![RFMarkdownTextView](http://i.imgur.com/NEAocbW.png)

## Contributors
- [Rudd Fawcett (@ruddfawcett)] (https://github.com/ruddfawcett) - Creator
- [Brandon Butler (@Hackmodford)] (https://github.com/Hackmodford)
- [Jesús A. Álvarez (@zydeco)] (https://github.com/zydeco)

## License

RFKeyboardToolbar is available under the MIT license. See the LICENSE file for more info.


================================================
FILE: RFKeyboardToolbar/RFKeyboardToolbar.h
================================================
//
//  RFKeyboardToolbar.h
//
//  Created by Rudd Fawcett on 12/3/13.
//  Copyright (c) 2013 Rudd Fawcett. All rights reserved.
//

#import <UIKit/UIKit.h>
#include <AvailabilityMacros.h>

#import "RFToolbarButton.h"

@interface RFKeyboardToolbar : UIView

/**
 *  The buttons of the toolbar.
 */
@property (nonatomic, strong) NSArray *buttons;

/**
 *  Creates a new toolbar.
 *
 *  @param buttons The buttons to draw in the view.
 *
 *  @return A RFKeyboardToolbar.
 */
+ (instancetype)toolbarWithButtons:(NSArray *)buttons;

/**
 *  Creates a new toolbar.
 *
 *  @param buttons The buttons to draw in the view.
 *
 *  @return A RFKeyboardToolbar.
 */
+ (instancetype)toolbarViewWithButtons:(NSArray *)buttons DEPRECATED_MSG_ATTRIBUTE("This will still work, but there's a shorter method available, toolbarWithButtons:");

/**
 *  
 *
 *  @param buttons  Sets the buttons for the toolbar.
 *  @param animated Whether or not it should be animated.
 */
- (void)setButtons:(NSArray *)buttons animated:(BOOL)animated;

@end


================================================
FILE: RFKeyboardToolbar/RFKeyboardToolbar.m
================================================
//
//  RFKeyboardToolbar.m
//
//  Created by Rudd Fawcett on 12/3/13.
//  Copyright (c) 2013 Rudd Fawcett. All rights reserved.
//

#import "RFKeyboardToolbar.h"

@interface RFKeyboardToolbar ()

/**
 *  The toolbar view.
 */
@property (nonatomic,strong) UIView *toolbarView;
/**
 *  The scroll view that's faked to look like a toolbar.
 */
@property (nonatomic,strong) UIScrollView *scrollView;
/**
 *  The fake top border to replicate the toolbar.
 */
@property (nonatomic,strong) CALayer *topBorder;

@end

@implementation RFKeyboardToolbar

+ (instancetype)toolbarWithButtons:(NSArray *)buttons {
    return [[RFKeyboardToolbar alloc] initWithButtons:buttons];
}

+ (instancetype)toolbarViewWithButtons:(NSArray *)buttons {
    return [[RFKeyboardToolbar alloc] initWithButtons:buttons];
}

- (id)initWithButtons:(NSArray *)buttons {
    self = [super initWithFrame:CGRectMake(0, 0, self.window.rootViewController.view.bounds.size.width, 40)];
    if (self) {
        _buttons = [buttons copy];
        
        self.autoresizingMask = UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleHeight;
        [self addSubview:[self inputAccessoryView]];
    }
    return self;
}

- (void)layoutSubviews {
    CGRect frame = _toolbarView.bounds;
    frame.size.height = 0.5f;
    
    _topBorder.frame = frame;
}

- (UIView *)inputAccessoryView {
    _toolbarView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, self.bounds.size.width, 40)];
    _toolbarView.backgroundColor = [UIColor colorWithWhite:0.973 alpha:1.0];
    _toolbarView.autoresizingMask = UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleHeight;
    
    _topBorder = [CALayer layer];
    _topBorder.frame = CGRectMake(0.0f, 0.0f, self.bounds.size.width, 0.5f);
    _topBorder.backgroundColor = [UIColor colorWithWhite:0.678 alpha:1.0].CGColor;
    
    [_toolbarView.layer addSublayer:_topBorder];
    [_toolbarView addSubview:[self fakeToolbar]];
    
    return _toolbarView;
}

- (UIScrollView *)fakeToolbar {
    _scrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 0, self.bounds.size.width, 40)];
    _scrollView.backgroundColor = [UIColor clearColor];
    _scrollView.autoresizingMask = UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleHeight;
    _scrollView.showsHorizontalScrollIndicator = NO;
    _scrollView.contentInset = UIEdgeInsetsMake(6.0f, 0.0f, 8.0f, 6.0f);
    
    [self addButtons];
    
    return _scrollView;
}

- (void)addButtons {
    NSUInteger index = 0;
    NSUInteger originX = 8;
    
    CGRect originFrame;
    
    for (RFToolbarButton *eachButton in _buttons) {
        originFrame = CGRectMake(originX, 0, eachButton.frame.size.width, eachButton.frame.size.height);
        eachButton.frame = originFrame;
        
        [_scrollView addSubview:eachButton];
        
        originX = originX + eachButton.bounds.size.width + 8;
        index++;
    }
    
    CGSize contentSize = _scrollView.contentSize;
    contentSize.width = originX - 8;
    _scrollView.contentSize = contentSize;
}

- (void)setButtons:(NSArray *)buttons {
    [_buttons makeObjectsPerformSelector:@selector(removeFromSuperview)];
    _buttons = [buttons copy];
    [self addButtons];
}

- (void)setButtons:(NSArray *)buttons animated:(BOOL)animated {
    if (!animated) {
        self.buttons = buttons;
        return;
    }
    
    NSMutableSet *removeButtons = [NSMutableSet setWithArray:_buttons];
    [removeButtons minusSet:[NSSet setWithArray:buttons]];
    NSMutableSet *addButtons = [NSMutableSet setWithArray:buttons];
    [addButtons minusSet:[NSSet setWithArray:_buttons]];
    _buttons = [buttons copy];
    
    // calculate end frames
    NSUInteger originX = 8;
    NSUInteger index = 0;
    NSMutableArray *buttonFrames = [NSMutableArray arrayWithCapacity:_buttons.count];
    
    for (RFToolbarButton *button in _buttons) {
        CGRect frame = CGRectMake(originX, 0, button.frame.size.width, button.frame.size.height);
        [buttonFrames addObject:[NSValue valueWithCGRect:frame]];
        
        originX += button.bounds.size.width + 8;
        index++;
    }
    
    CGSize contentSize = _scrollView.contentSize;
    contentSize.width = originX - 8;
    if (contentSize.width > _scrollView.contentSize.width) {
        _scrollView.contentSize = contentSize;
    }
    
    // make added buttons appear from the right
    [addButtons enumerateObjectsUsingBlock:^(RFToolbarButton *button, BOOL *stop) {
        button.frame = CGRectMake(originX, 0, button.frame.size.width, button.frame.size.height);
        [_scrollView addSubview:button];
    }];
    
    // animate
    [UIView animateWithDuration:0.2 animations:^{
        [removeButtons enumerateObjectsUsingBlock:^(RFToolbarButton *button, BOOL *stop) {
            button.alpha = 0;
        }];
        
        [_buttons enumerateObjectsUsingBlock:^(RFToolbarButton *button, NSUInteger idx, BOOL *stop) {
            button.frame = [buttonFrames[idx] CGRectValue];
        }];
        
        _scrollView.contentSize = contentSize;
    } completion:^(BOOL finished) {
        [removeButtons makeObjectsPerformSelector:@selector(removeFromSuperview)];
    }];
}

@end


================================================
FILE: RFKeyboardToolbar/RFToolbarButton.h
================================================
//
//  RFToolbarButton.h
//
//  Created by Rudd Fawcett on 12/3/13.
//  Copyright (c) 2013 Rudd Fawcett. All rights reserved.
//

#import <UIKit/UIKit.h>

/**
 *  The block used for each button.
 */
typedef void (^eventHandlerBlock)(void);

@interface RFToolbarButton : UIButton

/**
 *  Creates a new RFToolbarButton.
 *
 *  @param title The string to show on the button.
 *
 *  @return A new button.
 */
+ (instancetype)buttonWithTitle:(NSString *)title;

/**
 *  Creates a new RFToolbarButton.
 *
 *  @param title        The string to show on the button.
 *  @param eventHandler The event handler block.
 *  @param controlEvent The type of event.
 *
 *  @return A new button.
 */
+ (instancetype)buttonWithTitle:(NSString *)title andEventHandler:(eventHandlerBlock)eventHandler forControlEvents:(UIControlEvents)controlEvent;

/**
 *  Adds the event handler for the button.
 *
 *  @param eventHandler The event handler block.
 *  @param controlEvent The type of event.
 */
- (void)addEventHandler:(eventHandlerBlock)eventHandler forControlEvents:(UIControlEvents)controlEvent;

@end


================================================
FILE: RFKeyboardToolbar/RFToolbarButton.m
================================================
//
//  RFToolbarButton.m
//
//  Created by Rudd Fawcett on 12/3/13.
//  Copyright (c) 2013 Rudd Fawcett. All rights reserved.
//

#import "RFToolbarButton.h"

@interface RFToolbarButton ()

/**
 *  The button's title.
 */
@property (nonatomic, strong) NSString *title;

/**
 *  The button's event block.
 */
@property (nonatomic, copy) eventHandlerBlock buttonPressBlock;

@end

@implementation RFToolbarButton

+ (instancetype)buttonWithTitle:(NSString *)title {
    return [[self alloc] initWithTitle:title];
}

+ (instancetype)buttonWithTitle:(NSString *)title andEventHandler:(eventHandlerBlock)eventHandler forControlEvents:(UIControlEvents)controlEvent {
    RFToolbarButton *newButton = [RFToolbarButton buttonWithTitle:title];
    [newButton addEventHandler:eventHandler forControlEvents:controlEvent];
    
    return newButton;
}

- (id)initWithTitle:(NSString *)title {
    _title = title;
    return [self init];
}

- (id)init {
    CGSize sizeOfText = [self.title sizeWithAttributes:@{NSFontAttributeName:[UIFont boldSystemFontOfSize:14.f]}];
    
    if (self = [super initWithFrame:CGRectMake(0, 0, sizeOfText.width + 18.104, sizeOfText.height + 10.298)]) {
        self.backgroundColor = [UIColor colorWithWhite:0.902 alpha:1.0];
        
        self.layer.cornerRadius = 3.0f;
        self.layer.borderWidth = 1.0f;
        self.layer.borderColor = [UIColor colorWithWhite:0.8 alpha:1.0].CGColor;
        
        [self setTitle:self.title forState:UIControlStateNormal];
        [self setTitleColor:[UIColor colorWithWhite:0.500 alpha:1.0] forState:UIControlStateNormal];
        
        self.titleLabel.font = [UIFont boldSystemFontOfSize:14.f];
        self.titleLabel.textColor = [UIColor colorWithWhite:0.500 alpha:1.0];
    }
    return self;
}

- (void)addEventHandler:(eventHandlerBlock)eventHandler forControlEvents:(UIControlEvents)controlEvent {
    self.buttonPressBlock = eventHandler;
    [self addTarget:self action:@selector(buttonPressed) forControlEvents:controlEvent];
}

- (void)buttonPressed {
    self.buttonPressBlock();
}

@end


================================================
FILE: RFKeyboardToolbar.podspec
================================================
Pod::Spec.new do |s|
  s.name         = 'RFKeyboardToolbar'
  s.version      = '1.3'
  s.summary      = 'A flexible UIView and UIButton subclass to add customized buttons and toolbars to your UITextFields/UITextViews.'
  s.homepage     = 'https://github.com/ruddfawcett/RFKeyboardToolbar'
  s.license      = 'MIT'
  s.license      = { :type => 'MIT', :file => 'LICENSE' }
  s.author       = { 'Rudd Fawcett' => 'rudd.fawcett@gmail.com' }
  s.social_media_url = 'https://twitter.com/ruddfawcett'
  s.platform     = :ios, '7.0'
  s.source       = { :git => 'https://github.com/ruddfawcett/RFKeyboardToolbar.git', :tag => 'v1.3' }
  s.source_files  = 'RFKeyboardToolbar/*'
  s.requires_arc = true
end


================================================
FILE: RFKeyboardToolbarDemo/RFKeyboardToolbar/AppDelegate.h
================================================
//
//  AppDelegate.h
//  RFKeyboardToolbarDemo
//
//  Created by Rudd Fawcett on 12/3/13.
//  Copyright (c) 2013 Rudd Fawcett. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "ViewController.h"

@interface AppDelegate : UIResponder <UIApplicationDelegate>

@property (strong, nonatomic) UIWindow *window;

@end


================================================
FILE: RFKeyboardToolbarDemo/RFKeyboardToolbar/AppDelegate.m
================================================
//
//  AppDelegate.m
//  RFKeyboardToolbarDemo
//
//  Created by Rudd Fawcett on 12/3/13.
//  Copyright (c) 2013 Rudd Fawcett. All rights reserved.
//

#import "AppDelegate.h"

@implementation AppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
    
    ViewController *viewController = [[ViewController alloc] init];
    viewController.view.backgroundColor = [UIColor whiteColor];
    
    UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:viewController];
    
    self.window.rootViewController = navController;
    
    [self.window makeKeyAndVisible];
    return YES;
}

@end


================================================
FILE: RFKeyboardToolbarDemo/RFKeyboardToolbar/Images.xcassets/AppIcon.appiconset/Contents.json
================================================
{
  "images" : [
    {
      "idiom" : "iphone",
      "size" : "29x29",
      "scale" : "2x"
    },
    {
      "idiom" : "iphone",
      "size" : "40x40",
      "scale" : "2x"
    },
    {
      "idiom" : "iphone",
      "size" : "60x60",
      "scale" : "2x"
    }
  ],
  "info" : {
    "version" : 1,
    "author" : "xcode"
  }
}

================================================
FILE: RFKeyboardToolbarDemo/RFKeyboardToolbar/Images.xcassets/LaunchImage.launchimage/Contents.json
================================================
{
  "images" : [
    {
      "orientation" : "portrait",
      "idiom" : "iphone",
      "extent" : "full-screen",
      "minimum-system-version" : "7.0",
      "scale" : "2x"
    },
    {
      "orientation" : "portrait",
      "idiom" : "iphone",
      "subtype" : "retina4",
      "extent" : "full-screen",
      "minimum-system-version" : "7.0",
      "scale" : "2x"
    }
  ],
  "info" : {
    "version" : 1,
    "author" : "xcode"
  }
}

================================================
FILE: RFKeyboardToolbarDemo/RFKeyboardToolbar/RFKeyboardToolbarDemo-Info.plist
================================================
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>CFBundleDevelopmentRegion</key>
	<string>en</string>
	<key>CFBundleDisplayName</key>
	<string>${PRODUCT_NAME}</string>
	<key>CFBundleExecutable</key>
	<string>${EXECUTABLE_NAME}</string>
	<key>CFBundleIdentifier</key>
	<string>com.ruddfawcett.${PRODUCT_NAME:rfc1034identifier}</string>
	<key>CFBundleInfoDictionaryVersion</key>
	<string>6.0</string>
	<key>CFBundleName</key>
	<string>${PRODUCT_NAME}</string>
	<key>CFBundlePackageType</key>
	<string>APPL</string>
	<key>CFBundleShortVersionString</key>
	<string>1.0</string>
	<key>CFBundleSignature</key>
	<string>????</string>
	<key>CFBundleVersion</key>
	<string>1.0</string>
	<key>LSRequiresIPhoneOS</key>
	<true/>
	<key>UIRequiredDeviceCapabilities</key>
	<array>
		<string>armv7</string>
	</array>
	<key>UISupportedInterfaceOrientations</key>
	<array>
		<string>UIInterfaceOrientationPortrait</string>
		<string>UIInterfaceOrientationLandscapeLeft</string>
		<string>UIInterfaceOrientationLandscapeRight</string>
	</array>
</dict>
</plist>


================================================
FILE: RFKeyboardToolbarDemo/RFKeyboardToolbar/RFKeyboardToolbarDemo-Prefix.pch
================================================
//
//  Prefix header
//
//  The contents of this file are implicitly included at the beginning of every source file.
//

#import <Availability.h>

#ifndef __IPHONE_5_0
#warning "This project uses features only available in iOS SDK 5.0 and later."
#endif

#ifdef __OBJC__
    #import <UIKit/UIKit.h>
    #import <Foundation/Foundation.h>
#endif


================================================
FILE: RFKeyboardToolbarDemo/RFKeyboardToolbar/ViewController.h
================================================
//
//  ViewController.h
//  RFKeyboardToolbarDemo
//
//  Created by Rudd Fawcett on 12/3/13.
//  Copyright (c) 2013 Rudd Fawcett. All rights reserved.
//

#import <UIKit/UIKit.h>

@class RFKeyboardToolbar;

@interface ViewController : UIViewController <UITextViewDelegate>

@end


================================================
FILE: RFKeyboardToolbarDemo/RFKeyboardToolbar/ViewController.m
================================================
//
//  ViewController.m
//  RFKeyboardToolbarDemo
//
//  Created by Rudd Fawcett on 12/3/13.
//  Copyright (c) 2013 Rudd Fawcett. All rights reserved.
//

#import "ViewController.h"
#import "RFKeyboardToolbar.h"

@interface ViewController ()

@property (strong, nonatomic) UITextView *textView;
@property (strong, nonatomic) RFKeyboardToolbar *keyboardToolbar;

@end

@implementation UITextView (InsertWord)

- (void)insertWord:(NSString*)word {
    // insert a word into the field, adding a space before and/or after it as necessary
    NSCharacterSet *whitespace = [NSCharacterSet whitespaceAndNewlineCharacterSet];
    NSRange selectedRange = self.selectedRange;
    NSString *text = self.text;
    BOOL hasSpaceBefore = selectedRange.location == 0 || [whitespace characterIsMember:[text characterAtIndex:selectedRange.location-1]];
    BOOL hasSpaceAfter = selectedRange.location+selectedRange.length == text.length || [whitespace characterIsMember:[text characterAtIndex:selectedRange.location+selectedRange.length]];
    
    NSMutableString *wordText = word.mutableCopy;
    if (!hasSpaceBefore) [wordText insertString:@" " atIndex:0];
    if (!hasSpaceAfter) [wordText appendString:@" "];
    [self insertText:wordText];
}

@end

@implementation ViewController

- (void)viewDidLoad
{
    [super viewDidLoad];
    
    self.title = @"RFKeyboardToolbar";
    
    _textView = [[UITextView alloc] initWithFrame:self.view.bounds];
    
    NSMutableArray *buttons = NSMutableArray.array;
    
    NSNumberFormatter *numberFormatter = [NSNumberFormatter new];
    [numberFormatter setNumberStyle:NSNumberFormatterSpellOutStyle];
    
    for (int i = 1; i <= 20; i++) {
        RFToolbarButton *button = [RFToolbarButton buttonWithTitle:[numberFormatter stringFromNumber:@(i)] andEventHandler:^{
            [_textView insertText:@"You pressed a button!"];
        } forControlEvents:UIControlEventTouchUpInside];
        
        [buttons addObject:button];
    }
    
    _keyboardToolbar = [RFKeyboardToolbar toolbarWithButtons:buttons];
    _textView.inputAccessoryView = _keyboardToolbar;
    _textView.delegate = self;
    
    [self.view addSubview:_textView];
}

- (void)textViewDidChange:(UITextView *)textView {
    // count words
    NSArray *allWords = [textView.text.lowercaseString componentsSeparatedByCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
    NSCountedSet *words = [NSCountedSet new];
    for (__strong NSString *word in allWords) {
        word = [word stringByTrimmingCharactersInSet:[NSCharacterSet punctuationCharacterSet]];
        if (word.length == 0) continue;
        [words addObject:word];
    }
    
    // dictionary of existing words => buttons
    NSDictionary *oldButtons = [NSDictionary dictionaryWithObjects:_keyboardToolbar.buttons forKeys:[_keyboardToolbar.buttons valueForKey:@"title"]];
    
    // create new buttons
    NSMutableArray *newButtons = [NSMutableArray arrayWithCapacity:words.count];
    for (NSString *word in words) {
        // create or reuse button
        RFToolbarButton *button = oldButtons[word];
        if (button == nil) {
            button = [RFToolbarButton buttonWithTitle:word];
            [button addEventHandler:^{
                [_textView insertWord:word];
            } forControlEvents:UIControlEventTouchUpInside];
        }
        [newButtons addObject:button];
    }
    
    // sort by frequency and alphabetically
    [newButtons sortUsingComparator:^NSComparisonResult(id obj1, id obj2) {
        NSUInteger count1 = [words countForObject:[obj1 title]];
        NSUInteger count2 = [words countForObject:[obj2 title]];
        if (count1 == count2) return [[obj1 title] compare:[obj2 title]];
        return count1 > count2 ? NSOrderedAscending : NSOrderedDescending;
    }];
    [_keyboardToolbar setButtons:newButtons animated:YES];
}

@end


================================================
FILE: RFKeyboardToolbarDemo/RFKeyboardToolbar/en.lproj/InfoPlist.strings
================================================
/* Localized versions of Info.plist keys */



================================================
FILE: RFKeyboardToolbarDemo/RFKeyboardToolbar/main.m
================================================
//
//  main.m
//  RFKeyboardToolbarDemo
//
//  Created by Rudd Fawcett on 12/3/13.
//  Copyright (c) 2013 Rudd Fawcett. All rights reserved.
//

#import <UIKit/UIKit.h>

#import "AppDelegate.h"

int main(int argc, char * argv[])
{
    @autoreleasepool {
        return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
    }
}


================================================
FILE: RFKeyboardToolbarDemo/RFKeyboardToolbarDemo.xcodeproj/project.pbxproj
================================================
// !$*UTF8*$!
{
	archiveVersion = 1;
	classes = {
	};
	objectVersion = 46;
	objects = {

/* Begin PBXBuildFile section */
		CEEF0E23184E157600B7DEDF /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CEEF0E22184E157600B7DEDF /* Foundation.framework */; };
		CEEF0E25184E157600B7DEDF /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CEEF0E24184E157600B7DEDF /* CoreGraphics.framework */; };
		CEEF0E27184E157600B7DEDF /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CEEF0E26184E157600B7DEDF /* UIKit.framework */; };
		CEEF0E2D184E157600B7DEDF /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = CEEF0E2B184E157600B7DEDF /* InfoPlist.strings */; };
		CEEF0E2F184E157600B7DEDF /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = CEEF0E2E184E157600B7DEDF /* main.m */; };
		CEEF0E33184E157600B7DEDF /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = CEEF0E32184E157600B7DEDF /* AppDelegate.m */; };
		CEEF0E39184E157600B7DEDF /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = CEEF0E38184E157600B7DEDF /* ViewController.m */; };
		CEEF0E3B184E157600B7DEDF /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = CEEF0E3A184E157600B7DEDF /* Images.xcassets */; };
		CEEF0E71184E9AED00B7DEDF /* RFKeyboardToolbar.m in Sources */ = {isa = PBXBuildFile; fileRef = CEEF0E6E184E9AED00B7DEDF /* RFKeyboardToolbar.m */; };
		CEEF0E72184E9AED00B7DEDF /* RFToolbarButton.m in Sources */ = {isa = PBXBuildFile; fileRef = CEEF0E70184E9AED00B7DEDF /* RFToolbarButton.m */; };
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
		CEEF0E1F184E157600B7DEDF /* RFKeyboardToolbarDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = RFKeyboardToolbarDemo.app; sourceTree = BUILT_PRODUCTS_DIR; };
		CEEF0E22184E157600B7DEDF /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
		CEEF0E24184E157600B7DEDF /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
		CEEF0E26184E157600B7DEDF /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
		CEEF0E2A184E157600B7DEDF /* RFKeyboardToolbarDemo-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "RFKeyboardToolbarDemo-Info.plist"; sourceTree = "<group>"; };
		CEEF0E2C184E157600B7DEDF /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
		CEEF0E2E184E157600B7DEDF /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
		CEEF0E30184E157600B7DEDF /* RFKeyboardToolbarDemo-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "RFKeyboardToolbarDemo-Prefix.pch"; sourceTree = "<group>"; };
		CEEF0E31184E157600B7DEDF /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
		CEEF0E32184E157600B7DEDF /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
		CEEF0E37184E157600B7DEDF /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = "<group>"; };
		CEEF0E38184E157600B7DEDF /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = "<group>"; };
		CEEF0E3A184E157600B7DEDF /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = "<group>"; };
		CEEF0E41184E157600B7DEDF /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; };
		CEEF0E49184E157600B7DEDF /* RFKeyboardToolbarDemoTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "RFKeyboardToolbarDemoTests-Info.plist"; sourceTree = "<group>"; };
		CEEF0E4B184E157600B7DEDF /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
		CEEF0E4D184E157600B7DEDF /* RFKeyboardToolbarTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RFKeyboardToolbarTests.m; sourceTree = "<group>"; };
		CEEF0E6D184E9AED00B7DEDF /* RFKeyboardToolbar.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RFKeyboardToolbar.h; sourceTree = "<group>"; };
		CEEF0E6E184E9AED00B7DEDF /* RFKeyboardToolbar.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RFKeyboardToolbar.m; sourceTree = "<group>"; };
		CEEF0E6F184E9AED00B7DEDF /* RFToolbarButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RFToolbarButton.h; sourceTree = "<group>"; };
		CEEF0E70184E9AED00B7DEDF /* RFToolbarButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RFToolbarButton.m; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
		CEEF0E1C184E157600B7DEDF /* Frameworks */ = {
			isa = PBXFrameworksBuildPhase;
			buildActionMask = 2147483647;
			files = (
				CEEF0E25184E157600B7DEDF /* CoreGraphics.framework in Frameworks */,
				CEEF0E27184E157600B7DEDF /* UIKit.framework in Frameworks */,
				CEEF0E23184E157600B7DEDF /* Foundation.framework in Frameworks */,
			);
			runOnlyForDeploymentPostprocessing = 0;
		};
/* End PBXFrameworksBuildPhase section */

/* Begin PBXGroup section */
		CEEF0E16184E157600B7DEDF = {
			isa = PBXGroup;
			children = (
				CEEF0E28184E157600B7DEDF /* RFKeyboardToolbarDemo */,
				CEEF0E47184E157600B7DEDF /* RFKeyboardToolbarTests */,
				CEEF0E21184E157600B7DEDF /* Frameworks */,
				CEEF0E20184E157600B7DEDF /* Products */,
			);
			sourceTree = "<group>";
		};
		CEEF0E20184E157600B7DEDF /* Products */ = {
			isa = PBXGroup;
			children = (
				CEEF0E1F184E157600B7DEDF /* RFKeyboardToolbarDemo.app */,
			);
			name = Products;
			sourceTree = "<group>";
		};
		CEEF0E21184E157600B7DEDF /* Frameworks */ = {
			isa = PBXGroup;
			children = (
				CEEF0E22184E157600B7DEDF /* Foundation.framework */,
				CEEF0E24184E157600B7DEDF /* CoreGraphics.framework */,
				CEEF0E26184E157600B7DEDF /* UIKit.framework */,
				CEEF0E41184E157600B7DEDF /* XCTest.framework */,
			);
			name = Frameworks;
			sourceTree = "<group>";
		};
		CEEF0E28184E157600B7DEDF /* RFKeyboardToolbarDemo */ = {
			isa = PBXGroup;
			children = (
				CEEF0E31184E157600B7DEDF /* AppDelegate.h */,
				CEEF0E32184E157600B7DEDF /* AppDelegate.m */,
				CEEF0E37184E157600B7DEDF /* ViewController.h */,
				CEEF0E38184E157600B7DEDF /* ViewController.m */,
				CEEF0E3A184E157600B7DEDF /* Images.xcassets */,
				CEEF0E6C184E9AED00B7DEDF /* RFKeyboardToolbar */,
				CEEF0E29184E157600B7DEDF /* Supporting Files */,
			);
			name = RFKeyboardToolbarDemo;
			path = RFKeyboardToolbar;
			sourceTree = "<group>";
		};
		CEEF0E29184E157600B7DEDF /* Supporting Files */ = {
			isa = PBXGroup;
			children = (
				CEEF0E2A184E157600B7DEDF /* RFKeyboardToolbarDemo-Info.plist */,
				CEEF0E2B184E157600B7DEDF /* InfoPlist.strings */,
				CEEF0E2E184E157600B7DEDF /* main.m */,
				CEEF0E30184E157600B7DEDF /* RFKeyboardToolbarDemo-Prefix.pch */,
			);
			name = "Supporting Files";
			sourceTree = "<group>";
		};
		CEEF0E47184E157600B7DEDF /* RFKeyboardToolbarTests */ = {
			isa = PBXGroup;
			children = (
				CEEF0E4D184E157600B7DEDF /* RFKeyboardToolbarTests.m */,
				CEEF0E48184E157600B7DEDF /* Supporting Files */,
			);
			path = RFKeyboardToolbarTests;
			sourceTree = "<group>";
		};
		CEEF0E48184E157600B7DEDF /* Supporting Files */ = {
			isa = PBXGroup;
			children = (
				CEEF0E49184E157600B7DEDF /* RFKeyboardToolbarDemoTests-Info.plist */,
				CEEF0E4A184E157600B7DEDF /* InfoPlist.strings */,
			);
			name = "Supporting Files";
			sourceTree = "<group>";
		};
		CEEF0E6C184E9AED00B7DEDF /* RFKeyboardToolbar */ = {
			isa = PBXGroup;
			children = (
				CEEF0E6D184E9AED00B7DEDF /* RFKeyboardToolbar.h */,
				CEEF0E6E184E9AED00B7DEDF /* RFKeyboardToolbar.m */,
				CEEF0E6F184E9AED00B7DEDF /* RFToolbarButton.h */,
				CEEF0E70184E9AED00B7DEDF /* RFToolbarButton.m */,
			);
			name = RFKeyboardToolbar;
			path = ../../RFKeyboardToolbar;
			sourceTree = "<group>";
		};
/* End PBXGroup section */

/* Begin PBXNativeTarget section */
		CEEF0E1E184E157600B7DEDF /* RFKeyboardToolbarDemo */ = {
			isa = PBXNativeTarget;
			buildConfigurationList = CEEF0E51184E157600B7DEDF /* Build configuration list for PBXNativeTarget "RFKeyboardToolbarDemo" */;
			buildPhases = (
				CEEF0E1B184E157600B7DEDF /* Sources */,
				CEEF0E1C184E157600B7DEDF /* Frameworks */,
				CEEF0E1D184E157600B7DEDF /* Resources */,
			);
			buildRules = (
			);
			dependencies = (
			);
			name = RFKeyboardToolbarDemo;
			productName = RFKeyboardToolbar;
			productReference = CEEF0E1F184E157600B7DEDF /* RFKeyboardToolbarDemo.app */;
			productType = "com.apple.product-type.application";
		};
/* End PBXNativeTarget section */

/* Begin PBXProject section */
		CEEF0E17184E157600B7DEDF /* Project object */ = {
			isa = PBXProject;
			attributes = {
				LastUpgradeCheck = 0500;
				ORGANIZATIONNAME = "Rex Finn";
			};
			buildConfigurationList = CEEF0E1A184E157600B7DEDF /* Build configuration list for PBXProject "RFKeyboardToolbarDemo" */;
			compatibilityVersion = "Xcode 3.2";
			developmentRegion = English;
			hasScannedForEncodings = 0;
			knownRegions = (
				en,
				Base,
			);
			mainGroup = CEEF0E16184E157600B7DEDF;
			productRefGroup = CEEF0E20184E157600B7DEDF /* Products */;
			projectDirPath = "";
			projectRoot = "";
			targets = (
				CEEF0E1E184E157600B7DEDF /* RFKeyboardToolbarDemo */,
			);
		};
/* End PBXProject section */

/* Begin PBXResourcesBuildPhase section */
		CEEF0E1D184E157600B7DEDF /* Resources */ = {
			isa = PBXResourcesBuildPhase;
			buildActionMask = 2147483647;
			files = (
				CEEF0E3B184E157600B7DEDF /* Images.xcassets in Resources */,
				CEEF0E2D184E157600B7DEDF /* InfoPlist.strings in Resources */,
			);
			runOnlyForDeploymentPostprocessing = 0;
		};
/* End PBXResourcesBuildPhase section */

/* Begin PBXSourcesBuildPhase section */
		CEEF0E1B184E157600B7DEDF /* Sources */ = {
			isa = PBXSourcesBuildPhase;
			buildActionMask = 2147483647;
			files = (
				CEEF0E39184E157600B7DEDF /* ViewController.m in Sources */,
				CEEF0E72184E9AED00B7DEDF /* RFToolbarButton.m in Sources */,
				CEEF0E33184E157600B7DEDF /* AppDelegate.m in Sources */,
				CEEF0E71184E9AED00B7DEDF /* RFKeyboardToolbar.m in Sources */,
				CEEF0E2F184E157600B7DEDF /* main.m in Sources */,
			);
			runOnlyForDeploymentPostprocessing = 0;
		};
/* End PBXSourcesBuildPhase section */

/* Begin PBXVariantGroup section */
		CEEF0E2B184E157600B7DEDF /* InfoPlist.strings */ = {
			isa = PBXVariantGroup;
			children = (
				CEEF0E2C184E157600B7DEDF /* en */,
			);
			name = InfoPlist.strings;
			sourceTree = "<group>";
		};
		CEEF0E4A184E157600B7DEDF /* InfoPlist.strings */ = {
			isa = PBXVariantGroup;
			children = (
				CEEF0E4B184E157600B7DEDF /* en */,
			);
			name = InfoPlist.strings;
			sourceTree = "<group>";
		};
/* End PBXVariantGroup section */

/* Begin XCBuildConfiguration section */
		CEEF0E4F184E157600B7DEDF /* Debug */ = {
			isa = XCBuildConfiguration;
			buildSettings = {
				ALWAYS_SEARCH_USER_PATHS = NO;
				ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)";
				CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
				CLANG_CXX_LIBRARY = "libc++";
				CLANG_ENABLE_MODULES = YES;
				CLANG_ENABLE_OBJC_ARC = YES;
				CLANG_WARN_BOOL_CONVERSION = YES;
				CLANG_WARN_CONSTANT_CONVERSION = YES;
				CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
				CLANG_WARN_EMPTY_BODY = YES;
				CLANG_WARN_ENUM_CONVERSION = YES;
				CLANG_WARN_INT_CONVERSION = YES;
				CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
				CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
				COPY_PHASE_STRIP = NO;
				GCC_C_LANGUAGE_STANDARD = gnu99;
				GCC_DYNAMIC_NO_PIC = NO;
				GCC_OPTIMIZATION_LEVEL = 0;
				GCC_PREPROCESSOR_DEFINITIONS = (
					"DEBUG=1",
					"$(inherited)",
				);
				GCC_SYMBOLS_PRIVATE_EXTERN = NO;
				GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
				GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
				GCC_WARN_UNDECLARED_SELECTOR = YES;
				GCC_WARN_UNINITIALIZED_AUTOS = YES;
				GCC_WARN_UNUSED_FUNCTION = YES;
				GCC_WARN_UNUSED_VARIABLE = YES;
				IPHONEOS_DEPLOYMENT_TARGET = 7.0;
				ONLY_ACTIVE_ARCH = YES;
				SDKROOT = iphoneos;
			};
			name = Debug;
		};
		CEEF0E50184E157600B7DEDF /* Release */ = {
			isa = XCBuildConfiguration;
			buildSettings = {
				ALWAYS_SEARCH_USER_PATHS = NO;
				ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)";
				CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
				CLANG_CXX_LIBRARY = "libc++";
				CLANG_ENABLE_MODULES = YES;
				CLANG_ENABLE_OBJC_ARC = YES;
				CLANG_WARN_BOOL_CONVERSION = YES;
				CLANG_WARN_CONSTANT_CONVERSION = YES;
				CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
				CLANG_WARN_EMPTY_BODY = YES;
				CLANG_WARN_ENUM_CONVERSION = YES;
				CLANG_WARN_INT_CONVERSION = YES;
				CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
				CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
				COPY_PHASE_STRIP = YES;
				ENABLE_NS_ASSERTIONS = NO;
				GCC_C_LANGUAGE_STANDARD = gnu99;
				GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
				GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
				GCC_WARN_UNDECLARED_SELECTOR = YES;
				GCC_WARN_UNINITIALIZED_AUTOS = YES;
				GCC_WARN_UNUSED_FUNCTION = YES;
				GCC_WARN_UNUSED_VARIABLE = YES;
				IPHONEOS_DEPLOYMENT_TARGET = 7.0;
				SDKROOT = iphoneos;
				VALIDATE_PRODUCT = YES;
			};
			name = Release;
		};
		CEEF0E52184E157600B7DEDF /* Debug */ = {
			isa = XCBuildConfiguration;
			buildSettings = {
				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
				ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
				GCC_PRECOMPILE_PREFIX_HEADER = YES;
				GCC_PREFIX_HEADER = "";
				INFOPLIST_FILE = "RFKeyboardToolbar/RFKeyboardToolbarDemo-Info.plist";
				PRODUCT_NAME = RFKeyboardToolbarDemo;
				WRAPPER_EXTENSION = app;
			};
			name = Debug;
		};
		CEEF0E53184E157600B7DEDF /* Release */ = {
			isa = XCBuildConfiguration;
			buildSettings = {
				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
				ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
				GCC_PRECOMPILE_PREFIX_HEADER = YES;
				GCC_PREFIX_HEADER = "";
				INFOPLIST_FILE = "RFKeyboardToolbar/RFKeyboardToolbarDemo-Info.plist";
				PRODUCT_NAME = RFKeyboardToolbarDemo;
				WRAPPER_EXTENSION = app;
			};
			name = Release;
		};
/* End XCBuildConfiguration section */

/* Begin XCConfigurationList section */
		CEEF0E1A184E157600B7DEDF /* Build configuration list for PBXProject "RFKeyboardToolbarDemo" */ = {
			isa = XCConfigurationList;
			buildConfigurations = (
				CEEF0E4F184E157600B7DEDF /* Debug */,
				CEEF0E50184E157600B7DEDF /* Release */,
			);
			defaultConfigurationIsVisible = 0;
			defaultConfigurationName = Release;
		};
		CEEF0E51184E157600B7DEDF /* Build configuration list for PBXNativeTarget "RFKeyboardToolbarDemo" */ = {
			isa = XCConfigurationList;
			buildConfigurations = (
				CEEF0E52184E157600B7DEDF /* Debug */,
				CEEF0E53184E157600B7DEDF /* Release */,
			);
			defaultConfigurationIsVisible = 0;
			defaultConfigurationName = Release;
		};
/* End XCConfigurationList section */
	};
	rootObject = CEEF0E17184E157600B7DEDF /* Project object */;
}


================================================
FILE: RFKeyboardToolbarDemo/RFKeyboardToolbarDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata
================================================
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
   version = "1.0">
   <FileRef
      location = "self:RFKeyboardToolbarDemo.xcodeproj">
   </FileRef>
</Workspace>


================================================
FILE: RFKeyboardToolbarDemo/RFKeyboardToolbarTests/RFKeyboardToolbarDemoTests-Info.plist
================================================
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>CFBundleDevelopmentRegion</key>
	<string>en</string>
	<key>CFBundleExecutable</key>
	<string>${EXECUTABLE_NAME}</string>
	<key>CFBundleIdentifier</key>
	<string>com.rexfinn.${PRODUCT_NAME:rfc1034identifier}</string>
	<key>CFBundleInfoDictionaryVersion</key>
	<string>6.0</string>
	<key>CFBundlePackageType</key>
	<string>BNDL</string>
	<key>CFBundleShortVersionString</key>
	<string>1.0</string>
	<key>CFBundleSignature</key>
	<string>????</string>
	<key>CFBundleVersion</key>
	<string>1</string>
</dict>
</plist>


================================================
FILE: RFKeyboardToolbarDemo/RFKeyboardToolbarTests/RFKeyboardToolbarTests.m
================================================
//
//  RFKeyboardToolbarTests.m
//  RFKeyboardToolbarTests
//
//  Created by Rudd Fawcett on 12/3/13.
//  Copyright (c) 2013 Rudd Fawcett. All rights reserved.
//

#import <XCTest/XCTest.h>

@interface RFKeyboardToolbarTests : XCTestCase

@end

@implementation RFKeyboardToolbarTests

- (void)setUp
{
    [super setUp];
    // Put setup code here. This method is called before the invocation of each test method in the class.
}

- (void)tearDown
{
    // Put teardown code here. This method is called after the invocation of each test method in the class.
    [super tearDown];
}

- (void)testExample
{
    XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__);
}

@end


================================================
FILE: RFKeyboardToolbarDemo/RFKeyboardToolbarTests/en.lproj/InfoPlist.strings
================================================
/* Localized versions of Info.plist keys */

Download .txt
gitextract_q6pplms_/

├── .gitignore
├── LICENSE
├── README.md
├── RFKeyboardToolbar/
│   ├── RFKeyboardToolbar.h
│   ├── RFKeyboardToolbar.m
│   ├── RFToolbarButton.h
│   └── RFToolbarButton.m
├── RFKeyboardToolbar.podspec
└── RFKeyboardToolbarDemo/
    ├── RFKeyboardToolbar/
    │   ├── AppDelegate.h
    │   ├── AppDelegate.m
    │   ├── Images.xcassets/
    │   │   ├── AppIcon.appiconset/
    │   │   │   └── Contents.json
    │   │   └── LaunchImage.launchimage/
    │   │       └── Contents.json
    │   ├── RFKeyboardToolbarDemo-Info.plist
    │   ├── RFKeyboardToolbarDemo-Prefix.pch
    │   ├── ViewController.h
    │   ├── ViewController.m
    │   ├── en.lproj/
    │   │   └── InfoPlist.strings
    │   └── main.m
    ├── RFKeyboardToolbarDemo.xcodeproj/
    │   ├── project.pbxproj
    │   └── project.xcworkspace/
    │       └── contents.xcworkspacedata
    └── RFKeyboardToolbarTests/
        ├── RFKeyboardToolbarDemoTests-Info.plist
        ├── RFKeyboardToolbarTests.m
        └── en.lproj/
            └── InfoPlist.strings
Condensed preview — 23 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (44K chars).
[
  {
    "path": ".gitignore",
    "chars": 237,
    "preview": "# Xcode\n.DS_Store\n*/build/*\n*.pbxuser\n!default.pbxuser\n*.mode1v3\n!default.mode1v3\n*.mode2v3\n!default.mode2v3\n*.perspecti"
  },
  {
    "path": "LICENSE",
    "chars": 1084,
    "preview": "The MIT License (MIT)\n\nCopyright (c) 2013-2015 Rudd Fawcett\n\nPermission is hereby granted, free of charge, to any person"
  },
  {
    "path": "README.md",
    "chars": 2383,
    "preview": "RFKeyboardToolbar<br /> [![RFGravatarImageView Version](http://img.shields.io/cocoapods/v/RFKeyboardToolbar.svg?style=fl"
  },
  {
    "path": "RFKeyboardToolbar/RFKeyboardToolbar.h",
    "chars": 1021,
    "preview": "//\n//  RFKeyboardToolbar.h\n//\n//  Created by Rudd Fawcett on 12/3/13.\n//  Copyright (c) 2013 Rudd Fawcett. All rights re"
  },
  {
    "path": "RFKeyboardToolbar/RFKeyboardToolbar.m",
    "chars": 5170,
    "preview": "//\n//  RFKeyboardToolbar.m\n//\n//  Created by Rudd Fawcett on 12/3/13.\n//  Copyright (c) 2013 Rudd Fawcett. All rights re"
  },
  {
    "path": "RFKeyboardToolbar/RFToolbarButton.h",
    "chars": 1086,
    "preview": "//\n//  RFToolbarButton.h\n//\n//  Created by Rudd Fawcett on 12/3/13.\n//  Copyright (c) 2013 Rudd Fawcett. All rights rese"
  },
  {
    "path": "RFKeyboardToolbar/RFToolbarButton.m",
    "chars": 2071,
    "preview": "//\n//  RFToolbarButton.m\n//\n//  Created by Rudd Fawcett on 12/3/13.\n//  Copyright (c) 2013 Rudd Fawcett. All rights rese"
  },
  {
    "path": "RFKeyboardToolbar.podspec",
    "chars": 698,
    "preview": "Pod::Spec.new do |s|\n  s.name         = 'RFKeyboardToolbar'\n  s.version      = '1.3'\n  s.summary      = 'A flexible UIVi"
  },
  {
    "path": "RFKeyboardToolbarDemo/RFKeyboardToolbar/AppDelegate.h",
    "chars": 320,
    "preview": "//\n//  AppDelegate.h\n//  RFKeyboardToolbarDemo\n//\n//  Created by Rudd Fawcett on 12/3/13.\n//  Copyright (c) 2013 Rudd Fa"
  },
  {
    "path": "RFKeyboardToolbarDemo/RFKeyboardToolbar/AppDelegate.m",
    "chars": 785,
    "preview": "//\n//  AppDelegate.m\n//  RFKeyboardToolbarDemo\n//\n//  Created by Rudd Fawcett on 12/3/13.\n//  Copyright (c) 2013 Rudd Fa"
  },
  {
    "path": "RFKeyboardToolbarDemo/RFKeyboardToolbar/Images.xcassets/AppIcon.appiconset/Contents.json",
    "chars": 333,
    "preview": "{\n  \"images\" : [\n    {\n      \"idiom\" : \"iphone\",\n      \"size\" : \"29x29\",\n      \"scale\" : \"2x\"\n    },\n    {\n      \"idiom\""
  },
  {
    "path": "RFKeyboardToolbarDemo/RFKeyboardToolbar/Images.xcassets/LaunchImage.launchimage/Contents.json",
    "chars": 442,
    "preview": "{\n  \"images\" : [\n    {\n      \"orientation\" : \"portrait\",\n      \"idiom\" : \"iphone\",\n      \"extent\" : \"full-screen\",\n     "
  },
  {
    "path": "RFKeyboardToolbarDemo/RFKeyboardToolbar/RFKeyboardToolbarDemo-Info.plist",
    "chars": 1172,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/P"
  },
  {
    "path": "RFKeyboardToolbarDemo/RFKeyboardToolbar/RFKeyboardToolbarDemo-Prefix.pch",
    "chars": 344,
    "preview": "//\n//  Prefix header\n//\n//  The contents of this file are implicitly included at the beginning of every source file.\n//\n"
  },
  {
    "path": "RFKeyboardToolbarDemo/RFKeyboardToolbar/ViewController.h",
    "chars": 279,
    "preview": "//\n//  ViewController.h\n//  RFKeyboardToolbarDemo\n//\n//  Created by Rudd Fawcett on 12/3/13.\n//  Copyright (c) 2013 Rudd"
  },
  {
    "path": "RFKeyboardToolbarDemo/RFKeyboardToolbar/ViewController.m",
    "chars": 3861,
    "preview": "//\n//  ViewController.m\n//  RFKeyboardToolbarDemo\n//\n//  Created by Rudd Fawcett on 12/3/13.\n//  Copyright (c) 2013 Rudd"
  },
  {
    "path": "RFKeyboardToolbarDemo/RFKeyboardToolbar/en.lproj/InfoPlist.strings",
    "chars": 45,
    "preview": "/* Localized versions of Info.plist keys */\n\n"
  },
  {
    "path": "RFKeyboardToolbarDemo/RFKeyboardToolbar/main.m",
    "chars": 353,
    "preview": "//\n//  main.m\n//  RFKeyboardToolbarDemo\n//\n//  Created by Rudd Fawcett on 12/3/13.\n//  Copyright (c) 2013 Rudd Fawcett. "
  },
  {
    "path": "RFKeyboardToolbarDemo/RFKeyboardToolbarDemo.xcodeproj/project.pbxproj",
    "chars": 16168,
    "preview": "// !$*UTF8*$!\n{\n\tarchiveVersion = 1;\n\tclasses = {\n\t};\n\tobjectVersion = 46;\n\tobjects = {\n\n/* Begin PBXBuildFile section *"
  },
  {
    "path": "RFKeyboardToolbarDemo/RFKeyboardToolbarDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata",
    "chars": 166,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Workspace\n   version = \"1.0\">\n   <FileRef\n      location = \"self:RFKeyboardToolb"
  },
  {
    "path": "RFKeyboardToolbarDemo/RFKeyboardToolbarTests/RFKeyboardToolbarDemoTests-Info.plist",
    "chars": 691,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/P"
  },
  {
    "path": "RFKeyboardToolbarDemo/RFKeyboardToolbarTests/RFKeyboardToolbarTests.m",
    "chars": 678,
    "preview": "//\n//  RFKeyboardToolbarTests.m\n//  RFKeyboardToolbarTests\n//\n//  Created by Rudd Fawcett on 12/3/13.\n//  Copyright (c) "
  },
  {
    "path": "RFKeyboardToolbarDemo/RFKeyboardToolbarTests/en.lproj/InfoPlist.strings",
    "chars": 45,
    "preview": "/* Localized versions of Info.plist keys */\n\n"
  }
]

About this extraction

This page contains the full source code of the ruddfawcett/RFKeyboardToolbar GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 23 files (38.5 KB), approximately 12.2k tokens. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!