├── Screenshots ├── Screenshot1.png └── Screenshot2.png ├── THNotesTextViewExample ├── THNotesTextViewExample │ ├── en.lproj │ │ └── InfoPlist.strings │ ├── ViewController.h │ ├── AppDelegate.h │ ├── main.m │ ├── THNotesTextViewExample-Prefix.pch │ ├── Images.xcassets │ │ ├── AppIcon.appiconset │ │ │ └── Contents.json │ │ └── LaunchImage.launchimage │ │ │ └── Contents.json │ ├── ViewController.m │ ├── THNotesTextViewExample-Info.plist │ ├── AppDelegate.m │ └── Base.lproj │ │ └── Main.storyboard ├── THNotesTextViewExampleTests │ ├── en.lproj │ │ └── InfoPlist.strings │ ├── THNotesTextViewExampleTests-Info.plist │ └── THNotesTextViewExampleTests.m └── THNotesTextViewExample.xcodeproj │ ├── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ └── THNotesTextViewExample.xccheckout │ └── project.pbxproj ├── .gitignore ├── THNotesTextView ├── THNotesTextView.h └── THNotesTextView.m ├── THNotesTextView.podspec ├── LICENSE.md └── README.md /Screenshots/Screenshot1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hons82/THNotesTextView/HEAD/Screenshots/Screenshot1.png -------------------------------------------------------------------------------- /Screenshots/Screenshot2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hons82/THNotesTextView/HEAD/Screenshots/Screenshot2.png -------------------------------------------------------------------------------- /THNotesTextViewExample/THNotesTextViewExample/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /THNotesTextViewExample/THNotesTextViewExampleTests/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /THNotesTextViewExample/THNotesTextViewExample.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | _Store 2 | */build/* 3 | *.pbxuser 4 | !default.pbxuser 5 | *.mode1v3 6 | !default.mode1v3 7 | *.mode2v3 8 | !default.mode2v3 9 | *.perspectivev3 10 | !default.perspectivev3 11 | xcuserdata 12 | profile 13 | *.moved-aside 14 | DerivedData 15 | .idea/ 16 | *.hmap 17 | 18 | #CocoaPods 19 | Pods 20 | -------------------------------------------------------------------------------- /THNotesTextViewExample/THNotesTextViewExample/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // THNotesTextViewExample 4 | // 5 | // Created by Hannes Tribus on 12/05/14. 6 | // Copyright (c) 2014 3Bus. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /THNotesTextViewExample/THNotesTextViewExample/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // THNotesTextViewExample 4 | // 5 | // Created by Hannes Tribus on 12/05/14. 6 | // Copyright (c) 2014 3Bus. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /THNotesTextViewExample/THNotesTextViewExample/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // THNotesTextViewExample 4 | // 5 | // Created by Hannes Tribus on 12/05/14. 6 | // Copyright (c) 2014 3Bus. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "AppDelegate.h" 12 | 13 | int main(int argc, char * argv[]) 14 | { 15 | @autoreleasepool { 16 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /THNotesTextViewExample/THNotesTextViewExample/THNotesTextViewExample-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header 3 | // 4 | // The contents of this file are implicitly included at the beginning of every source file. 5 | // 6 | 7 | #import 8 | 9 | #ifndef __IPHONE_5_0 10 | #warning "This project uses features only available in iOS SDK 5.0 and later." 11 | #endif 12 | 13 | #ifdef __OBJC__ 14 | #import 15 | #import 16 | #endif 17 | -------------------------------------------------------------------------------- /THNotesTextViewExample/THNotesTextViewExample/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "40x40", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "60x60", 16 | "scale" : "2x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /THNotesTextView/THNotesTextView.h: -------------------------------------------------------------------------------- 1 | // 2 | // THNotesTextView.h 3 | // THNotesTextViewExample 4 | // 5 | // Created by Hannes Tribus on 12/05/14. 6 | // Copyright (c) 2014 3Bus. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface THNotesTextView : UITextView 12 | 13 | @property (nonatomic, strong) UIColor *horizontalLineColor; 14 | @property (nonatomic, strong) UIColor *verticalLineColor; 15 | 16 | @property (nonatomic) UIEdgeInsets margins; 17 | @property (nonatomic, getter = isDottedLines) BOOL dottedLines; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /THNotesTextView.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |s| 2 | s.name = "THNotesTextView" 3 | s.version = "1.0.0" 4 | s.summary = "UITextView with the look of a Notebook" 5 | s.homepage = "https://github.com/hons82/THNotesTextView" 6 | s.license = { :type => 'MIT', :file => 'LICENSE.md' } 7 | s.author = { "Hannes Tribus" => "hons82@gmail.com" } 8 | s.source = { :git => "https://github.com/hons82/THNotesTextView.git", :tag => "v#{s.version}" } 9 | s.platform = :ios, '7.0' 10 | s.requires_arc = true 11 | s.source_files = 'THNotesTextView/*.{h,m}' 12 | end -------------------------------------------------------------------------------- /THNotesTextViewExample/THNotesTextViewExample/Images.xcassets/LaunchImage.launchimage/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "orientation" : "portrait", 5 | "idiom" : "iphone", 6 | "extent" : "full-screen", 7 | "minimum-system-version" : "7.0", 8 | "scale" : "2x" 9 | }, 10 | { 11 | "orientation" : "portrait", 12 | "idiom" : "iphone", 13 | "subtype" : "retina4", 14 | "extent" : "full-screen", 15 | "minimum-system-version" : "7.0", 16 | "scale" : "2x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /THNotesTextViewExample/THNotesTextViewExample/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // THNotesTextViewExample 4 | // 5 | // Created by Hannes Tribus on 12/05/14. 6 | // Copyright (c) 2014 3Bus. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | 11 | @interface ViewController () 12 | 13 | @end 14 | 15 | @implementation ViewController 16 | 17 | - (void)viewDidLoad 18 | { 19 | [super viewDidLoad]; 20 | // Do any additional setup after loading the view, typically from a nib. 21 | } 22 | 23 | - (void)didReceiveMemoryWarning 24 | { 25 | [super didReceiveMemoryWarning]; 26 | // Dispose of any resources that can be recreated. 27 | } 28 | 29 | @end 30 | -------------------------------------------------------------------------------- /THNotesTextViewExample/THNotesTextViewExampleTests/THNotesTextViewExampleTests-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | it.3bus.${PRODUCT_NAME:rfc1034identifier} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | BNDL 15 | CFBundleShortVersionString 16 | 1.0 17 | CFBundleSignature 18 | ???? 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /THNotesTextViewExample/THNotesTextViewExampleTests/THNotesTextViewExampleTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // THNotesTextViewExampleTests.m 3 | // THNotesTextViewExampleTests 4 | // 5 | // Created by Hannes Tribus on 12/05/14. 6 | // Copyright (c) 2014 3Bus. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface THNotesTextViewExampleTests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation THNotesTextViewExampleTests 16 | 17 | - (void)setUp 18 | { 19 | [super setUp]; 20 | // Put setup code here. This method is called before the invocation of each test method in the class. 21 | } 22 | 23 | - (void)tearDown 24 | { 25 | // Put teardown code here. This method is called after the invocation of each test method in the class. 26 | [super tearDown]; 27 | } 28 | 29 | - (void)testExample 30 | { 31 | XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); 32 | } 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | # License 2 | 3 | ## MIT License 4 | 5 | Copyright (c) 2014 Tribus Hannes (http://hons82.blogspot.it) 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in 15 | all copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | THE SOFTWARE. 24 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | THNotesTextView 2 | === 3 | 4 | [![Pod Version](http://img.shields.io/cocoapods/v/THNotesTextView.svg?style=flat)](http://cocoadocs.org/docsets/THNotesTextView/) 5 | [![Pod Platform](http://img.shields.io/cocoapods/p/THNotesTextView.svg?style=flat)](http://cocoadocs.org/docsets/THNotesTextView/) 6 | [![Pod License](http://img.shields.io/cocoapods/l/THNotesTextView.svg?style=flat)](http://opensource.org/licenses/MIT) 7 | 8 | This control is an extension to the standard UITextview to make it look like a notebook 9 | 10 | # Screenshots 11 | 12 | ![iPhone Portrait](/Screenshots/Screenshot1.png?raw=true) 13 | ![iPhone Landscape](/Screenshots/Screenshot2.png?raw=true) 14 | 15 | # Installation 16 | 17 | ### CocoaPods 18 | 19 | Install with [CocoaPods](http://cocoapods.org) by adding the following to your Podfile: 20 | 21 | ``` ruby 22 | platform :ios, '7.0' 23 | pod 'THNotesTextView', '~> 1.0.0' 24 | ``` 25 | 26 | **Note**: We follow http://semver.org for versioning the public API. 27 | 28 | ### Manually 29 | 30 | Or copy the `THNotesTextView/` directory from this repo into your project. 31 | 32 | # Usage 33 | 34 | Have a look at the Example Project. 35 | Actually it's quite simple, as it is a normal UITextView 36 | 37 | #Contributions 38 | 39 | ...are really welcome. 40 | 41 | # License 42 | 43 | Source code of this project is available under the standard MIT license. Please see [the license file](LICENSE.md). 44 | 45 | 46 | -------------------------------------------------------------------------------- /THNotesTextViewExample/THNotesTextViewExample/THNotesTextViewExample-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIdentifier 12 | it.3bus.${PRODUCT_NAME:rfc1034identifier} 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1.0 25 | LSRequiresIPhoneOS 26 | 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /THNotesTextViewExample/THNotesTextViewExample.xcodeproj/project.xcworkspace/xcshareddata/THNotesTextViewExample.xccheckout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDESourceControlProjectFavoriteDictionaryKey 6 | 7 | IDESourceControlProjectIdentifier 8 | BE0A6E7D-7BE6-4CC7-A3BA-B602317B5A70 9 | IDESourceControlProjectName 10 | THNotesTextViewExample 11 | IDESourceControlProjectOriginsDictionary 12 | 13 | 504563FFFAF3BC60C8012CCF73C033248B94D663 14 | https://github.com/hons82/THNotesTextView.git 15 | 16 | IDESourceControlProjectPath 17 | THNotesTextViewExample/THNotesTextViewExample.xcodeproj 18 | IDESourceControlProjectRelativeInstallPathDictionary 19 | 20 | 504563FFFAF3BC60C8012CCF73C033248B94D663 21 | ../../.. 22 | 23 | IDESourceControlProjectURL 24 | https://github.com/hons82/THNotesTextView.git 25 | IDESourceControlProjectVersion 26 | 111 27 | IDESourceControlProjectWCCIdentifier 28 | 504563FFFAF3BC60C8012CCF73C033248B94D663 29 | IDESourceControlProjectWCConfigurations 30 | 31 | 32 | IDESourceControlRepositoryExtensionIdentifierKey 33 | public.vcs.git 34 | IDESourceControlWCCIdentifierKey 35 | 504563FFFAF3BC60C8012CCF73C033248B94D663 36 | IDESourceControlWCCName 37 | THNotesTextView 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /THNotesTextViewExample/THNotesTextViewExample/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // THNotesTextViewExample 4 | // 5 | // Created by Hannes Tribus on 12/05/14. 6 | // Copyright (c) 2014 3Bus. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | 11 | @implementation AppDelegate 12 | 13 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 14 | { 15 | // Override point for customization after application launch. 16 | return YES; 17 | } 18 | 19 | - (void)applicationWillResignActive:(UIApplication *)application 20 | { 21 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 22 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. 23 | } 24 | 25 | - (void)applicationDidEnterBackground:(UIApplication *)application 26 | { 27 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 28 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 29 | } 30 | 31 | - (void)applicationWillEnterForeground:(UIApplication *)application 32 | { 33 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. 34 | } 35 | 36 | - (void)applicationDidBecomeActive:(UIApplication *)application 37 | { 38 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 39 | } 40 | 41 | - (void)applicationWillTerminate:(UIApplication *)application 42 | { 43 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 44 | } 45 | 46 | @end 47 | -------------------------------------------------------------------------------- /THNotesTextViewExample/THNotesTextViewExample/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | Lorem ipsum dolor sit er elit lamet, consectetaur cillium adipisicing pecu, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /THNotesTextView/THNotesTextView.m: -------------------------------------------------------------------------------- 1 | // 2 | // THNotesTextView.m 3 | // THNotesTextViewExample 4 | // 5 | // Created by Hannes Tribus on 12/05/14. 6 | // Copyright (c) 2014 3Bus. All rights reserved. 7 | // 8 | 9 | #import "THNotesTextView.h" 10 | 11 | #define DEFAULT_VERTICAL_COLOR [UIColor colorWithRed:178.0/255.0 green:210.0/255.0 blue:241.0/255.0 alpha:1.0f] 12 | #define DEFAULT_HORIZONTAL_COLOR [UIColor colorWithRed:255.0/255.0 green:214.0/255.0 blue:207.0/255.0 alpha:1.0f] 13 | #define DEFAULT_MARGINS UIEdgeInsetsMake(10.0f, 20.0f, 0.0f, 20.0f) 14 | 15 | @implementation THNotesTextView 16 | 17 | @synthesize horizontalLineColor = _horizontalLineColor; 18 | @synthesize verticalLineColor = _verticalLineColor; 19 | @synthesize dottedLines = _dottedLines; 20 | 21 | + (void)initialize { 22 | if (self == [THNotesTextView class]) 23 | { 24 | id appearance = [self appearance]; 25 | [appearance setContentMode:UIViewContentModeRedraw]; 26 | [appearance setHorizontalLineColor:DEFAULT_HORIZONTAL_COLOR]; 27 | [appearance setVerticalLineColor:DEFAULT_VERTICAL_COLOR]; 28 | [appearance setMargins:DEFAULT_MARGINS]; 29 | } 30 | } 31 | 32 | #pragma mark - Setup/Teardown 33 | 34 | - (void)setup { 35 | [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(textDidChangeNotification:) name:UITextViewTextDidChangeNotification object:nil]; 36 | [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardDidChangeFrame:) name:UIKeyboardDidChangeFrameNotification object:nil]; 37 | [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillHide:) name:UIKeyboardWillHideNotification object:nil]; 38 | } 39 | 40 | -(id)initWithFrame:(CGRect)frame { 41 | self = [super initWithFrame:frame]; 42 | if (self) { 43 | [self setup]; 44 | } 45 | return self; 46 | } 47 | 48 | -(void)awakeFromNib { 49 | [self setup]; 50 | } 51 | 52 | -(void)dealloc { 53 | [[NSNotificationCenter defaultCenter] removeObserver:self]; 54 | #if !__has_feature(objc_arc) 55 | [super dealloc]; 56 | #endif 57 | } 58 | 59 | - (void)setContentSize:(CGSize)contentSize { 60 | contentSize = (CGSize) { 61 | .width = contentSize.width - self.margins.left - self.margins.right, 62 | .height = contentSize.height 63 | }; 64 | NSLog(@"width: %f, height %f",contentSize.width,contentSize.height); 65 | [super setContentSize:contentSize]; 66 | } 67 | 68 | - (void)setMargins:(UIEdgeInsets)margins { 69 | _margins = margins; 70 | self.contentInset = (UIEdgeInsets) { 71 | .top = self.margins.top, 72 | .left = self.margins.left, 73 | .bottom = self.margins.bottom, 74 | .right = self.margins.right - self.margins.left 75 | }; 76 | self.textContainerInset = (UIEdgeInsets) { 77 | .top = self.margins.top, 78 | .left = 0, 79 | .bottom = self.margins.bottom, 80 | .right = self.margins.right + self.margins.left 81 | }; 82 | 83 | [self setContentSize:self.contentSize]; 84 | } 85 | 86 | - (void)scrollToCaretAnimated:(BOOL)animated { 87 | CGRect rect = [self caretRectForPosition:self.selectedTextRange.end]; 88 | rect.size.height += self.textContainerInset.bottom; 89 | [self scrollRectToVisible:rect animated:animated]; 90 | } 91 | 92 | - (UIColor *)horizontalLineColor { 93 | if (!_horizontalLineColor) _horizontalLineColor = DEFAULT_HORIZONTAL_COLOR; 94 | return _horizontalLineColor; 95 | } 96 | 97 | - (UIColor *)verticalLineColor { 98 | if (!_verticalLineColor) _verticalLineColor = DEFAULT_VERTICAL_COLOR; 99 | return _verticalLineColor; 100 | } 101 | 102 | - (void)drawRect:(CGRect)rect { 103 | CGContextRef context = UIGraphicsGetCurrentContext(); 104 | CGFloat lineSpacing = 1.01f; 105 | if (self.horizontalLineColor) { 106 | CGContextSetLineWidth(context, 1.0f); 107 | if ([self isDottedLines]) { 108 | CGFloat dash[] = {1.0, 1.0}; 109 | CGContextSetLineDash(context, 0.0, dash, 2); 110 | } 111 | 112 | CGContextBeginPath(context); 113 | CGContextSetStrokeColorWithColor(context, self.horizontalLineColor.CGColor); 114 | 115 | // Create un-mutated floats outside of the for loop. 116 | // Reduces memory access. 117 | CGFloat baseOffset = self.margins.top + self.font.descender + 1.0; 118 | CGFloat screenScale = [UIScreen mainScreen].scale; 119 | CGFloat boundsX = self.bounds.origin.x; 120 | CGFloat boundsWidth = self.bounds.size.width; 121 | 122 | // Only draw lines that are visible on the screen. 123 | // (As opposed to throughout the entire view's contents) 124 | NSInteger firstVisibleLine = MAX(1, (self.contentOffset.y / (self.font.lineHeight * lineSpacing))); 125 | NSInteger lastVisibleLine = ceilf((self.contentOffset.y + self.bounds.size.height) / (self.font.lineHeight * lineSpacing)); 126 | for (NSInteger line = firstVisibleLine; line <= lastVisibleLine; ++line) 127 | { 128 | CGFloat linePointY = (baseOffset + (self.font.lineHeight * line * lineSpacing)); 129 | // Rounding the point to the nearest pixel. 130 | // Greatly reduces drawing time. 131 | CGFloat roundedLinePointY = roundf(linePointY * screenScale) / screenScale; 132 | //NSLog(@"linePointYRounded %f (%f)",roundedLinePointY, linePointY); 133 | CGContextMoveToPoint(context, boundsX, roundedLinePointY); 134 | CGContextAddLineToPoint(context, boundsWidth, roundedLinePointY); 135 | } 136 | CGContextClosePath(context); 137 | CGContextStrokePath(context); 138 | } 139 | 140 | if (self.verticalLineColor) { 141 | if ([self isDottedLines]) { 142 | CGFloat dash[] = {0.5, 1.5}; 143 | CGContextSetLineDash(context, 0.0, dash, 2); 144 | } 145 | 146 | // left 147 | CGContextBeginPath(context); 148 | CGContextSetStrokeColorWithColor(context, self.verticalLineColor.CGColor); 149 | CGContextMoveToPoint(context, -1.0f, self.contentOffset.y); 150 | CGContextAddLineToPoint(context, -1.0f, self.contentOffset.y + self.bounds.size.height); 151 | CGContextClosePath(context); 152 | CGContextStrokePath(context); 153 | 154 | // right 155 | CGContextBeginPath(context); 156 | CGContextSetStrokeColorWithColor(context, self.verticalLineColor.CGColor); 157 | CGContextMoveToPoint(context, -1.0f + self.contentSize.width, self.contentOffset.y); 158 | CGContextAddLineToPoint(context, -1.0f + self.contentSize.width, self.contentOffset.y + self.bounds.size.height); 159 | CGContextClosePath(context); 160 | CGContextStrokePath(context); 161 | } 162 | } 163 | 164 | #pragma mark - Notifications 165 | 166 | - (void)textDidChangeNotification:(NSNotification*)notification { 167 | [self scrollToCaretAnimated:NO]; 168 | } 169 | 170 | - (void)keyboardWillHide:(NSNotification*)notification { 171 | [self setMargins:DEFAULT_MARGINS]; 172 | } 173 | 174 | - (void)keyboardDidChangeFrame:(NSNotification*)notification { 175 | NSDictionary* keyboardInfo = [notification userInfo]; 176 | CGRect keyboardFrameBeginRect = [[keyboardInfo valueForKey:UIKeyboardFrameBeginUserInfoKey]CGRectValue]; 177 | 178 | UIEdgeInsets tmp = DEFAULT_MARGINS; 179 | tmp.bottom = [[UIDevice currentDevice] orientation] == UIDeviceOrientationLandscapeLeft || [[UIDevice currentDevice] orientation] == UIDeviceOrientationLandscapeRight ? 180 | keyboardFrameBeginRect.size.width : keyboardFrameBeginRect.size.height; 181 | tmp.right = tmp.right - tmp.left; 182 | [self setContentInset:tmp]; 183 | [self scrollToCaretAnimated:NO]; 184 | } 185 | 186 | @end 187 | -------------------------------------------------------------------------------- /THNotesTextViewExample/THNotesTextViewExample.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 99368F181920F60F00ECFD57 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 99368F171920F60F00ECFD57 /* Foundation.framework */; }; 11 | 99368F1A1920F60F00ECFD57 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 99368F191920F60F00ECFD57 /* CoreGraphics.framework */; }; 12 | 99368F1C1920F60F00ECFD57 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 99368F1B1920F60F00ECFD57 /* UIKit.framework */; }; 13 | 99368F221920F60F00ECFD57 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 99368F201920F60F00ECFD57 /* InfoPlist.strings */; }; 14 | 99368F241920F60F00ECFD57 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 99368F231920F60F00ECFD57 /* main.m */; }; 15 | 99368F281920F60F00ECFD57 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 99368F271920F60F00ECFD57 /* AppDelegate.m */; }; 16 | 99368F2B1920F60F00ECFD57 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 99368F291920F60F00ECFD57 /* Main.storyboard */; }; 17 | 99368F2E1920F60F00ECFD57 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 99368F2D1920F60F00ECFD57 /* ViewController.m */; }; 18 | 99368F301920F60F00ECFD57 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 99368F2F1920F60F00ECFD57 /* Images.xcassets */; }; 19 | 99368F371920F60F00ECFD57 /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 99368F361920F60F00ECFD57 /* XCTest.framework */; }; 20 | 99368F381920F60F00ECFD57 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 99368F171920F60F00ECFD57 /* Foundation.framework */; }; 21 | 99368F391920F60F00ECFD57 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 99368F1B1920F60F00ECFD57 /* UIKit.framework */; }; 22 | 99368F411920F60F00ECFD57 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 99368F3F1920F60F00ECFD57 /* InfoPlist.strings */; }; 23 | 99368F431920F60F00ECFD57 /* THNotesTextViewExampleTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 99368F421920F60F00ECFD57 /* THNotesTextViewExampleTests.m */; }; 24 | 99368F4E1920F64400ECFD57 /* THNotesTextView.m in Sources */ = {isa = PBXBuildFile; fileRef = 99368F4D1920F64400ECFD57 /* THNotesTextView.m */; }; 25 | /* End PBXBuildFile section */ 26 | 27 | /* Begin PBXContainerItemProxy section */ 28 | 99368F3A1920F60F00ECFD57 /* PBXContainerItemProxy */ = { 29 | isa = PBXContainerItemProxy; 30 | containerPortal = 99368F0C1920F60F00ECFD57 /* Project object */; 31 | proxyType = 1; 32 | remoteGlobalIDString = 99368F131920F60F00ECFD57; 33 | remoteInfo = THNotesTextViewExample; 34 | }; 35 | /* End PBXContainerItemProxy section */ 36 | 37 | /* Begin PBXFileReference section */ 38 | 99368F141920F60F00ECFD57 /* THNotesTextViewExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = THNotesTextViewExample.app; sourceTree = BUILT_PRODUCTS_DIR; }; 39 | 99368F171920F60F00ECFD57 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 40 | 99368F191920F60F00ECFD57 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; 41 | 99368F1B1920F60F00ECFD57 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; 42 | 99368F1F1920F60F00ECFD57 /* THNotesTextViewExample-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "THNotesTextViewExample-Info.plist"; sourceTree = ""; }; 43 | 99368F211920F60F00ECFD57 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 44 | 99368F231920F60F00ECFD57 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 45 | 99368F251920F60F00ECFD57 /* THNotesTextViewExample-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "THNotesTextViewExample-Prefix.pch"; sourceTree = ""; }; 46 | 99368F261920F60F00ECFD57 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 47 | 99368F271920F60F00ECFD57 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 48 | 99368F2A1920F60F00ECFD57 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 49 | 99368F2C1920F60F00ECFD57 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; 50 | 99368F2D1920F60F00ECFD57 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; 51 | 99368F2F1920F60F00ECFD57 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 52 | 99368F351920F60F00ECFD57 /* THNotesTextViewExampleTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = THNotesTextViewExampleTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 53 | 99368F361920F60F00ECFD57 /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; 54 | 99368F3E1920F60F00ECFD57 /* THNotesTextViewExampleTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "THNotesTextViewExampleTests-Info.plist"; sourceTree = ""; }; 55 | 99368F401920F60F00ECFD57 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 56 | 99368F421920F60F00ECFD57 /* THNotesTextViewExampleTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = THNotesTextViewExampleTests.m; sourceTree = ""; }; 57 | 99368F4C1920F64400ECFD57 /* THNotesTextView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = THNotesTextView.h; sourceTree = ""; }; 58 | 99368F4D1920F64400ECFD57 /* THNotesTextView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = THNotesTextView.m; sourceTree = ""; }; 59 | /* End PBXFileReference section */ 60 | 61 | /* Begin PBXFrameworksBuildPhase section */ 62 | 99368F111920F60F00ECFD57 /* Frameworks */ = { 63 | isa = PBXFrameworksBuildPhase; 64 | buildActionMask = 2147483647; 65 | files = ( 66 | 99368F1A1920F60F00ECFD57 /* CoreGraphics.framework in Frameworks */, 67 | 99368F1C1920F60F00ECFD57 /* UIKit.framework in Frameworks */, 68 | 99368F181920F60F00ECFD57 /* Foundation.framework in Frameworks */, 69 | ); 70 | runOnlyForDeploymentPostprocessing = 0; 71 | }; 72 | 99368F321920F60F00ECFD57 /* Frameworks */ = { 73 | isa = PBXFrameworksBuildPhase; 74 | buildActionMask = 2147483647; 75 | files = ( 76 | 99368F371920F60F00ECFD57 /* XCTest.framework in Frameworks */, 77 | 99368F391920F60F00ECFD57 /* UIKit.framework in Frameworks */, 78 | 99368F381920F60F00ECFD57 /* Foundation.framework in Frameworks */, 79 | ); 80 | runOnlyForDeploymentPostprocessing = 0; 81 | }; 82 | /* End PBXFrameworksBuildPhase section */ 83 | 84 | /* Begin PBXGroup section */ 85 | 99368F0B1920F60F00ECFD57 = { 86 | isa = PBXGroup; 87 | children = ( 88 | 99368F4F1920F64B00ECFD57 /* THNotesTextView */, 89 | 99368F1D1920F60F00ECFD57 /* THNotesTextViewExample */, 90 | 99368F3C1920F60F00ECFD57 /* THNotesTextViewExampleTests */, 91 | 99368F161920F60F00ECFD57 /* Frameworks */, 92 | 99368F151920F60F00ECFD57 /* Products */, 93 | ); 94 | sourceTree = ""; 95 | }; 96 | 99368F151920F60F00ECFD57 /* Products */ = { 97 | isa = PBXGroup; 98 | children = ( 99 | 99368F141920F60F00ECFD57 /* THNotesTextViewExample.app */, 100 | 99368F351920F60F00ECFD57 /* THNotesTextViewExampleTests.xctest */, 101 | ); 102 | name = Products; 103 | sourceTree = ""; 104 | }; 105 | 99368F161920F60F00ECFD57 /* Frameworks */ = { 106 | isa = PBXGroup; 107 | children = ( 108 | 99368F171920F60F00ECFD57 /* Foundation.framework */, 109 | 99368F191920F60F00ECFD57 /* CoreGraphics.framework */, 110 | 99368F1B1920F60F00ECFD57 /* UIKit.framework */, 111 | 99368F361920F60F00ECFD57 /* XCTest.framework */, 112 | ); 113 | name = Frameworks; 114 | sourceTree = ""; 115 | }; 116 | 99368F1D1920F60F00ECFD57 /* THNotesTextViewExample */ = { 117 | isa = PBXGroup; 118 | children = ( 119 | 99368F261920F60F00ECFD57 /* AppDelegate.h */, 120 | 99368F271920F60F00ECFD57 /* AppDelegate.m */, 121 | 99368F291920F60F00ECFD57 /* Main.storyboard */, 122 | 99368F2C1920F60F00ECFD57 /* ViewController.h */, 123 | 99368F2D1920F60F00ECFD57 /* ViewController.m */, 124 | 99368F2F1920F60F00ECFD57 /* Images.xcassets */, 125 | 99368F1E1920F60F00ECFD57 /* Supporting Files */, 126 | ); 127 | path = THNotesTextViewExample; 128 | sourceTree = ""; 129 | }; 130 | 99368F1E1920F60F00ECFD57 /* Supporting Files */ = { 131 | isa = PBXGroup; 132 | children = ( 133 | 99368F1F1920F60F00ECFD57 /* THNotesTextViewExample-Info.plist */, 134 | 99368F201920F60F00ECFD57 /* InfoPlist.strings */, 135 | 99368F231920F60F00ECFD57 /* main.m */, 136 | 99368F251920F60F00ECFD57 /* THNotesTextViewExample-Prefix.pch */, 137 | ); 138 | name = "Supporting Files"; 139 | sourceTree = ""; 140 | }; 141 | 99368F3C1920F60F00ECFD57 /* THNotesTextViewExampleTests */ = { 142 | isa = PBXGroup; 143 | children = ( 144 | 99368F421920F60F00ECFD57 /* THNotesTextViewExampleTests.m */, 145 | 99368F3D1920F60F00ECFD57 /* Supporting Files */, 146 | ); 147 | path = THNotesTextViewExampleTests; 148 | sourceTree = ""; 149 | }; 150 | 99368F3D1920F60F00ECFD57 /* Supporting Files */ = { 151 | isa = PBXGroup; 152 | children = ( 153 | 99368F3E1920F60F00ECFD57 /* THNotesTextViewExampleTests-Info.plist */, 154 | 99368F3F1920F60F00ECFD57 /* InfoPlist.strings */, 155 | ); 156 | name = "Supporting Files"; 157 | sourceTree = ""; 158 | }; 159 | 99368F4F1920F64B00ECFD57 /* THNotesTextView */ = { 160 | isa = PBXGroup; 161 | children = ( 162 | 99368F4C1920F64400ECFD57 /* THNotesTextView.h */, 163 | 99368F4D1920F64400ECFD57 /* THNotesTextView.m */, 164 | ); 165 | name = THNotesTextView; 166 | path = ../THNotesTextView; 167 | sourceTree = ""; 168 | }; 169 | /* End PBXGroup section */ 170 | 171 | /* Begin PBXNativeTarget section */ 172 | 99368F131920F60F00ECFD57 /* THNotesTextViewExample */ = { 173 | isa = PBXNativeTarget; 174 | buildConfigurationList = 99368F461920F60F00ECFD57 /* Build configuration list for PBXNativeTarget "THNotesTextViewExample" */; 175 | buildPhases = ( 176 | 99368F101920F60F00ECFD57 /* Sources */, 177 | 99368F111920F60F00ECFD57 /* Frameworks */, 178 | 99368F121920F60F00ECFD57 /* Resources */, 179 | ); 180 | buildRules = ( 181 | ); 182 | dependencies = ( 183 | ); 184 | name = THNotesTextViewExample; 185 | productName = THNotesTextViewExample; 186 | productReference = 99368F141920F60F00ECFD57 /* THNotesTextViewExample.app */; 187 | productType = "com.apple.product-type.application"; 188 | }; 189 | 99368F341920F60F00ECFD57 /* THNotesTextViewExampleTests */ = { 190 | isa = PBXNativeTarget; 191 | buildConfigurationList = 99368F491920F60F00ECFD57 /* Build configuration list for PBXNativeTarget "THNotesTextViewExampleTests" */; 192 | buildPhases = ( 193 | 99368F311920F60F00ECFD57 /* Sources */, 194 | 99368F321920F60F00ECFD57 /* Frameworks */, 195 | 99368F331920F60F00ECFD57 /* Resources */, 196 | ); 197 | buildRules = ( 198 | ); 199 | dependencies = ( 200 | 99368F3B1920F60F00ECFD57 /* PBXTargetDependency */, 201 | ); 202 | name = THNotesTextViewExampleTests; 203 | productName = THNotesTextViewExampleTests; 204 | productReference = 99368F351920F60F00ECFD57 /* THNotesTextViewExampleTests.xctest */; 205 | productType = "com.apple.product-type.bundle.unit-test"; 206 | }; 207 | /* End PBXNativeTarget section */ 208 | 209 | /* Begin PBXProject section */ 210 | 99368F0C1920F60F00ECFD57 /* Project object */ = { 211 | isa = PBXProject; 212 | attributes = { 213 | LastUpgradeCheck = 0510; 214 | ORGANIZATIONNAME = 3Bus; 215 | TargetAttributes = { 216 | 99368F341920F60F00ECFD57 = { 217 | TestTargetID = 99368F131920F60F00ECFD57; 218 | }; 219 | }; 220 | }; 221 | buildConfigurationList = 99368F0F1920F60F00ECFD57 /* Build configuration list for PBXProject "THNotesTextViewExample" */; 222 | compatibilityVersion = "Xcode 3.2"; 223 | developmentRegion = English; 224 | hasScannedForEncodings = 0; 225 | knownRegions = ( 226 | en, 227 | Base, 228 | ); 229 | mainGroup = 99368F0B1920F60F00ECFD57; 230 | productRefGroup = 99368F151920F60F00ECFD57 /* Products */; 231 | projectDirPath = ""; 232 | projectRoot = ""; 233 | targets = ( 234 | 99368F131920F60F00ECFD57 /* THNotesTextViewExample */, 235 | 99368F341920F60F00ECFD57 /* THNotesTextViewExampleTests */, 236 | ); 237 | }; 238 | /* End PBXProject section */ 239 | 240 | /* Begin PBXResourcesBuildPhase section */ 241 | 99368F121920F60F00ECFD57 /* Resources */ = { 242 | isa = PBXResourcesBuildPhase; 243 | buildActionMask = 2147483647; 244 | files = ( 245 | 99368F301920F60F00ECFD57 /* Images.xcassets in Resources */, 246 | 99368F221920F60F00ECFD57 /* InfoPlist.strings in Resources */, 247 | 99368F2B1920F60F00ECFD57 /* Main.storyboard in Resources */, 248 | ); 249 | runOnlyForDeploymentPostprocessing = 0; 250 | }; 251 | 99368F331920F60F00ECFD57 /* Resources */ = { 252 | isa = PBXResourcesBuildPhase; 253 | buildActionMask = 2147483647; 254 | files = ( 255 | 99368F411920F60F00ECFD57 /* InfoPlist.strings in Resources */, 256 | ); 257 | runOnlyForDeploymentPostprocessing = 0; 258 | }; 259 | /* End PBXResourcesBuildPhase section */ 260 | 261 | /* Begin PBXSourcesBuildPhase section */ 262 | 99368F101920F60F00ECFD57 /* Sources */ = { 263 | isa = PBXSourcesBuildPhase; 264 | buildActionMask = 2147483647; 265 | files = ( 266 | 99368F2E1920F60F00ECFD57 /* ViewController.m in Sources */, 267 | 99368F4E1920F64400ECFD57 /* THNotesTextView.m in Sources */, 268 | 99368F281920F60F00ECFD57 /* AppDelegate.m in Sources */, 269 | 99368F241920F60F00ECFD57 /* main.m in Sources */, 270 | ); 271 | runOnlyForDeploymentPostprocessing = 0; 272 | }; 273 | 99368F311920F60F00ECFD57 /* Sources */ = { 274 | isa = PBXSourcesBuildPhase; 275 | buildActionMask = 2147483647; 276 | files = ( 277 | 99368F431920F60F00ECFD57 /* THNotesTextViewExampleTests.m in Sources */, 278 | ); 279 | runOnlyForDeploymentPostprocessing = 0; 280 | }; 281 | /* End PBXSourcesBuildPhase section */ 282 | 283 | /* Begin PBXTargetDependency section */ 284 | 99368F3B1920F60F00ECFD57 /* PBXTargetDependency */ = { 285 | isa = PBXTargetDependency; 286 | target = 99368F131920F60F00ECFD57 /* THNotesTextViewExample */; 287 | targetProxy = 99368F3A1920F60F00ECFD57 /* PBXContainerItemProxy */; 288 | }; 289 | /* End PBXTargetDependency section */ 290 | 291 | /* Begin PBXVariantGroup section */ 292 | 99368F201920F60F00ECFD57 /* InfoPlist.strings */ = { 293 | isa = PBXVariantGroup; 294 | children = ( 295 | 99368F211920F60F00ECFD57 /* en */, 296 | ); 297 | name = InfoPlist.strings; 298 | sourceTree = ""; 299 | }; 300 | 99368F291920F60F00ECFD57 /* Main.storyboard */ = { 301 | isa = PBXVariantGroup; 302 | children = ( 303 | 99368F2A1920F60F00ECFD57 /* Base */, 304 | ); 305 | name = Main.storyboard; 306 | sourceTree = ""; 307 | }; 308 | 99368F3F1920F60F00ECFD57 /* InfoPlist.strings */ = { 309 | isa = PBXVariantGroup; 310 | children = ( 311 | 99368F401920F60F00ECFD57 /* en */, 312 | ); 313 | name = InfoPlist.strings; 314 | sourceTree = ""; 315 | }; 316 | /* End PBXVariantGroup section */ 317 | 318 | /* Begin XCBuildConfiguration section */ 319 | 99368F441920F60F00ECFD57 /* Debug */ = { 320 | isa = XCBuildConfiguration; 321 | buildSettings = { 322 | ALWAYS_SEARCH_USER_PATHS = NO; 323 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 324 | CLANG_CXX_LIBRARY = "libc++"; 325 | CLANG_ENABLE_MODULES = YES; 326 | CLANG_ENABLE_OBJC_ARC = YES; 327 | CLANG_WARN_BOOL_CONVERSION = YES; 328 | CLANG_WARN_CONSTANT_CONVERSION = YES; 329 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 330 | CLANG_WARN_EMPTY_BODY = YES; 331 | CLANG_WARN_ENUM_CONVERSION = YES; 332 | CLANG_WARN_INT_CONVERSION = YES; 333 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 334 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 335 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 336 | COPY_PHASE_STRIP = NO; 337 | GCC_C_LANGUAGE_STANDARD = gnu99; 338 | GCC_DYNAMIC_NO_PIC = NO; 339 | GCC_OPTIMIZATION_LEVEL = 0; 340 | GCC_PREPROCESSOR_DEFINITIONS = ( 341 | "DEBUG=1", 342 | "$(inherited)", 343 | ); 344 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 345 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 346 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 347 | GCC_WARN_UNDECLARED_SELECTOR = YES; 348 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 349 | GCC_WARN_UNUSED_FUNCTION = YES; 350 | GCC_WARN_UNUSED_VARIABLE = YES; 351 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 352 | ONLY_ACTIVE_ARCH = YES; 353 | SDKROOT = iphoneos; 354 | }; 355 | name = Debug; 356 | }; 357 | 99368F451920F60F00ECFD57 /* Release */ = { 358 | isa = XCBuildConfiguration; 359 | buildSettings = { 360 | ALWAYS_SEARCH_USER_PATHS = NO; 361 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 362 | CLANG_CXX_LIBRARY = "libc++"; 363 | CLANG_ENABLE_MODULES = YES; 364 | CLANG_ENABLE_OBJC_ARC = YES; 365 | CLANG_WARN_BOOL_CONVERSION = YES; 366 | CLANG_WARN_CONSTANT_CONVERSION = YES; 367 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 368 | CLANG_WARN_EMPTY_BODY = YES; 369 | CLANG_WARN_ENUM_CONVERSION = YES; 370 | CLANG_WARN_INT_CONVERSION = YES; 371 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 372 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 373 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 374 | COPY_PHASE_STRIP = YES; 375 | ENABLE_NS_ASSERTIONS = NO; 376 | GCC_C_LANGUAGE_STANDARD = gnu99; 377 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 378 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 379 | GCC_WARN_UNDECLARED_SELECTOR = YES; 380 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 381 | GCC_WARN_UNUSED_FUNCTION = YES; 382 | GCC_WARN_UNUSED_VARIABLE = YES; 383 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 384 | SDKROOT = iphoneos; 385 | VALIDATE_PRODUCT = YES; 386 | }; 387 | name = Release; 388 | }; 389 | 99368F471920F60F00ECFD57 /* Debug */ = { 390 | isa = XCBuildConfiguration; 391 | buildSettings = { 392 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 393 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; 394 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 395 | GCC_PREFIX_HEADER = "THNotesTextViewExample/THNotesTextViewExample-Prefix.pch"; 396 | INFOPLIST_FILE = "THNotesTextViewExample/THNotesTextViewExample-Info.plist"; 397 | PRODUCT_NAME = "$(TARGET_NAME)"; 398 | WRAPPER_EXTENSION = app; 399 | }; 400 | name = Debug; 401 | }; 402 | 99368F481920F60F00ECFD57 /* Release */ = { 403 | isa = XCBuildConfiguration; 404 | buildSettings = { 405 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 406 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; 407 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 408 | GCC_PREFIX_HEADER = "THNotesTextViewExample/THNotesTextViewExample-Prefix.pch"; 409 | INFOPLIST_FILE = "THNotesTextViewExample/THNotesTextViewExample-Info.plist"; 410 | PRODUCT_NAME = "$(TARGET_NAME)"; 411 | WRAPPER_EXTENSION = app; 412 | }; 413 | name = Release; 414 | }; 415 | 99368F4A1920F60F00ECFD57 /* Debug */ = { 416 | isa = XCBuildConfiguration; 417 | buildSettings = { 418 | BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/THNotesTextViewExample.app/THNotesTextViewExample"; 419 | FRAMEWORK_SEARCH_PATHS = ( 420 | "$(SDKROOT)/Developer/Library/Frameworks", 421 | "$(inherited)", 422 | "$(DEVELOPER_FRAMEWORKS_DIR)", 423 | ); 424 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 425 | GCC_PREFIX_HEADER = "THNotesTextViewExample/THNotesTextViewExample-Prefix.pch"; 426 | GCC_PREPROCESSOR_DEFINITIONS = ( 427 | "DEBUG=1", 428 | "$(inherited)", 429 | ); 430 | INFOPLIST_FILE = "THNotesTextViewExampleTests/THNotesTextViewExampleTests-Info.plist"; 431 | PRODUCT_NAME = "$(TARGET_NAME)"; 432 | TEST_HOST = "$(BUNDLE_LOADER)"; 433 | WRAPPER_EXTENSION = xctest; 434 | }; 435 | name = Debug; 436 | }; 437 | 99368F4B1920F60F00ECFD57 /* Release */ = { 438 | isa = XCBuildConfiguration; 439 | buildSettings = { 440 | BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/THNotesTextViewExample.app/THNotesTextViewExample"; 441 | FRAMEWORK_SEARCH_PATHS = ( 442 | "$(SDKROOT)/Developer/Library/Frameworks", 443 | "$(inherited)", 444 | "$(DEVELOPER_FRAMEWORKS_DIR)", 445 | ); 446 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 447 | GCC_PREFIX_HEADER = "THNotesTextViewExample/THNotesTextViewExample-Prefix.pch"; 448 | INFOPLIST_FILE = "THNotesTextViewExampleTests/THNotesTextViewExampleTests-Info.plist"; 449 | PRODUCT_NAME = "$(TARGET_NAME)"; 450 | TEST_HOST = "$(BUNDLE_LOADER)"; 451 | WRAPPER_EXTENSION = xctest; 452 | }; 453 | name = Release; 454 | }; 455 | /* End XCBuildConfiguration section */ 456 | 457 | /* Begin XCConfigurationList section */ 458 | 99368F0F1920F60F00ECFD57 /* Build configuration list for PBXProject "THNotesTextViewExample" */ = { 459 | isa = XCConfigurationList; 460 | buildConfigurations = ( 461 | 99368F441920F60F00ECFD57 /* Debug */, 462 | 99368F451920F60F00ECFD57 /* Release */, 463 | ); 464 | defaultConfigurationIsVisible = 0; 465 | defaultConfigurationName = Release; 466 | }; 467 | 99368F461920F60F00ECFD57 /* Build configuration list for PBXNativeTarget "THNotesTextViewExample" */ = { 468 | isa = XCConfigurationList; 469 | buildConfigurations = ( 470 | 99368F471920F60F00ECFD57 /* Debug */, 471 | 99368F481920F60F00ECFD57 /* Release */, 472 | ); 473 | defaultConfigurationIsVisible = 0; 474 | defaultConfigurationName = Release; 475 | }; 476 | 99368F491920F60F00ECFD57 /* Build configuration list for PBXNativeTarget "THNotesTextViewExampleTests" */ = { 477 | isa = XCConfigurationList; 478 | buildConfigurations = ( 479 | 99368F4A1920F60F00ECFD57 /* Debug */, 480 | 99368F4B1920F60F00ECFD57 /* Release */, 481 | ); 482 | defaultConfigurationIsVisible = 0; 483 | defaultConfigurationName = Release; 484 | }; 485 | /* End XCConfigurationList section */ 486 | }; 487 | rootObject = 99368F0C1920F60F00ECFD57 /* Project object */; 488 | } 489 | --------------------------------------------------------------------------------