<commit_before>class TestCollectionScreen < ProMotion::CollectionScreen

  collection_layout UICollectionViewFlowLayout,
                    direction:                 :horizontal,
                    minimum_line_spacing:      10,
                    minimum_interitem_spacing: 10,
                    item_size:                 [100, 80],
                    section_inset:             [10, 10, 10, 10]

  cell_classes custom_cell: CustomCollectionViewCell

  def collection_data
    (1..10).to_a.map do |i|
      (1..10).to_a.map do |o|
        {
            cell_identifier:  :custom_cell,
            title:            "#{i}x#{o}",
            background_color: UIColor.colorWithRed(rand(255) / 255.0,
                                                   green: rand(255) / 255.0,
                                                   blue:  rand(255) / 255.0,
                                                   alpha: 1.0)
        }
      end
    end
  end
end<commit_msg>add action in example<commit_after>class TestCollectionScreen < ProMotion::CollectionScreen

  collection_layout UICollectionViewFlowLayout,
                    direction:                 :horizontal,
                    minimum_line_spacing:      10,
                    minimum_interitem_spacing: 10,
                    item_size:                 [100, 80],
                    section_inset:             [10, 10, 10, 10]

  cell_classes custom_cell: CustomCollectionViewCell

  def collection_data
    (1..10).to_a.map do |i|
      (1..10).to_a.map do |o|
        {
            cell_identifier:  :custom_cell,
            title:            "#{i}x#{o}",
            action:           'touched:',
            background_color: UIColor.colorWithRed(rand(255) / 255.0,
                                                   green: rand(255) / 255.0,
                                                   blue:  rand(255) / 255.0,
                                                   alpha: 1.0)
        }
      end
    end
  end

  def touched(_)
    alert = UIAlertController.alertControllerWithTitle("CollectionScreen",
                                                       message:        "You clicked a row",
                                                       preferredStyle: UIAlertControllerStyleAlert)

    action = UIAlertAction.actionWithTitle("OK", style: UIAlertActionStyleDefault, handler: nil)
    alert.addAction(action)
    self.presentViewController(alert, animated: true, completion: nil)
  end
end
{'fraction_non_alphanumeric': 0.08011272141706924, 'fraction_numerical': 0.037037037037037035, 'mean_word_length': 1.1932921447484555, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 16, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3942332', 'n_tokens_mistral': 671, 'n_tokens_neox': 587, 'n_words': 126}