title: How to get the ImageMagick library working with Swift 4/iOS 11?
body: <p>I'm trying to get <a href="https://www.imagemagick.org/script/index.php" rel="noreferrer">ImageMagick</a> to work in my iOS project. Unfortunately everything I have tried so far has not worked.</p>
  
  <h3>Cocoapods</h3>
  
  <p>The most obvious approach would be to use the <a href="https://cocoapods.org/pods/ImageMagick" rel="noreferrer">cocoapod</a>. Unfortunately after installing the cocoapod there doesn't appear to be anything exposed to swift to import. Maybe I'm missing something obvious and if anyone has any ideas that would be great. Unfortunately the documentation is lacking as far as specific examples go.</p>
  
  <h3>Static library - approach #1</h3>
  
  <p>The <a href="http://www.imagemagick.org/script/download.php#iOS" rel="noreferrer">official ImageMagick docs</a> provide some instructions to compile the latest version of ImageMagick and include a static library in your Xcode project. Unfortunately the first step of the instructions requires running a bash script <code>imagemagick_compile.sh</code> which I cannot find. Once again I could be missing something obvious.</p>
  
  <h3>Static library - approach #2</h3>
  
  <p>After some additional searching I found the ~Claudio guy which the ImageMagick docs mention as the maintainer of the iOS version of ImageMagick. He has a <a href="https://github.com/marforic/imagemagick_lib_iphone" rel="noreferrer">repo with similar instructions</a> as provided by ImageMagick but this repo includes a bash script to compile and generate a static library of ImageMagick. I tried running the script directly <code>./all.sh 6.8.8-9</code> but soon realized I hadn't setup a <code>build</code> directory they way his instructions outlined and I got stuck getting <code>libpng</code> installed correctly.</p>
  
  <h3>Static library - approach #3</h3>
  
  <p>The <a href="https://github.com/marforic/imagemagick_lib_iphone" rel="noreferrer">same repo</a> with the instructions to compile and generate a static library also includes an old sample iOS project with a static library already included for an older version of ImageMagick. This just about worked except the ImageMagick library has a class <code>Timer</code> that clashes with the <code>Timer</code> class provided by Swift4/iOS so I couldn't get my project to compile using this static library of ImageMagick.</p>
  
  <h3>ImageMagick iOS Questions on SO</h3>
  
  <p>There are a handful of other questions on Stack Overflow that deal with running ImageMagick on iOS so I know other people have done it but nothing very recent. If anyone has any ideas that would be greatly appreciated, thanks!</p>
  
  <ul>
  <li>Un-answered question on how to use ImageMagick on iOS: <a href="https://stackoverflow.com/questions/42763965/imagemagick-ios-image">ImageMagick iOS image</a> Potentially useful comment that includes some of the same links that I provided above.</li>
  <li>Someone already using ImageMagick for iOS but gives no details on how it was implemented: <a href="https://stackoverflow.com/questions/8172512/imagemagick-circular-dstortion-on-ios">ImageMagick circular dstortion on iOS</a></li>
  <li>Un-answered question from someone already using ImageMagick in their app: <a href="https://stackoverflow.com/questions/21011520/ios-imagemagick-no-image-created-after-distortion">Ios - ImageMagick - No Image Created after Distortion</a></li>
  <li>More recent question related to warnings using the cocoapod version: <a href="https://stackoverflow.com/questions/30557967/ios-imagemagick-compiler-warnings-in-xcode">iOS: ImageMagick compiler warnings in Xcode</a></li>
  </ul>
  
  <p>Other questions: <a href="https://stackoverflow.com/search?q=imagemagick+ios">https://stackoverflow.com/search?q=imagemagick+ios</a> Unfortunately I haven't found any of these that have helped.</p>