moqod / ios-scratch-n-see

The project provides en effect when the user swipes the finger over one texture and by swiping reveals the texture underneath it. The effect can be applied for scratch-card action or wiping a misted glass.
421 stars 104 forks source link

Objective-C version #18

Open rabehssera opened 7 years ago

rabehssera commented 7 years ago

Hi

I got trouble adding this library to my objective-c project. When I do, I get the "Use of @import" alert.

Any help ?

AlexIzh commented 7 years ago

How did you add this library to your project? You can just drag&drop /Scratch&See/Classes/MDScratchImageView folder in your project. These classes are written on Objective-C, so, you shouldn't have any problems.

rabehssera commented 7 years ago

I copied the exact folder.

When I launch a Build, I get the error : "Use of '@import' when modules are disabled". If I delete the folder, the Build works perfectly.

The files containing @import are in Pods files, so I can't correct them myself.

AlexIzh commented 7 years ago

So, do you try to declare MDScratchImageView through @import keyword? If so, are you sure that modules are enabled in your project and these files(MDScratchImageView and MDMatrix) are contained in separate library/project? If not, you just should paste #import "MDScratchImageView.h" in your class where you want to use it.

rabehssera commented 7 years ago

I don't try to import the library anywhere for now.

The @import are "@import CoreKit" and "@import UIKit" in other files.

AlexIzh commented 7 years ago

And your project is being compiled successfully and modules are disabled? Are "link frameworkks automatically" enabled? Which Xcode version do you use? If modules are disabled in project, then you can't use @import. Also, this library requires to use "line framework automatically" or links to "UIKit" and "CoreGraphics" manually in project (in Build Phases)

rabehssera commented 7 years ago

When I don't have the library in the project, it compiles correctly. Link Framework Automatically is at YES I use Xcode 8.1

Modules are enabled ("Allow non-modular includes..." is at NO, the rest is at YES).

georgesjamous commented 7 years ago

There hasn't been any new comments in a while here, and I am having the same problem. @rabehssera did you find a solution for this yet ?