___FILEBASENAME___.m 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295
  1. //
  2. // ___FILENAME___
  3. // ___PROJECTNAME___
  4. //
  5. // Created by ___FULLUSERNAME___ on ___DATE___.
  6. //___COPYRIGHT___
  7. //
  8. #import "___FILEBASENAME___.h"
  9. @interface ___FILEBASENAMEASIDENTIFIER___ ()
  10. @end
  11. @implementation ___FILEBASENAMEASIDENTIFIER___
  12. #pragma mark - Initializer
  13. - (id)init
  14. {
  15. #warning Potentially incomplete method implementation.
  16. self = [super initWithCollectionViewLayout:<#(UICollectionViewLayout *)#>];
  17. if (self) {
  18. }
  19. return self;
  20. }
  21. /*
  22. // Uncomment if you are using Storyboard.
  23. // You don't need to call initWithCoder: anymore
  24. + (UICollectionViewLayout *)collectionViewLayoutForCoder:(NSCoder *)decoder
  25. {
  26. return <#(UICollectionViewLayout *)#>;
  27. }
  28. */
  29. #pragma mark - View lifecycle
  30. - (void)viewDidLoad
  31. {
  32. [super viewDidLoad];
  33. // Do view setup here.
  34. }
  35. #pragma mark - SLKTextViewController Events
  36. - (void)didChangeKeyboardStatus:(SLKKeyboardStatus)status
  37. {
  38. // Notifies the view controller that the keyboard changed status.
  39. // Calling super does nothing
  40. }
  41. - (void)textWillUpdate
  42. {
  43. // Notifies the view controller that the text will update.
  44. // Calling super does nothing
  45. [super textWillUpdate];
  46. }
  47. - (void)textDidUpdate:(BOOL)animated
  48. {
  49. // Notifies the view controller that the text did update.
  50. // Must call super
  51. [super textDidUpdate:animated];
  52. }
  53. - (BOOL)canPressRightButton
  54. {
  55. // Asks if the right button can be pressed
  56. return [super canPressRightButton];
  57. }
  58. - (void)didPressRightButton:(id)sender
  59. {
  60. // Notifies the view controller when the right button's action has been triggered, manually or by using the keyboard return key.
  61. // Must call super
  62. // This little trick validates any pending auto-correction or auto-spelling just after hitting the 'Send' button
  63. [self.textView refreshFirstResponder];
  64. [super didPressRightButton:sender];
  65. }
  66. /*
  67. // Uncomment these methods for aditional events
  68. - (void)didPressLeftButton:(id)sender
  69. {
  70. // Notifies the view controller when the left button's action has been triggered, manually.
  71. [super didPressLeftButton:sender];
  72. }
  73. - (id)keyForTextCaching
  74. {
  75. // Return any valid key object for enabling text caching while composing in the text view.
  76. // Calling super does nothing
  77. }
  78. - (void)didPasteMediaContent:(NSDictionary *)userInfo
  79. {
  80. // Notifies the view controller when a user did paste a media content inside of the text view
  81. // Calling super does nothing
  82. }
  83. - (void)willRequestUndo
  84. {
  85. // Notification about when a user did shake the device to undo the typed text
  86. [super willRequestUndo];
  87. }
  88. */
  89. #pragma mark - SLKTextViewController Edition
  90. /*
  91. // Uncomment these methods to enable edit mode
  92. - (void)didCommitTextEditing:(id)sender
  93. {
  94. // Notifies the view controller when tapped on the right "Accept" button for commiting the edited text
  95. [super didCommitTextEditing:sender];
  96. }
  97. - (void)didCancelTextEditing:(id)sender
  98. {
  99. // Notifies the view controller when tapped on the left "Cancel" button
  100. [super didCancelTextEditing:sender];
  101. }
  102. */
  103. #pragma mark - SLKTextViewController Autocompletion
  104. /*
  105. // Uncomment these methods to enable autocompletion mode
  106. - (BOOL)canShowAutoCompletion
  107. {
  108. // Asks of the autocompletion view should be shown
  109. return NO;
  110. }
  111. - (CGFloat)heightForAutoCompletionView
  112. {
  113. // Asks for the height of the autocompletion view
  114. return 0.0;
  115. }
  116. */
  117. #pragma mark <UICollectionViewDataSource>
  118. - (NSInteger)numberOfSectionsInCollectionView:(UICollectionView *)collectionView
  119. {
  120. #warning Incomplete method implementation -- Return the number of sections
  121. return 0;
  122. }
  123. - (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section
  124. {
  125. #warning Incomplete method implementation -- Return the number of items in the section
  126. return 0;
  127. }
  128. - (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath
  129. {
  130. UICollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:<#@"reuseIdentifier"#> forIndexPath:indexPath];
  131. // Configure the cell
  132. return cell;
  133. }
  134. #pragma mark <UICollectionViewDelegate>
  135. /*
  136. // Uncomment this method to specify if the specified item should be highlighted during tracking
  137. - (BOOL)collectionView:(UICollectionView *)collectionView shouldHighlightItemAtIndexPath:(NSIndexPath *)indexPath
  138. {
  139. return YES;
  140. }
  141. */
  142. /*
  143. // Uncomment this method to specify if the specified item should be selected
  144. - (BOOL)collectionView:(UICollectionView *)collectionView shouldSelectItemAtIndexPath:(NSIndexPath *)indexPath
  145. {
  146. return YES;
  147. }
  148. */
  149. /*
  150. // Uncomment these methods to specify if an action menu should be displayed for the specified item, and react to actions performed on the item
  151. - (BOOL)collectionView:(UICollectionView *)collectionView shouldShowMenuForItemAtIndexPath:(NSIndexPath *)indexPath
  152. {
  153. return NO;
  154. }
  155. - (BOOL)collectionView:(UICollectionView *)collectionView canPerformAction:(SEL)action forItemAtIndexPath:(NSIndexPath *)indexPath withSender:(id)sender
  156. {
  157. return NO;
  158. }
  159. - (void)collectionView:(UICollectionView *)collectionView performAction:(SEL)action forItemAtIndexPath:(NSIndexPath *)indexPath withSender:(id)sender
  160. {
  161. }
  162. */
  163. #pragma mark - <UITableViewDataSource>
  164. - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
  165. {
  166. #warning Potentially incomplete method implementation.
  167. // Returns the number of sections.
  168. return 0;
  169. }
  170. - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
  171. {
  172. #warning Incomplete method implementation.
  173. // Returns the number of rows in the section.
  174. if ([tableView isEqual:self.autoCompletionView]) {
  175. return 0;
  176. }
  177. return 0;
  178. }
  179. /*
  180. // Uncomment these methods to configure the cells
  181. - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
  182. {
  183. UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:<#@"reuseIdentifier"#> forIndexPath:indexPath];
  184. if ([tableView isEqual:self.autoCompletionView]) {
  185. // Configure the autocompletion cell...
  186. }
  187. return cell;
  188. }
  189. - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
  190. {
  191. // Returns the height each row
  192. if ([tableView isEqual:self.autoCompletionView]) {
  193. return 0;
  194. }
  195. }
  196. */
  197. #pragma mark - <UITableViewDelegate>
  198. /*
  199. // Uncomment this method to handle the cell selection
  200. - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
  201. {
  202. if ([tableView isEqual:self.autoCompletionView]) {
  203. [self acceptAutoCompletionWithString:<#@"any_string"#>];
  204. }
  205. }
  206. */
  207. #pragma mark - View lifeterm
  208. - (void)didReceiveMemoryWarning
  209. {
  210. [super didReceiveMemoryWarning];
  211. }
  212. - (void)dealloc
  213. {
  214. }
  215. @end