You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: swift_runner_upgrader.rb
    path of file: ./repos/fastlane/fastlane/lib/fastlane
    
    the code of the file until where you have to start completion: require 'xcodeproj'
require 'fileutils'

module Fastlane
  # current logic:
  # - find all groups in existing project
  # -- if a group is missing, add it
  # --- add all files for group into new group, build target, and compile phase
  # - iterate through existing groups
  # -- update all files needing up
    
    def add_new_files_to_groups!
      inverted_hash = {}

      # need {group => [file1, file2, etc..]} instead of: {file1 => group, file2 => group, etc...}
      self.manifest_hash.each do |filename, group_name|
        group_name = group_name.downcase

        files_in_group = inverted_hash[group_name]
        if files_in_group.nil?
          files_in_group = []
          inverted_hash[group_name] = files_in_group
        end
        files_in_group << filename
      end