title: Pin a saved notes in UIWebView
body: <p>I have UIWebView for displays HTML articles. When user touch some area in UIWebView, UIMenuController will display. Then user select note button it displays UITextView, then user can able to write some text, after that user can store the text to that touched area like Documents by Readdle app. I created upto write text and save to database. After saving text i need to show button on touched area. How to enable button?</p>
  
  <p>UIWEbView displays the articles pages:</p>
  
  <p><img src="https://i.stack.imgur.com/P0Q5m.png" alt="enter image description here"></p>
  
  <p>After longpress UIMenuController will displays, then choose notes</p>
  
  <p><img src="https://i.stack.imgur.com/0tP04.png" alt="enter image description here"></p>
  
  <p>After choosing notes UITextView will appear for write some notes, then click Done button the UItextView will remove then UIWebView will appear.<img src="https://i.stack.imgur.com/5qB5O.png" alt="enter image description here"></p>
  
  <p>I need to displays the small button or icon in uiwebview longpress position. In Above UIWebView position is <code>Commences</code>. In near commences text i need to display the small icon after click Done button</p>
  
  <pre><code>- (void)viewDidLoad
  {
      [wbCont loadHTMLString:webString baseURL:nil];
      wbCont.userInteractionEnabled=YES;
      [self.view addSubview:wbCont];
  
      menuItem = [[UIMenuItem alloc] initWithTitle:@"Notes" action:@selector(note:)];
      [items addObject:menuItem];
  
  }
  </code></pre>
  
  <p>After longpress UIMenuItem will open and click note then open UItextView</p>
  
  <pre><code>- (void)note:(id)sender{
  
      NSLog(@"Note");
  
      self.navigationController.navigationBarHidden=YES;
  
      txtview = [[UITextView alloc]initWithFrame:CGRectMake(0,0,320,568)];
  
      txtview.font = [UIFont fontWithName:@"Helvetica" size:12];
      txtview.font = [UIFont boldSystemFontOfSize:12];
      txtview.backgroundColor = [UIColor whiteColor];
      txtview.scrollEnabled = YES;
      txtview.pagingEnabled = YES;
      txtview.editable = YES;
  
      [self.view addSubview:txtview];
  
      button = [UIButton buttonWithType:UIButtonTypeRoundedRect];
      [button addTarget:self
                 action:@selector(click:)
      forControlEvents:UIControlEventTouchDown];
      [button setTitle:@"Done" forState:UIControlStateNormal];
      button.frame = CGRectMake(240.0, 20.0, 60.0, 40.0);
      [txtview addSubview:button];
  
  }
  </code></pre>
  
  <p>Then click Done button i save the text:</p>
  
  <pre><code>-(void)click:(id)sender{
  
      NSLog(@"done");
  
      NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,NSUserDomainMask, YES);
      NSString *documentsDirectory = [paths objectAtIndex:0];
  
      // NSString *documentsDirectory = [paths objectAtIndex:1];
  
      NSString *path = [documentsDirectory stringByAppendingPathComponent:@"ohs.sqlite"];
      NSLog(@"filepath %@",path);
  
  
      if (sqlite3_open([path UTF8String], &amp;database) == SQLITE_OK) {
  
          const char *sql = [[NSString stringWithFormat:@"SELECT textnotes FROM textnote where textnote = '%@'",txtview.text] cStringUsingEncoding:NSUTF8StringEncoding];
  
          NSLog(@"sql is %s",sql);
  
          BOOL favExist = false;
  
          sqlite3_stmt *statement, *addStmt;
  
          if (sqlite3_prepare_v2(database, sql, -1, &amp;statement, NULL) == SQLITE_OK) {
              // We "step" through the results - once for each row.
              while (sqlite3_step(statement) == SQLITE_ROW) {
  
              favExist = true;
              }
          }
  
          if(!favExist){
  
              const char *sqlInsert = [[NSString stringWithFormat:@"insert into textnote (textnotes ) values ('%@')", txtview.text] cStringUsingEncoding:NSUTF8StringEncoding];
  
              NSLog(@"sql insert is %s",sqlInsert);
  
              // [catID release];
  
              if(sqlite3_prepare_v2(database, sqlInsert, -1, &amp;addStmt, NULL) != SQLITE_OK)
                  NSAssert1(0, @"Error while creating add statement. '%s'", sqlite3_errmsg(database));
  
              if(SQLITE_DONE != sqlite3_step(addStmt))
                  NSAssert1(0, @"Error while inserting data. '%s'", sqlite3_errmsg(database));
  
  
         }else {
  
          }
  
      }
  
      [txtview removeFromSuperview];
      [button removeFromSuperview];
  
    }
  </code></pre>
  
  <p>After saving text i remove the textview, button. Then the UIWebView will display. UIwebView tocuh position how to displays the button for saving text like Documents by readdle app.</p>