mrackwitz / MRProgress

Collection of iOS drop-in components to visualize progress
MIT License
2.55k stars 306 forks source link

Fix for Xcode 15 build error #142

Closed Ariandr closed 8 months ago

Ariandr commented 12 months ago

Hi @mrackwitz I implemented the fix for Xcode 15 build error. Since it's not just a warning, but an error that prevents the project from building, I think it's important. Thanks

jrdaher commented 9 months ago

Could we please merge this @mrackwitz 🙏

jrdaher commented 9 months ago

temporary fix:

Script in project folder

import fileinput
import sys

def replaceAll(file, searchExp, replaceExp):
    for line in fileinput.input(file, inplace=1):
        if searchExp in line:
            line = line.replace(searchExp,replaceExp)
        sys.stdout.write(line)

rationale_for_script = """
       //This script exists until https://github.com/mrackwitz/MRProgress/pull/142/files is merged
       //It exists to fix a build issue in Xcode 15
"""

file_to_patch = "./Pods/MRProgress/src/Components/MRProgressOverlayView.m"

text_to_find = "[((id)self.modeView) setProgress:self.progress];"

text_to_replace_match = rationale_for_script + "       [self.modeView performSelector:@selector(setProgress:) withObject:[NSNumber numberWithFloat:self.progress]];"

replaceAll(file_to_patch, text_to_find, text_to_replace_match)

in Podfile

post_install do |installer|
  system("python3 UpdateMPProgressPodForXcode15.py")
end
jrdaher commented 9 months ago

@Ariandr ☝️

Ariandr commented 9 months ago

Thanks @jrdaher

anum-ijaz-confiz commented 9 months ago

The mentioned fix worked for me as well since it was a blocker in building the project with Xcode 15. @mrackwitz kindly merge the changes.

mrackwitz commented 8 months ago

Hey folks, thanks for the PR. Looks good to me.

I'm sorry that I haven't responded here much sooner. @jrdaher Particularly sorry given the awful workaround you had to find in the meantime, but thanks for sharing.

hafiz-mohsin-confiz commented 8 months ago

@mrackwitz Kindly provide the new library update with the fix on CocoaPods so that we will update it. Thanks

Ariandr commented 6 months ago

Hi @mrackwitz Do you have a chance to update the CocoaPods version to have this PR included?