{"action":"created","issue":{"url":"https://api.github.com/repos/mxcl/PromiseKit/issues/115","labels_url":"https://api.github.com/repos/mxcl/PromiseKit/issues/115/labels{/name}","comments_url":"https://api.github.com/repos/mxcl/PromiseKit/issues/115/comments","events_url":"https://api.github.com/repos/mxcl/PromiseKit/issues/115/events","html_url":"https://github.com/mxcl/PromiseKit/issues/115","id":50456978,"number":115,"title":"When adding swift/PromiseKit.xcodeproj, a linker error occurs if you never `import AssetsLibrary`","user":{"login":"dimroc","id":635121,"avatar_url":"https://avatars.githubusercontent.com/u/635121?v=3","gravatar_id":"","url":"https://api.github.com/users/dimroc","html_url":"https://github.com/dimroc","followers_url":"https://api.github.com/users/dimroc/followers","following_url":"https://api.github.com/users/dimroc/following{/other_user}","gists_url":"https://api.github.com/users/dimroc/gists{/gist_id}","starred_url":"https://api.github.com/users/dimroc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dimroc/subscriptions","organizations_url":"https://api.github.com/users/dimroc/orgs","repos_url":"https://api.github.com/users/dimroc/repos","events_url":"https://api.github.com/users/dimroc/events{/privacy}","received_events_url":"https://api.github.com/users/dimroc/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/mxcl/PromiseKit/labels/swift","name":"swift","color":"5319e7"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2014-11-30T12:54:51Z","updated_at":"2015-02-02T08:03:28Z","closed_at":null,"body":"Given a project where you never `import AssetsLibrary`, i.e.:\r\n\r\n```swift\r\nimport Foundation\r\n//import AssetsLibrary\r\nimport PromiseKit\r\n```\r\n\r\nRunning your project will result in the following:\r\n\r\n```bash\r\ndyld: Library not loaded: @rpath/libswiftAssetsLibrary.dylib\r\n  Referenced from: /Users/dimroc/Library/Developer/Xcode/DerivedData/ManhattanForum-ekevinzlbwehjbdjpibmdbxqdqtm/Build/Products/Debug-iphonesimulator/PromiseKit.framework/PromiseKit\r\n  Reason: image not found\r\n```\r\n\r\n\r\nThis might be due to the following lines of code in `PromiseKit/swift/Sources/UIViewController+Promise.swift`:\r\n\r\n```swift\r\n4: import AssetsLibrary.ALAssetsLibrary\r\n```\r\n\r\nSimply uncommenting the `import AssetsLibrary` in the main application, cleaning, and building fixes the problem.\r\n\r\n\r\nI'm not sure there is an explicit fix for this, especially with the inevitable cocoapod support for swift. I figured I would document it here in case other people run into the issue. Is there a stackoverflow tag I should use instead?"},"comment":{"url":"https://api.github.com/repos/mxcl/PromiseKit/issues/comments/72418731","html_url":"https://github.com/mxcl/PromiseKit/issues/115#issuecomment-72418731","issue_url":"https://api.github.com/repos/mxcl/PromiseKit/issues/115","id":72418731,"user":{"login":"mxcl","id":58962,"avatar_url":"https://avatars.githubusercontent.com/u/58962?v=3","gravatar_id":"","url":"https://api.github.com/users/mxcl","html_url":"https://github.com/mxcl","followers_url":"https://api.github.com/users/mxcl/followers","following_url":"https://api.github.com/users/mxcl/following{/other_user}","gists_url":"https://api.github.com/users/mxcl/gists{/gist_id}","starred_url":"https://api.github.com/users/mxcl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mxcl/subscriptions","organizations_url":"https://api.github.com/users/mxcl/orgs","repos_url":"https://api.github.com/users/mxcl/repos","events_url":"https://api.github.com/users/mxcl/events{/privacy}","received_events_url":"https://api.github.com/users/mxcl/received_events","type":"User","site_admin":false},"created_at":"2015-02-02T08:03:28Z","updated_at":"2015-02-02T08:03:28Z","body":"The new `PromiseKit/Swift` pod imports AssetsLibrary. However I'd rather load it at runtime on demand. Since it is used only to provide the raw NSData for the image, if the user asks for that version of the Promise, so mostly it is a waste to load. So I'll leave this ticket open with that goal in mind."}}