TOCropViewController icon indicating copy to clipboard operation
TOCropViewController copied to clipboard

Manual install directions incomplete or incorrect

Open driftwoodstudio opened this issue 5 years ago • 4 comments

Describe the bug Manual installation directions on project GitHub page do not work. May be missing steps implied as understood (?)

To Reproduce Steps to reproduce the behavior:

  1. Download project as zip from GitHub
  2. Unpack zip file
  3. Drag folder Objective-C/TOCropViewController into Xcode project
  4. Drag folder Swift/CropViewController into Xcode project
  5. Attempt to build: build fails with duplicate info.plist errors
  6. Delete file CropViewController/info.plist
  7. Attempt to build: build fails with 92 errors, related to lack of Foundation import mostly

Expected behavior Build succeeds.

Environment:

  • Mac Catalina
  • Xcode: 12 beta 5

Additional context This is likely due to issues with bridging-header type stuff... but it's been so long since I had to work with Objective C in iOS swift projects that I have no memory of where to start trying to debug this. Why am I doing this: Carthage issues with Xcode 12 betas. Trying to import dependency manually to not have to use Carthage until that's fixed. Directions for doing manual install do not work as written, though. Something other than "add these two folders" is necessary. This could be a "you are supposed to know this as an Xcode user" but the days of assuming everyone knows how to integrate legacy Objective C code into modern swift projects is maybe past...

driftwoodstudio avatar Aug 25 '20 17:08 driftwoodstudio

Hi @driftwoodstudio! Thanks for the very detailed step breakdown and rationale.

I think as the first one to attempt a manual install in a long time, you've discovered where the instructions sadly fell out of sync with the codebase and no one noticed. I wrote those instructions before I added Carthage support, and thus before the plist files and the framework headers were in there. Since everyone else has been using a dependency manager, it's never been highlighted before.

Thanks for the heads-up. When I get the time, I'll try and go back to correct it. If you already managed to work out what the steps are, a PR would be greatly appreciated. :)

Have a nice weekend!

TimOliver avatar Aug 29 '20 12:08 TimOliver

I’m happy to be able to help in some small way even if it’s only pointing out a minor problem. What I did to fix things was give up and install CocoaPods on my machine and use that for the dependency manager for this project. As you mentioned, there’s not really any reason to be doing manual installs for the most part, and it’s only this odd situation of Carthage’s issues with arm64 slices in compiled binaries relative to Xcode 12 changes that caused the situation to exist.

-- Bill On Aug 29, 2020, 6:00 AM -0600, Tim Oliver [email protected], wrote:

Hi @driftwoodstudio! Thanks for the very detailed step breakdown and rationale. I think as the first one to attempt a manual install in a long time, you've discovered where the instructions sadly fell out of sync with the codebase and no one noticed. I wrote those instructions before I added Carthage support, and thus before the plist files and the framework headers were in there. Since everyone else has been using a dependency manager, it's never been highlighted before. Thanks for the heads-up. When I get the time, I'll try and go back to correct it. If you already managed to work out what the steps are, a PR would be greatly appreciated. :) Have a nice weekend! — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

driftwoodstudio avatar Sep 01 '20 13:09 driftwoodstudio

Hi @driftwoodstudio! Thanks for the very detailed step breakdown and rationale.

I think as the first one to attempt a manual install in a long time, you've discovered where the instructions sadly fell out of sync with the codebase and no one noticed. I wrote those instructions before I added Carthage support, and thus before the plist files and the framework headers were in there. Since everyone else has been using a dependency manager, it's never been highlighted before.

Thanks for the heads-up. When I get the time, I'll try and go back to correct it. If you already managed to work out what the steps are, a PR would be greatly appreciated. :)

Have a nice weekend!

For manual installation you need:

  1. Download project as zip from GitHub
  2. Unpack zip file
  3. Drag folder Objective-C/TOCropViewController into Xcode project
  4. Drag folder Swift/CropViewController into Xcode project
  5. In Xcode project navigator go to folder TOCropViewController/Supporting and remove Info.plist
  6. In Xcode project navigator go to folder CropViewController and remove Info.plist
  7. In Xcode project navigator go to folder TOCropViewController/include and remove all files this folder
  8. Create bridging header for Swift project: choosing File > New > File > ios > Source > Header File (https://developer.apple.com/documentation/swift/imported_c_and_objective-c_apis/importing_objective-c_into_swift) and write this code: #import "TOCropViewController.h"
  9. Go to Project > Build Settings > All > Swift Compiler - General > Objective-C Bridging Header and write path to created earlier Bridging Header file
  10. Go to Target > Build Settings > All > Swift Compiler - General > Objective-C Bridging Header and write path to created earlier Bridging Header file
  11. Build project :)

Evg33n avatar Dec 23 '20 20:12 Evg33n

@Evg33n .. :( it did not work for me.. since i am purely based on swift so i have no knowledge of obj c i can not explore any more.. :(

Hi @driftwoodstudio! Thanks for the very detailed step breakdown and rationale. I think as the first one to attempt a manual install in a long time, you've discovered where the instructions sadly fell out of sync with the codebase and no one noticed. I wrote those instructions before I added Carthage support, and thus before the plist files and the framework headers were in there. Since everyone else has been using a dependency manager, it's never been highlighted before. Thanks for the heads-up. When I get the time, I'll try and go back to correct it. If you already managed to work out what the steps are, a PR would be greatly appreciated. :) Have a nice weekend!

For manual installation you need:

  1. Download project as zip from GitHub
  2. Unpack zip file
  3. Drag folder Objective-C/TOCropViewController into Xcode project
  4. Drag folder Swift/CropViewController into Xcode project
  5. In Xcode project navigator go to folder TOCropViewController/Supporting and remove Info.plist
  6. In Xcode project navigator go to folder CropViewController and remove Info.plist
  7. In Xcode project navigator go to folder TOCropViewController/include and remove all files this folder
  8. Create bridging header for Swift project: choosing File > New > File > ios > Source > Header File (https://developer.apple.com/documentation/swift/imported_c_and_objective-c_apis/importing_objective-c_into_swift) and write this code: #import "TOCropViewController.h"
  9. Go to Project > Build Settings > All > Swift Compiler - General > Objective-C Bridging Header and write path to created earlier Bridging Header file
  10. Go to Target > Build Settings > All > Swift Compiler - General > Objective-C Bridging Header and write path to created earlier Bridging Header file
  11. Build project :)

dipcse07 avatar Sep 08 '21 19:09 dipcse07