CYRLayoutManager.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. //
  2. // CYRLayoutManager.h
  3. //
  4. // Version 0.2.0
  5. //
  6. // Created by Illya Busigin on 01/05/2014.
  7. // Copyright (c) 2014 Cyrillian, Inc.
  8. //
  9. // Distributed under MIT license.
  10. // Get the latest version from here:
  11. //
  12. // https://github.com/illyabusigin/CYRTextView
  13. // Original implementation taken from: https://github.com/alldritt/TextKit_LineNumbers
  14. //
  15. // The MIT License (MIT)
  16. //
  17. // Copyright (c) 2014 Cyrillian, Inc.
  18. //
  19. // Permission is hereby granted, free of charge, to any person obtaining a copy of
  20. // this software and associated documentation files (the "Software"), to deal in
  21. // the Software without restriction, including without limitation the rights to
  22. // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
  23. // the Software, and to permit persons to whom the Software is furnished to do so,
  24. // subject to the following conditions:
  25. //
  26. // The above copyright notice and this permission notice shall be included in all
  27. // copies or substantial portions of the Software.
  28. //
  29. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  30. // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
  31. // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
  32. // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
  33. // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
  34. // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  35. #import <UIKit/UIKit.h>
  36. @interface CYRLayoutManager : NSLayoutManager
  37. @property (nonatomic, strong) UIFont *lineNumberFont;
  38. @property (nonatomic, strong) UIColor *lineNumberColor;
  39. @property (nonatomic, readonly) CGFloat gutterWidth;
  40. @property (nonatomic, assign) NSRange selectedRange;
  41. - (CGRect)paragraphRectForRange:(NSRange)range;
  42. @end