TimOliver / TOCropViewController

A view controller for iOS that allows users to crop portions of UIImage objects
http://www.timoliver.com.au/2015/06/21/tocropviewcontroller-an-open-source-image-cropper-for-ios/
MIT License
4.67k stars 929 forks source link

Tuist support #548

Closed st-small closed 3 months ago

st-small commented 1 year ago

Hi folks! Does anybody use CropViewController in the project with Tuist? When I try to set dependency I got an error that CropViewController is missing. Is it possible to fix them?

nickaroot commented 3 months ago

Tuist glitch, Swift Package Manager headers not added automatically (sometimes)

Fix (Tuist 4.6.0):

Add _HEADER_SEARCHPATHS, _OTHERCFLAGS and _OTHER_SWIFTFLAGS to any target importing TOCropViewController like this:

let project = Project(
    ...
    settings: .settings(
        base: [
            "HEADER_SEARCH_PATHS": [
                "$(SRCROOT)/Tuist/.build/checkouts/TOCropViewController/Objective-C/TOCropViewController/include/TOCropViewController",
            ],
            "OTHER_CFLAGS": [
                "-fmodule-map-file=$(SRCROOT)/Tuist/.build/tuist-derived/TOCropViewController/TOCropViewController.modulemap",
            ],
            "OTHER_SWIFT_FLAGS": [
                "-Xcc",
                "-fmodule-map-file=$(SRCROOT)/Tuist/.build/tuist-derived/TOCropViewController/TOCropViewController.modulemap",
            ],
        ],
        ...
    )
    ...
)
TimOliver commented 3 months ago

Thanks so much for resolving that! I would have had no idea what was going on. 😅