OceanLabs / iOS-Print-SDK

iOS Print SDK. Easily add print on demand functionality to your app within minutes! Print Postcards, Magnets, Photo Prints, Posters, Stickers, T-Shirts, PhotoBooks, etc.
https://www.kite.ly
111 stars 33 forks source link

recentsAvailable of OLKiteUtils not working properly #298

Closed cortis closed 6 years ago

cortis commented 6 years ago

Changing cameraRollEnabled to false (aka disableCameraRoll in swift) causes button1 of the editingTools to be removedFromSuperView (inexplicably also button2 and button3). It seems the root cause for this is because the code thinks it has no imageProviders. The root cause of this is that recentsAvailable of OLKiteUtils.m has the opposite logic of what it supposed to have. It returns true if no recents are available and false otherwise.

The function should read: + (BOOL)recentsAvailable{ return [OLUserSession currentSession].appAssets.count != 0 || [OLUserSession currentSession].recentPhotos.count != 0; }

Further proof of problem: If you turn off the camera using kiteViewController.disableCameraRoll = true and send no assets to the viewController, button1 will appear but will crash when you tap it.

cortis commented 6 years ago

I added a pull request with my patch (Issue#298_cortis).