marinofaggiana 5 years ago
parent
commit
67b24fa906
56 changed files with 19 additions and 3073 deletions
  1. 0 196
      Nextcloud.xcodeproj/project.pbxproj
  2. 5 4
      iOSClient/Favorites/CCFavorites.m
  3. 1 0
      iOSClient/Library/AHKActionSheet/AHKActionSheetViewController.m
  4. BIN
      iOSClient/Library/MWPhotoBrowser/Assets/ImageError.png
  5. BIN
      iOSClient/Library/MWPhotoBrowser/Assets/ImageError@2x.png
  6. BIN
      iOSClient/Library/MWPhotoBrowser/Assets/ImageError@3x.png
  7. BIN
      iOSClient/Library/MWPhotoBrowser/Assets/ImageSelectedOff.png
  8. BIN
      iOSClient/Library/MWPhotoBrowser/Assets/ImageSelectedOff@2x.png
  9. BIN
      iOSClient/Library/MWPhotoBrowser/Assets/ImageSelectedOff@3x.png
  10. BIN
      iOSClient/Library/MWPhotoBrowser/Assets/ImageSelectedOn.png
  11. BIN
      iOSClient/Library/MWPhotoBrowser/Assets/ImageSelectedOn@2x.png
  12. BIN
      iOSClient/Library/MWPhotoBrowser/Assets/ImageSelectedOn@3x.png
  13. BIN
      iOSClient/Library/MWPhotoBrowser/Assets/ImageSelectedSmallOff.png
  14. BIN
      iOSClient/Library/MWPhotoBrowser/Assets/ImageSelectedSmallOff@2x.png
  15. BIN
      iOSClient/Library/MWPhotoBrowser/Assets/ImageSelectedSmallOff@3x.png
  16. BIN
      iOSClient/Library/MWPhotoBrowser/Assets/ImageSelectedSmallOn.png
  17. BIN
      iOSClient/Library/MWPhotoBrowser/Assets/ImageSelectedSmallOn@2x.png
  18. BIN
      iOSClient/Library/MWPhotoBrowser/Assets/ImageSelectedSmallOn@3x.png
  19. BIN
      iOSClient/Library/MWPhotoBrowser/Assets/PlayButtonOverlayLarge.png
  20. BIN
      iOSClient/Library/MWPhotoBrowser/Assets/PlayButtonOverlayLarge@2x.png
  21. BIN
      iOSClient/Library/MWPhotoBrowser/Assets/PlayButtonOverlayLarge@3x.png
  22. BIN
      iOSClient/Library/MWPhotoBrowser/Assets/PlayButtonOverlayLargeTap.png
  23. BIN
      iOSClient/Library/MWPhotoBrowser/Assets/PlayButtonOverlayLargeTap@2x.png
  24. BIN
      iOSClient/Library/MWPhotoBrowser/Assets/PlayButtonOverlayLargeTap@3x.png
  25. BIN
      iOSClient/Library/MWPhotoBrowser/Assets/UIBarButtonItemArrowLeft.png
  26. BIN
      iOSClient/Library/MWPhotoBrowser/Assets/UIBarButtonItemArrowLeft@2x.png
  27. BIN
      iOSClient/Library/MWPhotoBrowser/Assets/UIBarButtonItemArrowLeft@3x.png
  28. BIN
      iOSClient/Library/MWPhotoBrowser/Assets/UIBarButtonItemArrowRight.png
  29. BIN
      iOSClient/Library/MWPhotoBrowser/Assets/UIBarButtonItemArrowRight@2x.png
  30. BIN
      iOSClient/Library/MWPhotoBrowser/Assets/UIBarButtonItemArrowRight@3x.png
  31. BIN
      iOSClient/Library/MWPhotoBrowser/Assets/UIBarButtonItemGrid.png
  32. BIN
      iOSClient/Library/MWPhotoBrowser/Assets/UIBarButtonItemGrid@2x.png
  33. BIN
      iOSClient/Library/MWPhotoBrowser/Assets/UIBarButtonItemGrid@3x.png
  34. BIN
      iOSClient/Library/MWPhotoBrowser/Assets/VideoOverlay.png
  35. BIN
      iOSClient/Library/MWPhotoBrowser/Assets/VideoOverlay@2x.png
  36. BIN
      iOSClient/Library/MWPhotoBrowser/Assets/VideoOverlay@3x.png
  37. 0 37
      iOSClient/Library/MWPhotoBrowser/MWCaptionView.h
  38. 0 77
      iOSClient/Library/MWPhotoBrowser/MWCaptionView.m
  39. 0 12
      iOSClient/Library/MWPhotoBrowser/MWCommon.h
  40. 0 36
      iOSClient/Library/MWPhotoBrowser/MWPhoto.h
  41. 0 322
      iOSClient/Library/MWPhotoBrowser/MWPhoto.m
  42. 0 92
      iOSClient/Library/MWPhotoBrowser/MWPhotoBrowser.h
  43. 0 1433
      iOSClient/Library/MWPhotoBrowser/MWPhotoBrowser.m
  44. 0 117
      iOSClient/Library/MWPhotoBrowser/MWPhotoBrowserPrivate.h
  45. 0 71
      iOSClient/Library/MWPhotoBrowser/MWPhotoProtocol.h
  46. 0 29
      iOSClient/Library/MWPhotoBrowser/MWTapDetectingImageView.h
  47. 0 68
      iOSClient/Library/MWPhotoBrowser/MWTapDetectingImageView.m
  48. 0 29
      iOSClient/Library/MWPhotoBrowser/MWTapDetectingView.h
  49. 0 61
      iOSClient/Library/MWPhotoBrowser/MWTapDetectingView.m
  50. 0 34
      iOSClient/Library/MWPhotoBrowser/MWZoomingScrollView.h
  51. 0 402
      iOSClient/Library/MWPhotoBrowser/MWZoomingScrollView.m
  52. 0 18
      iOSClient/Library/MWPhotoBrowser/UIImage+MWPhotoBrowser.h
  53. 0 24
      iOSClient/Library/MWPhotoBrowser/UIImage+MWPhotoBrowser.m
  54. 8 7
      iOSClient/Main/CCMain.m
  55. 3 2
      iOSClient/Share/NCSharePaging.swift
  56. 2 2
      iOSClient/Shares/NCShares.m

+ 0 - 196
Nextcloud.xcodeproj/project.pbxproj

@@ -538,46 +538,6 @@
 		F7E4D9C422ED929B003675FD /* NCShareComments.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7E4D9C322ED929B003675FD /* NCShareComments.swift */; };
 		F7E9C41B20F4CA870040CF18 /* CCTransfers.m in Sources */ = {isa = PBXBuildFile; fileRef = F7E9C41820F4CA870040CF18 /* CCTransfers.m */; };
 		F7F4B1D823C74B3E00D82A6E /* NCRichWorkspace.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7F4B1D723C74B3E00D82A6E /* NCRichWorkspace.swift */; };
-		F7F54CE51E5B14C700E19C62 /* ImageError.png in Resources */ = {isa = PBXBuildFile; fileRef = F7F54CAF1E5B14C700E19C62 /* ImageError.png */; };
-		F7F54CE61E5B14C700E19C62 /* ImageError@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = F7F54CB01E5B14C700E19C62 /* ImageError@2x.png */; };
-		F7F54CE71E5B14C700E19C62 /* ImageError@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = F7F54CB11E5B14C700E19C62 /* ImageError@3x.png */; };
-		F7F54CE81E5B14C700E19C62 /* ImageSelectedOff.png in Resources */ = {isa = PBXBuildFile; fileRef = F7F54CB21E5B14C700E19C62 /* ImageSelectedOff.png */; };
-		F7F54CE91E5B14C700E19C62 /* ImageSelectedOff@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = F7F54CB31E5B14C700E19C62 /* ImageSelectedOff@2x.png */; };
-		F7F54CEA1E5B14C700E19C62 /* ImageSelectedOff@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = F7F54CB41E5B14C700E19C62 /* ImageSelectedOff@3x.png */; };
-		F7F54CEB1E5B14C700E19C62 /* ImageSelectedOn.png in Resources */ = {isa = PBXBuildFile; fileRef = F7F54CB51E5B14C700E19C62 /* ImageSelectedOn.png */; };
-		F7F54CEC1E5B14C700E19C62 /* ImageSelectedOn@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = F7F54CB61E5B14C700E19C62 /* ImageSelectedOn@2x.png */; };
-		F7F54CED1E5B14C700E19C62 /* ImageSelectedOn@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = F7F54CB71E5B14C700E19C62 /* ImageSelectedOn@3x.png */; };
-		F7F54CEE1E5B14C700E19C62 /* ImageSelectedSmallOff.png in Resources */ = {isa = PBXBuildFile; fileRef = F7F54CB81E5B14C700E19C62 /* ImageSelectedSmallOff.png */; };
-		F7F54CEF1E5B14C700E19C62 /* ImageSelectedSmallOff@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = F7F54CB91E5B14C700E19C62 /* ImageSelectedSmallOff@2x.png */; };
-		F7F54CF01E5B14C700E19C62 /* ImageSelectedSmallOff@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = F7F54CBA1E5B14C700E19C62 /* ImageSelectedSmallOff@3x.png */; };
-		F7F54CF11E5B14C700E19C62 /* ImageSelectedSmallOn.png in Resources */ = {isa = PBXBuildFile; fileRef = F7F54CBB1E5B14C700E19C62 /* ImageSelectedSmallOn.png */; };
-		F7F54CF21E5B14C700E19C62 /* ImageSelectedSmallOn@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = F7F54CBC1E5B14C700E19C62 /* ImageSelectedSmallOn@2x.png */; };
-		F7F54CF31E5B14C700E19C62 /* ImageSelectedSmallOn@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = F7F54CBD1E5B14C700E19C62 /* ImageSelectedSmallOn@3x.png */; };
-		F7F54CF41E5B14C700E19C62 /* PlayButtonOverlayLarge.png in Resources */ = {isa = PBXBuildFile; fileRef = F7F54CBE1E5B14C700E19C62 /* PlayButtonOverlayLarge.png */; };
-		F7F54CF51E5B14C700E19C62 /* PlayButtonOverlayLarge@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = F7F54CBF1E5B14C700E19C62 /* PlayButtonOverlayLarge@2x.png */; };
-		F7F54CF61E5B14C700E19C62 /* PlayButtonOverlayLarge@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = F7F54CC01E5B14C700E19C62 /* PlayButtonOverlayLarge@3x.png */; };
-		F7F54CF71E5B14C700E19C62 /* PlayButtonOverlayLargeTap.png in Resources */ = {isa = PBXBuildFile; fileRef = F7F54CC11E5B14C700E19C62 /* PlayButtonOverlayLargeTap.png */; };
-		F7F54CF81E5B14C700E19C62 /* PlayButtonOverlayLargeTap@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = F7F54CC21E5B14C700E19C62 /* PlayButtonOverlayLargeTap@2x.png */; };
-		F7F54CF91E5B14C700E19C62 /* PlayButtonOverlayLargeTap@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = F7F54CC31E5B14C700E19C62 /* PlayButtonOverlayLargeTap@3x.png */; };
-		F7F54CFA1E5B14C700E19C62 /* UIBarButtonItemArrowLeft.png in Resources */ = {isa = PBXBuildFile; fileRef = F7F54CC41E5B14C700E19C62 /* UIBarButtonItemArrowLeft.png */; };
-		F7F54CFB1E5B14C700E19C62 /* UIBarButtonItemArrowLeft@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = F7F54CC51E5B14C700E19C62 /* UIBarButtonItemArrowLeft@2x.png */; };
-		F7F54CFC1E5B14C700E19C62 /* UIBarButtonItemArrowLeft@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = F7F54CC61E5B14C700E19C62 /* UIBarButtonItemArrowLeft@3x.png */; };
-		F7F54CFD1E5B14C700E19C62 /* UIBarButtonItemArrowRight.png in Resources */ = {isa = PBXBuildFile; fileRef = F7F54CC71E5B14C700E19C62 /* UIBarButtonItemArrowRight.png */; };
-		F7F54CFE1E5B14C700E19C62 /* UIBarButtonItemArrowRight@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = F7F54CC81E5B14C700E19C62 /* UIBarButtonItemArrowRight@2x.png */; };
-		F7F54CFF1E5B14C700E19C62 /* UIBarButtonItemArrowRight@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = F7F54CC91E5B14C700E19C62 /* UIBarButtonItemArrowRight@3x.png */; };
-		F7F54D001E5B14C700E19C62 /* UIBarButtonItemGrid.png in Resources */ = {isa = PBXBuildFile; fileRef = F7F54CCA1E5B14C700E19C62 /* UIBarButtonItemGrid.png */; };
-		F7F54D011E5B14C700E19C62 /* UIBarButtonItemGrid@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = F7F54CCB1E5B14C700E19C62 /* UIBarButtonItemGrid@2x.png */; };
-		F7F54D021E5B14C700E19C62 /* UIBarButtonItemGrid@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = F7F54CCC1E5B14C700E19C62 /* UIBarButtonItemGrid@3x.png */; };
-		F7F54D031E5B14C800E19C62 /* VideoOverlay.png in Resources */ = {isa = PBXBuildFile; fileRef = F7F54CCD1E5B14C700E19C62 /* VideoOverlay.png */; };
-		F7F54D041E5B14C800E19C62 /* VideoOverlay@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = F7F54CCE1E5B14C700E19C62 /* VideoOverlay@2x.png */; };
-		F7F54D051E5B14C800E19C62 /* VideoOverlay@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = F7F54CCF1E5B14C700E19C62 /* VideoOverlay@3x.png */; };
-		F7F54D061E5B14C800E19C62 /* MWCaptionView.m in Sources */ = {isa = PBXBuildFile; fileRef = F7F54CD11E5B14C700E19C62 /* MWCaptionView.m */; };
-		F7F54D091E5B14C800E19C62 /* MWPhoto.m in Sources */ = {isa = PBXBuildFile; fileRef = F7F54CD81E5B14C700E19C62 /* MWPhoto.m */; };
-		F7F54D0A1E5B14C800E19C62 /* MWPhotoBrowser.m in Sources */ = {isa = PBXBuildFile; fileRef = F7F54CDA1E5B14C700E19C62 /* MWPhotoBrowser.m */; };
-		F7F54D0B1E5B14C800E19C62 /* MWTapDetectingImageView.m in Sources */ = {isa = PBXBuildFile; fileRef = F7F54CDE1E5B14C700E19C62 /* MWTapDetectingImageView.m */; };
-		F7F54D0C1E5B14C800E19C62 /* MWTapDetectingView.m in Sources */ = {isa = PBXBuildFile; fileRef = F7F54CE01E5B14C700E19C62 /* MWTapDetectingView.m */; };
-		F7F54D0D1E5B14C800E19C62 /* MWZoomingScrollView.m in Sources */ = {isa = PBXBuildFile; fileRef = F7F54CE21E5B14C700E19C62 /* MWZoomingScrollView.m */; };
-		F7F54D0E1E5B14C800E19C62 /* UIImage+MWPhotoBrowser.m in Sources */ = {isa = PBXBuildFile; fileRef = F7F54CE41E5B14C700E19C62 /* UIImage+MWPhotoBrowser.m */; };
 		F7F878AE1FB9E3B900599E4F /* NCEndToEndMetadata.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7F878AD1FB9E3B900599E4F /* NCEndToEndMetadata.swift */; };
 		F7F878AF1FB9E3B900599E4F /* NCEndToEndMetadata.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7F878AD1FB9E3B900599E4F /* NCEndToEndMetadata.swift */; };
 		F7F8D71C1ED6183000E711F3 /* CCCellShareExt.m in Sources */ = {isa = PBXBuildFile; fileRef = F7F8D71A1ED6183000E711F3 /* CCCellShareExt.m */; };
@@ -1292,56 +1252,6 @@
 		F7E9C41820F4CA870040CF18 /* CCTransfers.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCTransfers.m; sourceTree = "<group>"; };
 		F7F0617A1BAACDD300846525 /* CryptoCloud.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CryptoCloud.pch; sourceTree = "<group>"; };
 		F7F4B1D723C74B3E00D82A6E /* NCRichWorkspace.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCRichWorkspace.swift; sourceTree = "<group>"; };
-		F7F54CAF1E5B14C700E19C62 /* ImageError.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = ImageError.png; sourceTree = "<group>"; };
-		F7F54CB01E5B14C700E19C62 /* ImageError@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "ImageError@2x.png"; sourceTree = "<group>"; };
-		F7F54CB11E5B14C700E19C62 /* ImageError@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "ImageError@3x.png"; sourceTree = "<group>"; };
-		F7F54CB21E5B14C700E19C62 /* ImageSelectedOff.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = ImageSelectedOff.png; sourceTree = "<group>"; };
-		F7F54CB31E5B14C700E19C62 /* ImageSelectedOff@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "ImageSelectedOff@2x.png"; sourceTree = "<group>"; };
-		F7F54CB41E5B14C700E19C62 /* ImageSelectedOff@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "ImageSelectedOff@3x.png"; sourceTree = "<group>"; };
-		F7F54CB51E5B14C700E19C62 /* ImageSelectedOn.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = ImageSelectedOn.png; sourceTree = "<group>"; };
-		F7F54CB61E5B14C700E19C62 /* ImageSelectedOn@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "ImageSelectedOn@2x.png"; sourceTree = "<group>"; };
-		F7F54CB71E5B14C700E19C62 /* ImageSelectedOn@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "ImageSelectedOn@3x.png"; sourceTree = "<group>"; };
-		F7F54CB81E5B14C700E19C62 /* ImageSelectedSmallOff.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = ImageSelectedSmallOff.png; sourceTree = "<group>"; };
-		F7F54CB91E5B14C700E19C62 /* ImageSelectedSmallOff@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "ImageSelectedSmallOff@2x.png"; sourceTree = "<group>"; };
-		F7F54CBA1E5B14C700E19C62 /* ImageSelectedSmallOff@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "ImageSelectedSmallOff@3x.png"; sourceTree = "<group>"; };
-		F7F54CBB1E5B14C700E19C62 /* ImageSelectedSmallOn.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = ImageSelectedSmallOn.png; sourceTree = "<group>"; };
-		F7F54CBC1E5B14C700E19C62 /* ImageSelectedSmallOn@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "ImageSelectedSmallOn@2x.png"; sourceTree = "<group>"; };
-		F7F54CBD1E5B14C700E19C62 /* ImageSelectedSmallOn@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "ImageSelectedSmallOn@3x.png"; sourceTree = "<group>"; };
-		F7F54CBE1E5B14C700E19C62 /* PlayButtonOverlayLarge.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = PlayButtonOverlayLarge.png; sourceTree = "<group>"; };
-		F7F54CBF1E5B14C700E19C62 /* PlayButtonOverlayLarge@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "PlayButtonOverlayLarge@2x.png"; sourceTree = "<group>"; };
-		F7F54CC01E5B14C700E19C62 /* PlayButtonOverlayLarge@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "PlayButtonOverlayLarge@3x.png"; sourceTree = "<group>"; };
-		F7F54CC11E5B14C700E19C62 /* PlayButtonOverlayLargeTap.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = PlayButtonOverlayLargeTap.png; sourceTree = "<group>"; };
-		F7F54CC21E5B14C700E19C62 /* PlayButtonOverlayLargeTap@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "PlayButtonOverlayLargeTap@2x.png"; sourceTree = "<group>"; };
-		F7F54CC31E5B14C700E19C62 /* PlayButtonOverlayLargeTap@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "PlayButtonOverlayLargeTap@3x.png"; sourceTree = "<group>"; };
-		F7F54CC41E5B14C700E19C62 /* UIBarButtonItemArrowLeft.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = UIBarButtonItemArrowLeft.png; sourceTree = "<group>"; };
-		F7F54CC51E5B14C700E19C62 /* UIBarButtonItemArrowLeft@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "UIBarButtonItemArrowLeft@2x.png"; sourceTree = "<group>"; };
-		F7F54CC61E5B14C700E19C62 /* UIBarButtonItemArrowLeft@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "UIBarButtonItemArrowLeft@3x.png"; sourceTree = "<group>"; };
-		F7F54CC71E5B14C700E19C62 /* UIBarButtonItemArrowRight.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = UIBarButtonItemArrowRight.png; sourceTree = "<group>"; };
-		F7F54CC81E5B14C700E19C62 /* UIBarButtonItemArrowRight@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "UIBarButtonItemArrowRight@2x.png"; sourceTree = "<group>"; };
-		F7F54CC91E5B14C700E19C62 /* UIBarButtonItemArrowRight@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "UIBarButtonItemArrowRight@3x.png"; sourceTree = "<group>"; };
-		F7F54CCA1E5B14C700E19C62 /* UIBarButtonItemGrid.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = UIBarButtonItemGrid.png; sourceTree = "<group>"; };
-		F7F54CCB1E5B14C700E19C62 /* UIBarButtonItemGrid@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "UIBarButtonItemGrid@2x.png"; sourceTree = "<group>"; };
-		F7F54CCC1E5B14C700E19C62 /* UIBarButtonItemGrid@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "UIBarButtonItemGrid@3x.png"; sourceTree = "<group>"; };
-		F7F54CCD1E5B14C700E19C62 /* VideoOverlay.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = VideoOverlay.png; sourceTree = "<group>"; };
-		F7F54CCE1E5B14C700E19C62 /* VideoOverlay@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "VideoOverlay@2x.png"; sourceTree = "<group>"; };
-		F7F54CCF1E5B14C700E19C62 /* VideoOverlay@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "VideoOverlay@3x.png"; sourceTree = "<group>"; };
-		F7F54CD01E5B14C700E19C62 /* MWCaptionView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MWCaptionView.h; sourceTree = "<group>"; };
-		F7F54CD11E5B14C700E19C62 /* MWCaptionView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MWCaptionView.m; sourceTree = "<group>"; };
-		F7F54CD21E5B14C700E19C62 /* MWCommon.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MWCommon.h; sourceTree = "<group>"; };
-		F7F54CD71E5B14C700E19C62 /* MWPhoto.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MWPhoto.h; sourceTree = "<group>"; };
-		F7F54CD81E5B14C700E19C62 /* MWPhoto.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MWPhoto.m; sourceTree = "<group>"; };
-		F7F54CD91E5B14C700E19C62 /* MWPhotoBrowser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MWPhotoBrowser.h; sourceTree = "<group>"; };
-		F7F54CDA1E5B14C700E19C62 /* MWPhotoBrowser.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MWPhotoBrowser.m; sourceTree = "<group>"; };
-		F7F54CDB1E5B14C700E19C62 /* MWPhotoBrowserPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MWPhotoBrowserPrivate.h; sourceTree = "<group>"; };
-		F7F54CDC1E5B14C700E19C62 /* MWPhotoProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MWPhotoProtocol.h; sourceTree = "<group>"; };
-		F7F54CDD1E5B14C700E19C62 /* MWTapDetectingImageView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MWTapDetectingImageView.h; sourceTree = "<group>"; };
-		F7F54CDE1E5B14C700E19C62 /* MWTapDetectingImageView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MWTapDetectingImageView.m; sourceTree = "<group>"; };
-		F7F54CDF1E5B14C700E19C62 /* MWTapDetectingView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MWTapDetectingView.h; sourceTree = "<group>"; };
-		F7F54CE01E5B14C700E19C62 /* MWTapDetectingView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MWTapDetectingView.m; sourceTree = "<group>"; };
-		F7F54CE11E5B14C700E19C62 /* MWZoomingScrollView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MWZoomingScrollView.h; sourceTree = "<group>"; };
-		F7F54CE21E5B14C700E19C62 /* MWZoomingScrollView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MWZoomingScrollView.m; sourceTree = "<group>"; };
-		F7F54CE31E5B14C700E19C62 /* UIImage+MWPhotoBrowser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIImage+MWPhotoBrowser.h"; sourceTree = "<group>"; };
-		F7F54CE41E5B14C700E19C62 /* UIImage+MWPhotoBrowser.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIImage+MWPhotoBrowser.m"; sourceTree = "<group>"; };
 		F7F67BAD1A24D27800EE80DA /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
 		F7F67BB81A24D27800EE80DA /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = "<group>"; };
 		F7F878AD1FB9E3B900599E4F /* NCEndToEndMetadata.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCEndToEndMetadata.swift; sourceTree = "<group>"; };
@@ -2565,7 +2475,6 @@
 				F72AAEC11E5C60C700BB17E1 /* AHKActionSheet */,
 				F73CC0571E813DFF006E3047 /* BKPasscodeView */,
 				F754EEC321772B6100BB1CDF /* DropdownMenu */,
-				F7F54CAD1E5B14C700E19C62 /* MWPhotoBrowser */,
 				F7B4F1C51F44356F00B53B42 /* NCUchardet */,
 				F760F75621F21F61006B1A73 /* PhotoEditor */,
 				F762CA9F1EACB66200B38484 /* XLForm */,
@@ -2573,71 +2482,6 @@
 			path = Library;
 			sourceTree = "<group>";
 		};
-		F7F54CAD1E5B14C700E19C62 /* MWPhotoBrowser */ = {
-			isa = PBXGroup;
-			children = (
-				F7F54CAE1E5B14C700E19C62 /* Assets */,
-				F7F54CD01E5B14C700E19C62 /* MWCaptionView.h */,
-				F7F54CD11E5B14C700E19C62 /* MWCaptionView.m */,
-				F7F54CD21E5B14C700E19C62 /* MWCommon.h */,
-				F7F54CD71E5B14C700E19C62 /* MWPhoto.h */,
-				F7F54CD81E5B14C700E19C62 /* MWPhoto.m */,
-				F7F54CD91E5B14C700E19C62 /* MWPhotoBrowser.h */,
-				F7F54CDA1E5B14C700E19C62 /* MWPhotoBrowser.m */,
-				F7F54CDB1E5B14C700E19C62 /* MWPhotoBrowserPrivate.h */,
-				F7F54CDC1E5B14C700E19C62 /* MWPhotoProtocol.h */,
-				F7F54CDD1E5B14C700E19C62 /* MWTapDetectingImageView.h */,
-				F7F54CDE1E5B14C700E19C62 /* MWTapDetectingImageView.m */,
-				F7F54CDF1E5B14C700E19C62 /* MWTapDetectingView.h */,
-				F7F54CE01E5B14C700E19C62 /* MWTapDetectingView.m */,
-				F7F54CE11E5B14C700E19C62 /* MWZoomingScrollView.h */,
-				F7F54CE21E5B14C700E19C62 /* MWZoomingScrollView.m */,
-				F7F54CE31E5B14C700E19C62 /* UIImage+MWPhotoBrowser.h */,
-				F7F54CE41E5B14C700E19C62 /* UIImage+MWPhotoBrowser.m */,
-			);
-			path = MWPhotoBrowser;
-			sourceTree = "<group>";
-		};
-		F7F54CAE1E5B14C700E19C62 /* Assets */ = {
-			isa = PBXGroup;
-			children = (
-				F7F54CAF1E5B14C700E19C62 /* ImageError.png */,
-				F7F54CB01E5B14C700E19C62 /* ImageError@2x.png */,
-				F7F54CB11E5B14C700E19C62 /* ImageError@3x.png */,
-				F7F54CB21E5B14C700E19C62 /* ImageSelectedOff.png */,
-				F7F54CB31E5B14C700E19C62 /* ImageSelectedOff@2x.png */,
-				F7F54CB41E5B14C700E19C62 /* ImageSelectedOff@3x.png */,
-				F7F54CB51E5B14C700E19C62 /* ImageSelectedOn.png */,
-				F7F54CB61E5B14C700E19C62 /* ImageSelectedOn@2x.png */,
-				F7F54CB71E5B14C700E19C62 /* ImageSelectedOn@3x.png */,
-				F7F54CB81E5B14C700E19C62 /* ImageSelectedSmallOff.png */,
-				F7F54CB91E5B14C700E19C62 /* ImageSelectedSmallOff@2x.png */,
-				F7F54CBA1E5B14C700E19C62 /* ImageSelectedSmallOff@3x.png */,
-				F7F54CBB1E5B14C700E19C62 /* ImageSelectedSmallOn.png */,
-				F7F54CBC1E5B14C700E19C62 /* ImageSelectedSmallOn@2x.png */,
-				F7F54CBD1E5B14C700E19C62 /* ImageSelectedSmallOn@3x.png */,
-				F7F54CBE1E5B14C700E19C62 /* PlayButtonOverlayLarge.png */,
-				F7F54CBF1E5B14C700E19C62 /* PlayButtonOverlayLarge@2x.png */,
-				F7F54CC01E5B14C700E19C62 /* PlayButtonOverlayLarge@3x.png */,
-				F7F54CC11E5B14C700E19C62 /* PlayButtonOverlayLargeTap.png */,
-				F7F54CC21E5B14C700E19C62 /* PlayButtonOverlayLargeTap@2x.png */,
-				F7F54CC31E5B14C700E19C62 /* PlayButtonOverlayLargeTap@3x.png */,
-				F7F54CC41E5B14C700E19C62 /* UIBarButtonItemArrowLeft.png */,
-				F7F54CC51E5B14C700E19C62 /* UIBarButtonItemArrowLeft@2x.png */,
-				F7F54CC61E5B14C700E19C62 /* UIBarButtonItemArrowLeft@3x.png */,
-				F7F54CC71E5B14C700E19C62 /* UIBarButtonItemArrowRight.png */,
-				F7F54CC81E5B14C700E19C62 /* UIBarButtonItemArrowRight@2x.png */,
-				F7F54CC91E5B14C700E19C62 /* UIBarButtonItemArrowRight@3x.png */,
-				F7F54CCA1E5B14C700E19C62 /* UIBarButtonItemGrid.png */,
-				F7F54CCB1E5B14C700E19C62 /* UIBarButtonItemGrid@2x.png */,
-				F7F54CCC1E5B14C700E19C62 /* UIBarButtonItemGrid@3x.png */,
-				F7F54CCD1E5B14C700E19C62 /* VideoOverlay.png */,
-				F7F54CCE1E5B14C700E19C62 /* VideoOverlay@2x.png */,
-				F7F54CCF1E5B14C700E19C62 /* VideoOverlay@3x.png */,
-			);
-			path = Assets;
-			sourceTree = "<group>";
-		};
 		F7F67B9F1A24D27800EE80DA = {
 			isa = PBXGroup;
 			children = (
@@ -3029,52 +2873,35 @@
 				F760F78421F21F61006B1A73 /* ColorCollectionViewCell.xib in Resources */,
 				F7362A1F220C853A005101B5 /* LaunchScreen.storyboard in Resources */,
 				F75ADF451DC75FFE008A7347 /* CCLogin.storyboard in Resources */,
-				F7F54CED1E5B14C700E19C62 /* ImageSelectedOn@3x.png in Resources */,
-				F7F54CF41E5B14C700E19C62 /* PlayButtonOverlayLarge.png in Resources */,
-				F7F54D041E5B14C800E19C62 /* VideoOverlay@2x.png in Resources */,
-				F7F54CF51E5B14C700E19C62 /* PlayButtonOverlayLarge@2x.png in Resources */,
 				F77D49A91DC238E500CDC568 /* loading.gif in Resources */,
 				F77444F622281649000D5EB0 /* NCGridMediaCell.xib in Resources */,
 				F78ACD4421903CF20088454D /* NCListCell.xib in Resources */,
 				F78ACD4621903D010088454D /* NCGridCell.xib in Resources */,
-				F7F54CF91E5B14C700E19C62 /* PlayButtonOverlayLargeTap@3x.png in Resources */,
 				F73B4EF21F470D9100BBEE4B /* EUCTWFreq.tab in Resources */,
 				F769453C22E9CFFF000A798A /* NCShareUserCell.xib in Resources */,
 				F700222C1EC479840080073F /* Custom.xcassets in Resources */,
 				F710D20024057E5E00A6033D /* NCActionSheetHeaderView.xib in Resources */,
 				F758B45A212C564000515F55 /* Scan.storyboard in Resources */,
 				F77B0EFE1D118A16002130FE /* CCUploadFromOtherUpp.storyboard in Resources */,
-				F7F54CF81E5B14C700E19C62 /* PlayButtonOverlayLargeTap@2x.png in Resources */,
 				F73B4EEE1F470D9100BBEE4B /* Big5Freq.tab in Resources */,
 				F760F78821F21F61006B1A73 /* PhotoCropEditorBorder@2x.png in Resources */,
-				F7F54CF31E5B14C700E19C62 /* ImageSelectedSmallOn@3x.png in Resources */,
-				F7F54CFA1E5B14C700E19C62 /* UIBarButtonItemArrowLeft.png in Resources */,
 				F7FCFFD81D70798C000E6E29 /* CCPeekPop.storyboard in Resources */,
-				F7F54CF61E5B14C700E19C62 /* PlayButtonOverlayLarge@3x.png in Resources */,
 				F78F74342163757000C2ADAD /* NCTrash.storyboard in Resources */,
 				F760F78521F21F61006B1A73 /* EmojiCollectionViewCell.xib in Resources */,
 				F79A65C32191D90F00FF6DCC /* NCSelect.storyboard in Resources */,
-				F7F54D001E5B14C700E19C62 /* UIBarButtonItemGrid.png in Resources */,
-				F7F54CFE1E5B14C700E19C62 /* UIBarButtonItemArrowRight@2x.png in Resources */,
-				F7F54D031E5B14C800E19C62 /* VideoOverlay.png in Resources */,
-				F7F54CE81E5B14C700E19C62 /* ImageSelectedOff.png in Resources */,
 				F7169A1E1EE590930086BD69 /* NCSharesCell.xib in Resources */,
 				F73D71641F2674A400E233EB /* NCText.storyboard in Resources */,
 				F7226EDC1EE4089300EBECB1 /* Main.storyboard in Resources */,
 				F7632FBF21832F8700721B71 /* NCTrashSectionHeaderMenu.xib in Resources */,
 				F739513A221B127F00D986C8 /* NCSectionMediaHeader.xib in Resources */,
 				F77B0F481D118A16002130FE /* synchronized.gif in Resources */,
-				F7F54CF71E5B14C700E19C62 /* PlayButtonOverlayLargeTap.png in Resources */,
 				3704EB2A23D5A58400455C5B /* NCMenu.storyboard in Resources */,
 				F7E0E1DE22327DBA006B0911 /* NCAudioRecorderViewController.storyboard in Resources */,
 				F710E8111EF95C9C00DC2427 /* ImagesIntro.xcassets in Resources */,
-				F7F54D021E5B14C700E19C62 /* UIBarButtonItemGrid@3x.png in Resources */,
-				F7F54CEA1E5B14C700E19C62 /* ImageSelectedOff@3x.png in Resources */,
 				F760F78621F21F61006B1A73 /* LaunchScreen.storyboard in Resources */,
 				F7381EE5218218C9000B1560 /* NCOffline.storyboard in Resources */,
 				F769453E22E9E97E000A798A /* NCShareUserMenuView.xib in Resources */,
 				F749C10E23C4A5340027D966 /* NCIntroCollectionViewCell.xib in Resources */,
-				F7F54CF11E5B14C700E19C62 /* ImageSelectedSmallOn.png in Resources */,
 				F723B3DD22FC6D1D00301EFE /* NCShareCommentsCell.xib in Resources */,
 				F760F77C21F21F61006B1A73 /* StickersViewController.xib in Resources */,
 				F762CB1B1EACB66200B38484 /* XLForm.bundle in Resources */,
@@ -3082,7 +2909,6 @@
 				F700510122DF63AC003A3356 /* NCShare.storyboard in Resources */,
 				F77B0F571D118A16002130FE /* synchronizedcrypto.gif in Resources */,
 				F72382C22295856A005B8A07 /* GoogleMVTextDetectorResources.bundle in Resources */,
-				F7F54CEE1E5B14C700E19C62 /* ImageSelectedSmallOff.png in Resources */,
 				F787704F22E7019900F287A9 /* NCShareLinkCell.xib in Resources */,
 				F760F79721F21F61006B1A73 /* StickerCollectionViewCell.xib in Resources */,
 				F749C10D23C4A5340027D966 /* NCIntro.storyboard in Resources */,
@@ -3090,40 +2916,26 @@
 				F73B4EF31F470D9100BBEE4B /* GB2312Freq.tab in Resources */,
 				F7B2DEF11F976859007CF4D2 /* english.txt in Resources */,
 				F7651A8A23A2A3F2001403D2 /* NCCreateFormUploadDocuments.storyboard in Resources */,
-				F7F54D051E5B14C800E19C62 /* VideoOverlay@3x.png in Resources */,
-				F7F54D011E5B14C700E19C62 /* UIBarButtonItemGrid@2x.png in Resources */,
 				F79728D622F9A0B1003CACA7 /* NCShareUserFolderMenuView.xib in Resources */,
 				F7DFAA8A22E22EF100FC4527 /* NCShareLinkMenuView.xib in Resources */,
 				F7C9555321F0C4CA0024296E /* NCActivity.storyboard in Resources */,
-				F7F54CE71E5B14C700E19C62 /* ImageError@3x.png in Resources */,
 				F760F78F21F21F61006B1A73 /* PhotoCropEditorBorder@3x.png in Resources */,
-				F7F54CE61E5B14C700E19C62 /* ImageError@2x.png in Resources */,
-				F7F54CEF1E5B14C700E19C62 /* ImageSelectedSmallOff@2x.png in Resources */,
-				F7F54CFF1E5B14C700E19C62 /* UIBarButtonItemArrowRight@3x.png in Resources */,
 				F774DF0F1FCC26BE002AF9FC /* iTunesArtwork@1x.png in Resources */,
 				F78ACD54219047D40088454D /* NCSectionFooter.xib in Resources */,
 				F77B0F611D118A16002130FE /* Acknowledgements.rtf in Resources */,
 				F7D1612023CF19E30039EBBF /* NCViewerRichWorkspace.storyboard in Resources */,
 				F77B0F631D118A16002130FE /* Localizable.strings in Resources */,
 				F7632FC1218353AA00721B71 /* NCTrashSectionFooter.xib in Resources */,
-				F7F54CFB1E5B14C700E19C62 /* UIBarButtonItemArrowLeft@2x.png in Resources */,
 				F7C525A21E3B6DA800FFE02C /* CCNotification.storyboard in Resources */,
-				F7F54CEB1E5B14C700E19C62 /* ImageSelectedOn.png in Resources */,
-				F7F54CF01E5B14C700E19C62 /* ImageSelectedSmallOff@3x.png in Resources */,
 				F73B4EF01F470D9100BBEE4B /* CMakeLists.txt in Resources */,
-				F7F54CEC1E5B14C700E19C62 /* ImageSelectedOn@2x.png in Resources */,
 				F73B4F151F470D9100BBEE4B /* symbols.cmake in Resources */,
-				F7F54CF21E5B14C700E19C62 /* ImageSelectedSmallOn@2x.png in Resources */,
 				F774264A22EB4D0000B23912 /* NCShareUserDropDownCell.xib in Resources */,
 				F722814323C8C34500C41898 /* NCRichWorkspace.xib in Resources */,
-				F7F54CE51E5B14C700E19C62 /* ImageError.png in Resources */,
-				F7F54CFC1E5B14C700E19C62 /* UIBarButtonItemArrowLeft@3x.png in Resources */,
 				F77B0F7D1D118A16002130FE /* Images.xcassets in Resources */,
 				F760F79021F21F61006B1A73 /* PhotoCropEditorBorder.png in Resources */,
 				F78ACD56219047E90088454D /* NCSectionHeader.xib in Resources */,
 				F73CB3B222E072A000AD728E /* NCShareHeaderView.xib in Resources */,
 				F7AE00FA230E81EB007ACF8A /* NCBrowserWeb.storyboard in Resources */,
-				F7F54CE91E5B14C700E19C62 /* ImageSelectedOff@2x.png in Resources */,
 				F77B0F8A1D118A16002130FE /* CCCellMain.xib in Resources */,
 				F78ACD58219048040088454D /* NCSectionHeaderMenu.xib in Resources */,
 				F77B0F8C1D118A16002130FE /* CCCellMainTransfer.xib in Resources */,
@@ -3134,7 +2946,6 @@
 				F73B4EF11F470D9100BBEE4B /* EUCKRFreq.tab in Resources */,
 				F7501C322212E57500FB1415 /* NCMedia.storyboard in Resources */,
 				F774DF111FCC26BE002AF9FC /* iTunesArtwork@3x.png in Resources */,
-				F7F54CFD1E5B14C700E19C62 /* UIBarButtonItemArrowRight.png in Resources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
@@ -3385,8 +3196,6 @@
 				F77B0DF51D118A16002130FE /* CCUtility.m in Sources */,
 				F762CB071EACB66200B38484 /* XLFormOptionsObject.m in Sources */,
 				F7C525A01E3B48B700FFE02C /* CCNotification.swift in Sources */,
-				F7F54D0E1E5B14C800E19C62 /* UIImage+MWPhotoBrowser.m in Sources */,
-				F7F54D091E5B14C800E19C62 /* MWPhoto.m in Sources */,
 				F73B4F041F470D9100BBEE4B /* nsBig5Prober.cpp in Sources */,
 				F760F78321F21F61006B1A73 /* UIImageView+Alpha.swift in Sources */,
 				F73B4EEF1F470D9100BBEE4B /* CharDistribution.cpp in Sources */,
@@ -3408,7 +3217,6 @@
 				F769454022E9F077000A798A /* NCSharePaging.swift in Sources */,
 				F760F79921F21F61006B1A73 /* CropViewController.swift in Sources */,
 				F70022EC1EC4C9100080073F /* OCXMLSharedParser.m in Sources */,
-				F7F54D061E5B14C800E19C62 /* MWCaptionView.m in Sources */,
 				F762CB001EACB66200B38484 /* XLFormSegmentedCell.m in Sources */,
 				F732BA061D76CE1500E9878B /* CCNetworking.m in Sources */,
 				F762CB061EACB66200B38484 /* XLFormTextViewCell.m in Sources */,
@@ -3417,7 +3225,6 @@
 				F760F79C21F21F61006B1A73 /* GradientView.swift in Sources */,
 				F73F537F1E929C8500F8678D /* CCMore.swift in Sources */,
 				F73B4EF71F470D9100BBEE4B /* LangBulgarianModel.cpp in Sources */,
-				F7F54D0C1E5B14C800E19C62 /* MWTapDetectingView.m in Sources */,
 				F79018B7240962C7007C9B6D /* NCViewerImageContentView.swift in Sources */,
 				F7FB1D3E215E191D00D669EA /* NCViewerDocumentWeb.swift in Sources */,
 				F78E7065219F096B006F23E4 /* NCAvatar.swift in Sources */,
@@ -3455,7 +3262,6 @@
 				3757A35523D9D76300EC369E /* NCMenuPanelController.swift in Sources */,
 				F7CA1ED320E7E3FE002CC65E /* PKStopDownloadButton.m in Sources */,
 				F762CB111EACB66200B38484 /* NSString+XLFormAdditions.m in Sources */,
-				F7F54D0A1E5B14C800E19C62 /* MWPhotoBrowser.m in Sources */,
 				F762CB081EACB66200B38484 /* XLFormOptionsViewController.m in Sources */,
 				F72D404923D2082500A97FD0 /* NCViewerNextcloudText.swift in Sources */,
 				F73CC0721E813DFF006E3047 /* BKPasscodeLockScreenManager.m in Sources */,
@@ -3609,10 +3415,8 @@
 				F704FA5C232A343F00BBA952 /* IMImagemeterViewer.swift in Sources */,
 				F73B4F031F470D9100BBEE4B /* LangVietnameseModel.cpp in Sources */,
 				F73B4F021F470D9100BBEE4B /* LangTurkishModel.cpp in Sources */,
-				F7F54D0B1E5B14C800E19C62 /* MWTapDetectingImageView.m in Sources */,
 				F760F79A21F21F61006B1A73 /* PhotoEditor+Crop.swift in Sources */,
 				F7CA1ED220E7E3FE002CC65E /* PKCircleView.m in Sources */,
-				F7F54D0D1E5B14C800E19C62 /* MWZoomingScrollView.m in Sources */,
 				F760F78E21F21F61006B1A73 /* PhotoEditor+Drawing.swift in Sources */,
 				F762CB0B1EACB66200B38484 /* XLFormRowDescriptor.m in Sources */,
 				F760F78921F21F61006B1A73 /* UIView+Image.swift in Sources */,

+ 5 - 4
iOSClient/Favorites/CCFavorites.m

@@ -53,10 +53,6 @@
     if (self = [super initWithCoder:aDecoder])  {
         appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
         appDelegate.activeFavorites = self;
-        
-        [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(triggerProgressTask:) name:@"NotificationProgressTask" object:nil];
-        [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(changeTheming) name:k_notificationCenter_changeTheming object:nil];
-        [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(deleteFile:) name:k_notificationCenter_deleteFile object:nil];
     }
     return self;
 }
@@ -68,6 +64,11 @@
     [self.tableView registerNib:[UINib nibWithNibName:@"CCCellMain" bundle:nil] forCellReuseIdentifier:@"CellMain"];
     [self.tableView registerNib:[UINib nibWithNibName:@"CCCellMainTransfer" bundle:nil] forCellReuseIdentifier:@"CellMainTransfer"];
     
+    // Notification
+    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(triggerProgressTask:) name:@"NotificationProgressTask" object:nil];
+    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(changeTheming) name:k_notificationCenter_changeTheming object:nil];
+    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(deleteFile:) name:k_notificationCenter_deleteFile object:nil];
+    
     // Metadata
     self.metadata = [tableMetadata new];
     

+ 1 - 0
iOSClient/Library/AHKActionSheet/AHKActionSheetViewController.m

@@ -25,6 +25,7 @@
     [super viewDidLoad];
 
     [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(didRotateDeviceChangeNotification:) name:UIApplicationDidChangeStatusBarOrientationNotification object:nil];
+    
     _storeOrientation = [[UIApplication sharedApplication] statusBarOrientation];
 
     [self.view addSubview:self.actionSheet];

BIN
iOSClient/Library/MWPhotoBrowser/Assets/ImageError.png


BIN
iOSClient/Library/MWPhotoBrowser/Assets/ImageError@2x.png


BIN
iOSClient/Library/MWPhotoBrowser/Assets/ImageError@3x.png


BIN
iOSClient/Library/MWPhotoBrowser/Assets/ImageSelectedOff.png


BIN
iOSClient/Library/MWPhotoBrowser/Assets/ImageSelectedOff@2x.png


BIN
iOSClient/Library/MWPhotoBrowser/Assets/ImageSelectedOff@3x.png


BIN
iOSClient/Library/MWPhotoBrowser/Assets/ImageSelectedOn.png


BIN
iOSClient/Library/MWPhotoBrowser/Assets/ImageSelectedOn@2x.png


BIN
iOSClient/Library/MWPhotoBrowser/Assets/ImageSelectedOn@3x.png


BIN
iOSClient/Library/MWPhotoBrowser/Assets/ImageSelectedSmallOff.png


BIN
iOSClient/Library/MWPhotoBrowser/Assets/ImageSelectedSmallOff@2x.png


BIN
iOSClient/Library/MWPhotoBrowser/Assets/ImageSelectedSmallOff@3x.png


BIN
iOSClient/Library/MWPhotoBrowser/Assets/ImageSelectedSmallOn.png


BIN
iOSClient/Library/MWPhotoBrowser/Assets/ImageSelectedSmallOn@2x.png


BIN
iOSClient/Library/MWPhotoBrowser/Assets/ImageSelectedSmallOn@3x.png


BIN
iOSClient/Library/MWPhotoBrowser/Assets/PlayButtonOverlayLarge.png


BIN
iOSClient/Library/MWPhotoBrowser/Assets/PlayButtonOverlayLarge@2x.png


BIN
iOSClient/Library/MWPhotoBrowser/Assets/PlayButtonOverlayLarge@3x.png


BIN
iOSClient/Library/MWPhotoBrowser/Assets/PlayButtonOverlayLargeTap.png


BIN
iOSClient/Library/MWPhotoBrowser/Assets/PlayButtonOverlayLargeTap@2x.png


BIN
iOSClient/Library/MWPhotoBrowser/Assets/PlayButtonOverlayLargeTap@3x.png


BIN
iOSClient/Library/MWPhotoBrowser/Assets/UIBarButtonItemArrowLeft.png


BIN
iOSClient/Library/MWPhotoBrowser/Assets/UIBarButtonItemArrowLeft@2x.png


BIN
iOSClient/Library/MWPhotoBrowser/Assets/UIBarButtonItemArrowLeft@3x.png


BIN
iOSClient/Library/MWPhotoBrowser/Assets/UIBarButtonItemArrowRight.png


BIN
iOSClient/Library/MWPhotoBrowser/Assets/UIBarButtonItemArrowRight@2x.png


BIN
iOSClient/Library/MWPhotoBrowser/Assets/UIBarButtonItemArrowRight@3x.png


BIN
iOSClient/Library/MWPhotoBrowser/Assets/UIBarButtonItemGrid.png


BIN
iOSClient/Library/MWPhotoBrowser/Assets/UIBarButtonItemGrid@2x.png


BIN
iOSClient/Library/MWPhotoBrowser/Assets/UIBarButtonItemGrid@3x.png


BIN
iOSClient/Library/MWPhotoBrowser/Assets/VideoOverlay.png


BIN
iOSClient/Library/MWPhotoBrowser/Assets/VideoOverlay@2x.png


BIN
iOSClient/Library/MWPhotoBrowser/Assets/VideoOverlay@3x.png


+ 0 - 37
iOSClient/Library/MWPhotoBrowser/MWCaptionView.h

@@ -1,37 +0,0 @@
-//
-//  MWCaptionView.h
-//  MWPhotoBrowser
-//
-//  Created by Michael Waterfall on 30/12/2011.
-//  Copyright (c) 2011 __MyCompanyName__. All rights reserved.
-//
-
-#import <UIKit/UIKit.h>
-#import "MWPhotoProtocol.h"
-
-@interface MWCaptionView : UIToolbar
-
-//TWS
-@property (nonatomic, strong) id <MWPhoto> photo;
-@property (nonatomic, strong) UILabel *label;
-
-// Init
-- (id)initWithPhoto:(id<MWPhoto>)photo;
-
-// To create your own custom caption view, subclass this view
-// and override the following two methods (as well as any other
-// UIView methods that you see fit):
-
-// Override -setupCaption so setup your subviews and customise the appearance
-// of your custom caption
-// You can access the photo's data by accessing the _photo ivar
-// If you need more data per photo then simply subclass MWPhoto and return your
-// subclass to the photo browsers -photoBrowser:photoAtIndex: delegate method
-- (void)setupCaption;
-
-// Override -sizeThatFits: and return a CGSize specifying the height of your
-// custom caption view. With width property is ignored and the caption is displayed
-// the full width of the screen
-- (CGSize)sizeThatFits:(CGSize)size;
-
-@end

+ 0 - 77
iOSClient/Library/MWPhotoBrowser/MWCaptionView.m

@@ -1,77 +0,0 @@
-//
-//  MWCaptionView.m
-//  MWPhotoBrowser
-//
-//  Created by Michael Waterfall on 30/12/2011.
-//  Copyright (c) 2011 __MyCompanyName__. All rights reserved.
-//
-
-#import "MWCommon.h"
-#import "MWCaptionView.h"
-#import "MWPhoto.h"
-
-static const CGFloat labelPadding = 10;
-
-//TWS Private
-/*
-@interface MWCaptionView () {
-    id <MWPhoto> _photo;
-    UILabel *_label;    
-}
-@end
-*/
-
-@implementation MWCaptionView
-
-- (id)initWithPhoto:(id<MWPhoto>)photo {
-    self = [super initWithFrame:CGRectMake(0, 0, 320, 44)]; // Random initial frame
-    if (self) {
-        self.userInteractionEnabled = NO;
-        _photo = photo;
-        self.barStyle = UIBarStyleDefault; //TWS
-        self.tintColor = nil;
-        self.barTintColor = nil;
-        self.barStyle = UIBarStyleDefault; //TWS
-        [self setBackgroundImage:nil forToolbarPosition:UIBarPositionAny barMetrics:UIBarMetricsDefault];
-        self.autoresizingMask = UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleTopMargin|UIViewAutoresizingFlexibleLeftMargin|UIViewAutoresizingFlexibleRightMargin;
-        [self setupCaption];
-    }
-    return self;
-}
-
-- (CGSize)sizeThatFits:(CGSize)size {
-    CGFloat maxHeight = 9999;
-    if (_label.numberOfLines > 0) maxHeight = _label.font.leading*_label.numberOfLines;
-    
-    //CGSize textSize = [_label.text boundingRectWithSize:CGSizeMake(size.width - labelPadding*2, maxHeight) options:NSStringDrawingUsesLineFragmentOrigin attributes:@{NSFontAttributeName:_label.font} context:nil].size;
-    
-    //return CGSizeMake(size.width, textSize.height + labelPadding * 2);
-    
-    //TWS
-    
-    if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) return CGSizeMake(size.width, 50);
-    else return CGSizeMake(size.width, 49);
-
-}
-
-- (void)setupCaption {
-    _label = [[UILabel alloc] initWithFrame:CGRectIntegral(CGRectMake(labelPadding, 0,
-                                                       self.bounds.size.width-labelPadding*2,
-                                                       self.bounds.size.height))];
-    _label.autoresizingMask = UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleHeight;
-    _label.opaque = NO;
-    _label.backgroundColor = [UIColor clearColor];
-    _label.textAlignment = NSTextAlignmentLeft;
-    _label.lineBreakMode = NSLineBreakByWordWrapping;
-
-    _label.numberOfLines = 0;
-    _label.textColor = [UIColor blackColor];
-    _label.font = [UIFont systemFontOfSize:12];
-    if ([_photo respondsToSelector:@selector(caption)]) {
-        _label.text = [_photo caption] ? [_photo caption] : @" ";
-    }
-    [self addSubview:_label];
-}
-
-
-@end

+ 0 - 12
iOSClient/Library/MWPhotoBrowser/MWCommon.h

@@ -1,12 +0,0 @@
-//
-//  MWPreprocessor.h
-//  MWPhotoBrowser
-//
-//  Created by Michael Waterfall on 01/10/2013.
-//
-
-#define SYSTEM_VERSION_EQUAL_TO(v)                  ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedSame)
-#define SYSTEM_VERSION_GREATER_THAN(v)              ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedDescending)
-#define SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(v)  ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedAscending)
-#define SYSTEM_VERSION_LESS_THAN(v)                 ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedAscending)
-//#define SYSTEM_VERSION_LESS_THAN_OR_EQUAL_TO(v)     ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedDescending)

+ 0 - 36
iOSClient/Library/MWPhotoBrowser/MWPhoto.h

@@ -1,36 +0,0 @@
-//
-//  MWPhoto.h
-//  MWPhotoBrowser
-//
-//  Created by Michael Waterfall on 17/10/2010.
-//  Copyright 2010 d3i. All rights reserved.
-//
-
-#import <Foundation/Foundation.h>
-#import <Photos/Photos.h>
-#import "MWPhotoProtocol.h"
-
-// This class models a photo/image and it's caption
-// If you want to handle photos, caching, decompression
-// yourself then you can simply ensure your custom data model
-// conforms to MWPhotoProtocol
-@interface MWPhoto : NSObject <MWPhoto>
-
-@property (nonatomic, strong) NSString *caption;
-@property (nonatomic, strong) NSURL *videoURL;
-@property (nonatomic) BOOL emptyImage;
-@property (nonatomic) BOOL isVideo;
-
-+ (MWPhoto *)photoWithImage:(UIImage *)image;
-+ (MWPhoto *)photoWithURL:(NSURL *)url;
-+ (MWPhoto *)photoWithAsset:(PHAsset *)asset targetSize:(CGSize)targetSize;
-+ (MWPhoto *)videoWithURL:(NSURL *)url; // Initialise video with no poster image
-
-- (id)init;
-- (id)initWithImage:(UIImage *)image;
-- (id)initWithURL:(NSURL *)url;
-- (id)initWithAsset:(PHAsset *)asset targetSize:(CGSize)targetSize;
-- (id)initWithVideoURL:(NSURL *)url;
-
-@end
-

+ 0 - 322
iOSClient/Library/MWPhotoBrowser/MWPhoto.m

@@ -1,322 +0,0 @@
-//
-//  MWPhoto.m
-//  MWPhotoBrowser
-//
-//  Created by Michael Waterfall on 17/10/2010.
-//  Copyright 2010 d3i. All rights reserved.
-//
-
-#import <AssetsLibrary/AssetsLibrary.h>
-#import "MWPhoto.h"
-#import "MWPhotoBrowser.h"
-
-@interface MWPhoto () {
-
-    BOOL _loadingInProgress;
-    PHImageRequestID _assetRequestID;
-    PHImageRequestID _assetVideoRequestID;
-        
-}
-
-@property (nonatomic, strong) UIImage *image;
-@property (nonatomic, strong) NSURL *photoURL;
-@property (nonatomic, strong) PHAsset *asset;
-@property (nonatomic) CGSize assetTargetSize;
-
-- (void)imageLoadingComplete;
-
-@end
-
-@implementation MWPhoto
-
-@synthesize underlyingImage = _underlyingImage; // synth property from protocol
-
-#pragma mark - Class Methods
-
-+ (MWPhoto *)photoWithImage:(UIImage *)image {
-	return [[MWPhoto alloc] initWithImage:image];
-}
-
-+ (MWPhoto *)photoWithURL:(NSURL *)url {
-    return [[MWPhoto alloc] initWithURL:url];
-}
-
-+ (MWPhoto *)photoWithAsset:(PHAsset *)asset targetSize:(CGSize)targetSize {
-    return [[MWPhoto alloc] initWithAsset:asset targetSize:targetSize];
-}
-
-+ (MWPhoto *)videoWithURL:(NSURL *)url {
-    return [[MWPhoto alloc] initWithVideoURL:url];
-}
-
-#pragma mark - Init
-
-- (id)init {
-    if ((self = [super init])) {
-        self.emptyImage = YES;
-        [self setup];
-    }
-    return self;
-}
-
-- (id)initWithImage:(UIImage *)image {
-    if ((self = [super init])) {
-        self.image = image;
-        [self setup];
-    }
-    return self;
-}
-
-- (id)initWithURL:(NSURL *)url {
-    if ((self = [super init])) {
-        self.photoURL = url;
-        [self setup];
-    }
-    return self;
-}
-
-- (id)initWithAsset:(PHAsset *)asset targetSize:(CGSize)targetSize {
-    if ((self = [super init])) {
-        self.asset = asset;
-        self.assetTargetSize = targetSize;
-        self.isVideo = asset.mediaType == PHAssetMediaTypeVideo;
-        [self setup];
-    }
-    return self;
-}
-
-- (id)initWithVideoURL:(NSURL *)url {
-    if ((self = [super init])) {
-        self.videoURL = url;
-        self.isVideo = YES;
-        self.emptyImage = YES;
-        [self setup];
-    }
-    return self;
-}
-
-- (void)setup {
-    _assetRequestID = PHInvalidImageRequestID;
-    _assetVideoRequestID = PHInvalidImageRequestID;
-}
-
-- (void)dealloc {
-    [self cancelAnyLoading];
-}
-
-#pragma mark - Video
-
-- (void)setVideoURL:(NSURL *)videoURL {
-    _videoURL = videoURL;
-    self.isVideo = YES;
-}
-
-- (void)getVideoURL:(void (^)(NSURL *url))completion {
-    if (_videoURL) {
-        completion(_videoURL);
-    } else if (_asset && _asset.mediaType == PHAssetMediaTypeVideo) {
-        [self cancelVideoRequest]; // Cancel any existing
-        PHVideoRequestOptions *options = [PHVideoRequestOptions new];
-        options.networkAccessAllowed = YES;
-        __weak __typeof(self) weakSelf = self;
-        _assetVideoRequestID = [[PHImageManager defaultManager] requestAVAssetForVideo:_asset options:options resultHandler:^(AVAsset *asset, AVAudioMix *audioMix, NSDictionary *info) {
-            
-            // dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 3 * NSEC_PER_SEC), dispatch_get_main_queue(), ^{ // Testing
-            __typeof(self) strongSelf = weakSelf;
-            if (!strongSelf) return;
-            strongSelf->_assetVideoRequestID = PHInvalidImageRequestID;
-            if ([asset isKindOfClass:[AVURLAsset class]]) {
-                completion(((AVURLAsset *)asset).URL);
-            } else {
-                completion(nil);
-            }
-            
-        }];
-    }
-}
-
-#pragma mark - MWPhoto Protocol Methods
-
-- (UIImage *)underlyingImage {
-    return _underlyingImage;
-}
-
-- (void)loadUnderlyingImageAndNotify {
-    NSAssert([[NSThread currentThread] isMainThread], @"This method must be called on the main thread.");
-    if (_loadingInProgress) return;
-    _loadingInProgress = YES;
-    @try {
-        if (self.underlyingImage) {
-            [self imageLoadingComplete];
-        } else {
-            [self performLoadUnderlyingImageAndNotify];
-        }
-    }
-    @catch (NSException *exception) {
-        self.underlyingImage = nil;
-        _loadingInProgress = NO;
-        [self imageLoadingComplete];
-    }
-    @finally {
-    }
-}
-
-// Set the underlyingImage
-- (void)performLoadUnderlyingImageAndNotify {
-    
-    // Get underlying image
-    if (_image) {
-        
-        // We have UIImage!
-        self.underlyingImage = _image;
-        [self imageLoadingComplete];
-        
-    } else if (_photoURL) {
-        
-        // Check what type of url it is
-        if ([[[_photoURL scheme] lowercaseString] isEqualToString:@"assets-library"]) {
-            
-            // Load from assets library
-            [self _performLoadUnderlyingImageAndNotifyWithAssetsLibraryURL: _photoURL];
-            
-        } else if ([_photoURL isFileReferenceURL]) {
-            
-            // Load from local file async
-            [self _performLoadUnderlyingImageAndNotifyWithLocalFileURL: _photoURL];
-            
-        }
-        
-    } else if (_asset) {
-        
-        // Load from photos asset
-        [self _performLoadUnderlyingImageAndNotifyWithAsset: _asset targetSize:_assetTargetSize];
-        
-    } else {
-        
-        // Image is empty
-        [self imageLoadingComplete];
-        
-    }
-}
-
-
-// Load from local file
-- (void)_performLoadUnderlyingImageAndNotifyWithLocalFileURL:(NSURL *)url {
-    dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
-        @autoreleasepool {
-            @try {
-                self.underlyingImage = [UIImage imageWithContentsOfFile:url.path];
-                if (!_underlyingImage) {
-                    MWLog(@"Error loading photo from path: %@", url.path);
-                }
-            } @finally {
-                [self performSelectorOnMainThread:@selector(imageLoadingComplete) withObject:nil waitUntilDone:NO];
-            }
-        }
-    });
-}
-
-// Load from asset library async
-- (void)_performLoadUnderlyingImageAndNotifyWithAssetsLibraryURL:(NSURL *)url {
-
-    dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
-        @autoreleasepool {
-            @try {
-                PHAsset * asset = [[PHAsset fetchAssetsWithALAssetURLs:@[url] options:nil] firstObject];
-                if (! asset) {
-                    MWLog(@"Photo from asset library error");
-                    [self performSelectorOnMainThread:@selector(imageLoadingComplete) withObject:nil waitUntilDone:NO];
-                }
-                PHImageRequestOptions *options = [[PHImageRequestOptions alloc] init];
-                options.synchronous = NO;
-                options.networkAccessAllowed = NO;
-                options.deliveryMode = PHImageRequestOptionsDeliveryModeHighQualityFormat;
-                [[PHImageManager defaultManager] requestImageDataForAsset:asset
-                                                                  options:options
-                                                            resultHandler:^(NSData * imageData,
-                                                                            NSString * dataUTI,
-                                                                            UIImageOrientation orientation,
-                                                                            NSDictionary * info)
-                 {
-                     if (imageData) {
-                         self.underlyingImage = [UIImage imageWithData:imageData];
-                         [self performSelectorOnMainThread:@selector(imageLoadingComplete) withObject:nil waitUntilDone:NO];
-                     } else {
-                         MWLog(@"Photo from asset library error");
-                         [self performSelectorOnMainThread:@selector(imageLoadingComplete) withObject:nil waitUntilDone:NO];
-                     }
-                 }];
-            } @catch (NSException *e) {
-                MWLog(@"Photo from asset library error: %@", e);
-                [self performSelectorOnMainThread:@selector(imageLoadingComplete) withObject:nil waitUntilDone:NO];
-            }
-        }
-    });
-
-}
-
-// Load from photos library
-- (void)_performLoadUnderlyingImageAndNotifyWithAsset:(PHAsset *)asset targetSize:(CGSize)targetSize {
-    
-    PHImageManager *imageManager = [PHImageManager defaultManager];
-    
-    PHImageRequestOptions *options = [PHImageRequestOptions new];
-    options.networkAccessAllowed = YES;
-    options.resizeMode = PHImageRequestOptionsResizeModeFast;
-    options.deliveryMode = PHImageRequestOptionsDeliveryModeHighQualityFormat;
-    options.synchronous = false;
-    options.progressHandler = ^(double progress, NSError *error, BOOL *stop, NSDictionary *info) {
-        NSDictionary* dict = [NSDictionary dictionaryWithObjectsAndKeys:
-                              [NSNumber numberWithDouble: progress], @"progress",
-                              self, @"photo", nil];
-        [[NSNotificationCenter defaultCenter] postNotificationName:MWPHOTO_PROGRESS_NOTIFICATION object:dict];
-    };
-    
-    _assetRequestID = [imageManager requestImageForAsset:asset targetSize:targetSize contentMode:PHImageContentModeAspectFit options:options resultHandler:^(UIImage *result, NSDictionary *info) {
-        dispatch_async(dispatch_get_main_queue(), ^{
-            self.underlyingImage = result;
-            [self imageLoadingComplete];
-        });
-    }];
-
-}
-
-// Release if we can get it again from path or url
-- (void)unloadUnderlyingImage {
-    _loadingInProgress = NO;
-	self.underlyingImage = nil;
-}
-
-- (void)imageLoadingComplete {
-    NSAssert([[NSThread currentThread] isMainThread], @"This method must be called on the main thread.");
-    // Complete so notify
-    _loadingInProgress = NO;
-    // Notify on next run loop
-    [self performSelector:@selector(postCompleteNotification) withObject:nil afterDelay:0];
-}
-
-- (void)postCompleteNotification {
-    [[NSNotificationCenter defaultCenter] postNotificationName:MWPHOTO_LOADING_DID_END_NOTIFICATION
-                                                        object:self];
-}
-
-- (void)cancelAnyLoading {
-    [self cancelImageRequest];
-    [self cancelVideoRequest];
-}
-
-- (void)cancelImageRequest {
-    if (_assetRequestID != PHInvalidImageRequestID) {
-        [[PHImageManager defaultManager] cancelImageRequest:_assetRequestID];
-        _assetRequestID = PHInvalidImageRequestID;
-    }
-}
-
-- (void)cancelVideoRequest {
-    if (_assetVideoRequestID != PHInvalidImageRequestID) {
-        [[PHImageManager defaultManager] cancelImageRequest:_assetVideoRequestID];
-        _assetVideoRequestID = PHInvalidImageRequestID;
-    }
-}
-
-@end

+ 0 - 92
iOSClient/Library/MWPhotoBrowser/MWPhotoBrowser.h

@@ -1,92 +0,0 @@
-//
-//  MWPhotoBrowser.h
-//  MWPhotoBrowser
-//
-//  Created by Michael Waterfall on 14/10/2010.
-//  Copyright 2010 d3i. All rights reserved.
-//
-
-#import <UIKit/UIKit.h>
-#import <MediaPlayer/MediaPlayer.h>
-#import <AVKit/AVKit.h>
-#import "MWPhoto.h"
-#import "MWPhotoProtocol.h"
-#import "MWCaptionView.h"
-
-// Debug Logging
-#if 0 // Set to 1 to enable debug logging
-#define MWLog(x, ...) NSLog(x, ## __VA_ARGS__);
-#else
-#define MWLog(x, ...)
-#endif
-
-@class MWPhotoBrowser;
-
-@protocol MWPhotoBrowserDelegate <NSObject>
-
-- (NSUInteger)numberOfPhotosInPhotoBrowser:(MWPhotoBrowser *)photoBrowser;
-- (id <MWPhoto>)photoBrowser:(MWPhotoBrowser *)photoBrowser photoAtIndex:(NSUInteger)index;
-
-@optional
-
-- (MWCaptionView *)photoBrowser:(MWPhotoBrowser *)photoBrowser captionViewForPhotoAtIndex:(NSUInteger)index;
-- (NSString *)photoBrowser:(MWPhotoBrowser *)photoBrowser titleForPhotoAtIndex:(NSUInteger)index;
-- (void)photoBrowser:(MWPhotoBrowser *)photoBrowser didDisplayPhotoAtIndex:(NSUInteger)index;
-- (void)photoBrowser:(MWPhotoBrowser *)photoBrowser actionButtonPressedForPhotoAtIndex:(NSUInteger)index;
-- (void)photoBrowser:(MWPhotoBrowser *)photoBrowser shareButtonPressedForPhotoAtIndex:(NSUInteger)index;
-- (void)photoBrowser:(MWPhotoBrowser *)photoBrowser deleteButtonPressedForPhotoAtIndex:(NSUInteger)index deleteButton:(UIBarButtonItem *)deleteButton;
-- (BOOL)photoBrowser:(MWPhotoBrowser *)photoBrowser isPhotoSelectedAtIndex:(NSUInteger)index;
-- (void)photoBrowser:(MWPhotoBrowser *)photoBrowser photoAtIndex:(NSUInteger)index selectedChanged:(BOOL)selected;
-- (void)photoBrowserDidFinishPresentation:(MWPhotoBrowser *)photoBrowser;
-
-- (void)setControlsHidden:(BOOL)hidden animated:(BOOL)animated permanent:(BOOL)permanent;
-
-@end
-
-@interface MWPhotoBrowser : UIViewController <UIScrollViewDelegate, UIActionSheetDelegate>
-
-@property (nonatomic, weak) IBOutlet id<MWPhotoBrowserDelegate> delegate;
-@property (nonatomic) BOOL zoomPhotosToFill;
-@property (nonatomic) BOOL displayNavArrows;
-@property (nonatomic) BOOL displayActionButton;
-@property (nonatomic) BOOL displayShareButton;      //TWS
-@property (nonatomic) BOOL displayDeleteButton;     //TWS
-@property (nonatomic) BOOL displaySelectionButtons;
-@property (nonatomic) BOOL displayPopoverButton;    //TWS
-@property (nonatomic) BOOL alwaysShowControls;
-@property (nonatomic) BOOL enableSwipeToDismiss;
-@property (nonatomic) BOOL autoPlayOnAppear;
-@property (nonatomic) NSUInteger delayToHideElements;
-@property (nonatomic, readonly) NSUInteger currentIndex;
-
-// Customise image selection icons as they are the only icons with a colour tint
-// Icon should be located in the app's main bundle
-@property (nonatomic, strong) NSString *customImageSelectedIconName;
-@property (nonatomic, strong) NSString *customImageSelectedSmallIconName;
-
-@property (nonatomic, strong) UIBarButtonItem *previousButton, *nextButton, *actionButton, *doneButton, *popoverButton, *deleteButton, *shareButton; //TWS
-
-//TWS Navigation & controls
-@property (nonatomic, strong) UIToolbar *toolbar;
-
-// Video
-@property (nonatomic, strong) AVPlayer *currentVideoPlayer;
-
-// Init
-- (id)initWithPhotos:(NSArray *)photosArray;
-- (id)initWithDelegate:(id <MWPhotoBrowserDelegate>)delegate;
-
-// Reloads the photo browser and refetches data
-- (void)reloadData;
-
-// Set page that photo browser starts on
-- (void)setCurrentPhotoIndex:(NSUInteger)index;
-
-// Navigation
-- (void)showNextPhotoAnimated:(BOOL)animated;
-- (void)showPreviousPhotoAnimated:(BOOL)animated;
-
-- (void)hideControls;
-- (void)showControls;
-
-@end

+ 0 - 1433
iOSClient/Library/MWPhotoBrowser/MWPhotoBrowser.m

@@ -1,1433 +0,0 @@
-//
-//  MWPhotoBrowser.m
-//  MWPhotoBrowser
-//
-//  Created by Michael Waterfall on 14/10/2010.
-//  Copyright 2010 d3i. All rights reserved.
-//
-
-#import <QuartzCore/QuartzCore.h>
-#import "MWCommon.h"
-#import "MWPhotoBrowser.h"
-#import "MWPhotoBrowserPrivate.h"
-#import "UIImage+MWPhotoBrowser.h"
-#import "NCBridgeSwift.h"
-
-#define PADDING                  10
-
-static void * MWVideoPlayerObservation = &MWVideoPlayerObservation;
-
-@implementation MWPhotoBrowser
-
-#pragma mark - Init
-
-- (id)init {
-    if ((self = [super init])) {
-        [self _initialisation];
-    }
-    return self;
-}
-
-- (id)initWithDelegate:(id <MWPhotoBrowserDelegate>)delegate {
-    if ((self = [self init])) {
-        _delegate = delegate;
-	}
-	return self;
-}
-
-- (id)initWithPhotos:(NSArray *)photosArray {
-	if ((self = [self init])) {
-		_fixedPhotosArray = photosArray;
-	}
-	return self;
-}
-
-- (id)initWithCoder:(NSCoder *)decoder {
-	if ((self = [super initWithCoder:decoder])) {
-        [self _initialisation];
-	}
-	return self;
-}
-
-- (void)_initialisation {
-    
-    // Defaults
-    NSNumber *isVCBasedStatusBarAppearanceNum = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"UIViewControllerBasedStatusBarAppearance"];
-    if (isVCBasedStatusBarAppearanceNum) {
-        _isVCBasedStatusBarAppearance = isVCBasedStatusBarAppearanceNum.boolValue;
-    } else {
-        _isVCBasedStatusBarAppearance = YES; // default
-    }
-    self.hidesBottomBarWhenPushed = YES;
-    _hasBelongedToViewController = NO;
-    _photoCount = NSNotFound;
-    _previousLayoutBounds = CGRectZero;
-    _currentPageIndex = 0;
-    _previousPageIndex = NSUIntegerMax;
-    _displayActionButton = YES;
-    _displayShareButton = YES;
-    _displayDeleteButton = YES;
-    _displayNavArrows = NO;
-    _zoomPhotosToFill = YES;
-    _performingLayout = NO; // Reset on view did appear
-    _rotating = NO;
-    _viewIsActive = NO;
-    _enableSwipeToDismiss = YES;
-    _delayToHideElements = 5;
-    _visiblePages = [[NSMutableSet alloc] init];
-    _recycledPages = [[NSMutableSet alloc] init];
-    _photos = [[NSMutableArray alloc] init];
-    _thumbPhotos = [[NSMutableArray alloc] init];
-    _didSavePreviousStateOfNavBar = NO;
-    self.automaticallyAdjustsScrollViewInsets = NO;
-    
-    // Listen for MWPhoto notifications
-    [[NSNotificationCenter defaultCenter] addObserver:self
-                                             selector:@selector(handleMWPhotoLoadingDidEndNotification:)
-                                                 name:MWPHOTO_LOADING_DID_END_NOTIFICATION
-                                               object:nil];
-    
-}
-
-- (void)dealloc {
-    [self clearCurrentVideo];
-    _pagingScrollView.delegate = nil;
-    [[NSNotificationCenter defaultCenter] removeObserver:self];
-    [self releaseAllUnderlyingPhotos:NO];
-}
-
-- (void)releaseAllUnderlyingPhotos:(BOOL)preserveCurrent {
-    // Create a copy in case this array is modified while we are looping through
-    // Release photos
-    NSArray *copy = [_photos copy];
-    for (id p in copy) {
-        if (p != [NSNull null]) {
-            if (preserveCurrent && p == [self photoAtIndex:self.currentIndex]) {
-                continue; // skip current
-            }
-            [p unloadUnderlyingImage];
-        }
-    }
-    // Release thumbs
-    copy = [_thumbPhotos copy];
-    for (id p in copy) {
-        if (p != [NSNull null]) {
-            [p unloadUnderlyingImage];
-        }
-    }
-}
-
-- (void)didReceiveMemoryWarning {
-
-	// Release any cached data, images, etc that aren't in use.
-    [self releaseAllUnderlyingPhotos:YES];
-	[_recycledPages removeAllObjects];
-	
-	// Releases the view if it doesn't have a superview.
-    [super didReceiveMemoryWarning];
-	
-}
-
-#pragma mark - View Loading
-
-// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
-- (void)viewDidLoad {
-    
-	// View
-    self.view.backgroundColor = NCBrandColor.sharedInstance.backgroundView;
-    self.view.clipsToBounds = YES;
-
-	// Setup paging scrolling view
-	CGRect pagingScrollViewFrame = [self frameForPagingScrollView];
-	_pagingScrollView = [[UIScrollView alloc] initWithFrame:pagingScrollViewFrame];
-	_pagingScrollView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
-	_pagingScrollView.pagingEnabled = YES;
-	_pagingScrollView.delegate = self;
-	_pagingScrollView.showsHorizontalScrollIndicator = NO;
-	_pagingScrollView.showsVerticalScrollIndicator = NO;
-    _pagingScrollView.backgroundColor = NCBrandColor.sharedInstance.backgroundView;
-    _pagingScrollView.contentSize = [self contentSizeForPagingScrollView];
-	[self.view addSubview:_pagingScrollView];
-	
-    // Toolbar
-    _toolbar = [[UIToolbar alloc] initWithFrame:[self frameForToolbarAtOrientation:[[UIApplication sharedApplication] statusBarOrientation]]];
-    _toolbar.tintColor = NCBrandColor.sharedInstance.brandElement;
-    _toolbar.barTintColor = NCBrandColor.sharedInstance.tabBar;
-    [_toolbar setBackgroundImage:nil forToolbarPosition:UIToolbarPositionAny barMetrics:UIBarMetricsDefault];
-    [_toolbar setBackgroundImage:nil forToolbarPosition:UIToolbarPositionAny barMetrics:UIBarMetricsCompact];
-    _toolbar.barStyle = UIBarStyleDefault; //TWS
-    _toolbar.autoresizingMask = UIViewAutoresizingFlexibleTopMargin | UIViewAutoresizingFlexibleWidth;
-    [_toolbar setTranslucent:NO];
-    
-    // Toolbar Items
-    if (self.displayNavArrows) {
-        NSString *arrowPathFormat = @"UIBarButtonItemArrow%@";
-        UIImage *previousButtonImage = [UIImage imageForResourcePath:[NSString stringWithFormat:arrowPathFormat, @"Left"] ofType:@"png" inBundle:[NSBundle bundleForClass:[self class]]];
-        UIImage *nextButtonImage = [UIImage imageForResourcePath:[NSString stringWithFormat:arrowPathFormat, @"Right"] ofType:@"png" inBundle:[NSBundle bundleForClass:[self class]]];
-        _previousButton = [[UIBarButtonItem alloc] initWithImage:previousButtonImage style:UIBarButtonItemStylePlain target:self action:@selector(gotoPreviousPage)];
-        _nextButton = [[UIBarButtonItem alloc] initWithImage:nextButtonImage style:UIBarButtonItemStylePlain target:self action:@selector(gotoNextPage)];
-    }
-    
-    //TWS
-    if (self.displayDeleteButton) {
-        _deleteButton = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"deletePhotoBrowser"] style:UIBarButtonItemStylePlain target:self action:@selector(deleteButtonPressed:)];
-    }
-    
-    if (self.displayActionButton) {
-        _actionButton = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"openFile"] style:UIBarButtonItemStylePlain target:self action:@selector(actionButtonPressed:)];
-    }
-    
-    if (self.displayShareButton) {
-        _shareButton = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"sharePhotoBrowser"] style:UIBarButtonItemStylePlain target:self action:@selector(shareButtonPressed:)];
-    }
-    
-    // Update
-    [self reloadData];
-    
-    // Swipe to dismiss
-    if (_enableSwipeToDismiss) {
-        UISwipeGestureRecognizer *swipeGesture = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(doneButtonPressed:)];
-        swipeGesture.direction = UISwipeGestureRecognizerDirectionDown | UISwipeGestureRecognizerDirectionUp;
-        [self.view addGestureRecognizer:swipeGesture];
-    }
-    
-	// Super
-    [super viewDidLoad];
-}
-
-- (void)performLayout {
-    
-    // Setup
-    _performingLayout = YES;
-    NSUInteger numberOfPhotos = [self numberOfPhotos];
-    
-	// Setup pages
-    [_visiblePages removeAllObjects];
-    [_recycledPages removeAllObjects];
-    
-    // Navigation buttons
-    if ([self.navigationController.viewControllers objectAtIndex:0] == self) {
-        // We're first on stack so show done button
-        _doneButton = [[UIBarButtonItem alloc] initWithTitle:NSLocalizedString(@"Done", nil) style:UIBarButtonItemStylePlain target:self action:@selector(doneButtonPressed:)];
-        // Set appearance
-        [_doneButton setBackgroundImage:nil forState:UIControlStateNormal barMetrics:UIBarMetricsDefault];
-        [_doneButton setBackgroundImage:nil forState:UIControlStateNormal barMetrics:UIBarMetricsCompact];
-        [_doneButton setBackgroundImage:nil forState:UIControlStateHighlighted barMetrics:UIBarMetricsDefault];
-        [_doneButton setBackgroundImage:nil forState:UIControlStateHighlighted barMetrics:UIBarMetricsCompact];
-        [_doneButton setTitleTextAttributes:[NSDictionary dictionary] forState:UIControlStateNormal];
-        [_doneButton setTitleTextAttributes:[NSDictionary dictionary] forState:UIControlStateHighlighted];
-        self.navigationItem.rightBarButtonItem = _doneButton;
-    }
-    
-    // color
-    self.navigationController.navigationBar.barTintColor = NCBrandColor.sharedInstance.brand;
-    self.navigationController.navigationBar.tintColor = NCBrandColor.sharedInstance.brandText;
-    [self.navigationController.navigationBar setTitleTextAttributes:@{NSForegroundColorAttributeName : NCBrandColor.sharedInstance.brandText}];
-    self.navigationController.navigationBar.translucent = false;
-    [self setExtendedLayoutIncludesOpaqueBars:YES];
-    
-    // Toolbar items
-    BOOL hasItems = NO;
-    UIBarButtonItem *fixedSpace = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFixedSpace target:self action:nil];
-    fixedSpace.width = 32; // To balance action button
-    UIBarButtonItem *fixedSpaceMini = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFixedSpace target:self action:nil];
-    fixedSpaceMini.width = 25; // To balance action button
-    UIBarButtonItem *flexSpace = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:self action:nil];
-    NSMutableArray *items = [[NSMutableArray alloc] init];
-
-    
-    // Middle - Nav
-    if (_previousButton && _nextButton && numberOfPhotos > 1) {
-        hasItems = YES;
-        [items addObject:_previousButton];
-        [items addObject:fixedSpace];
-        [items addObject:fixedSpace];
-        [items addObject:_nextButton];
-        [items addObject:flexSpace];
-    } else {
-        [items addObject:flexSpace];
-    }
-
-    if (_deleteButton) {
-        [items addObject:_deleteButton];
-        [items addObject:fixedSpaceMini];
-    }
-    if (_shareButton) {
-        [items addObject:_shareButton];
-        [items addObject:fixedSpaceMini];
-    }
-    if (_actionButton) {
-        [items addObject:_actionButton];
-    }
-    
-    // Toolbar visibility
-    [_toolbar setItems:items];
-    BOOL hideToolbar = YES;
-    for (UIBarButtonItem* item in _toolbar.items) {
-        if (item != fixedSpace && item != flexSpace) {
-            hideToolbar = NO;
-            break;
-        }
-    }
-    if (hideToolbar) {
-        [_toolbar removeFromSuperview];
-    } else {
-        [self.view addSubview:_toolbar];
-    }
-    
-    // Update nav
-	[self updateNavigation];
-    
-    // Content offset
-	_pagingScrollView.contentOffset = [self contentOffsetForPageAtIndex:_currentPageIndex];
-    [self tilePages];
-    _performingLayout = NO;
-    
-}
-
-// Release any retained subviews of the main view.
-- (void)viewDidUnload {
-	_currentPageIndex = 0;
-    _pagingScrollView = nil;
-    _visiblePages = nil;
-    _recycledPages = nil;
-    _toolbar = nil;
-    _previousButton = nil;
-    _nextButton = nil;
-    _progressHUD = nil;
-    [super viewDidUnload];
-}
-
-- (BOOL)presentingViewControllerPrefersStatusBarHidden {
-    UIViewController *presenting = self.presentingViewController;
-    if (presenting) {
-        if ([presenting isKindOfClass:[UINavigationController class]]) {
-            presenting = [(UINavigationController *)presenting topViewController];
-        }
-    } else {
-        // We're in a navigation controller so get previous one!
-        if (self.navigationController && self.navigationController.viewControllers.count > 1) {
-            presenting = [self.navigationController.viewControllers objectAtIndex:self.navigationController.viewControllers.count-2];
-        }
-    }
-    if (presenting) {
-        return [presenting prefersStatusBarHidden];
-    } else {
-        return NO;
-    }
-}
-
-#pragma mark - Appearance
-
-- (void)viewWillAppear:(BOOL)animated {
-    
-	// Super
-	[super viewWillAppear:animated];
-    
-    // Nav Bar Appearance iPAD
-    if (self.traitCollection.horizontalSizeClass != UIUserInterfaceSizeClassCompact) {
-        
-        // ----- TWS ----- //
-        self.navigationItem.hidesBackButton = YES;
-        self.navigationController.topViewController.navigationItem.leftBarButtonItem = self.splitViewController.displayModeButtonItem;
-    }
-
-    // Update UI
-	[self hideControlsAfterDelay];
-    
-    // If rotation occured while we're presenting a modal
-    // and the index changed, make sure we show the right one now
-    if (_currentPageIndex != _pageIndexBeforeRotation) {
-        [self jumpToPageAtIndex:_pageIndexBeforeRotation animated:NO];
-    }
-
-    // Layaout
-    [self.view setNeedsLayout];
-}
-
-- (void)viewDidAppear:(BOOL)animated {
-    [super viewDidAppear:animated];
-    _viewIsActive = YES;
-    
-    // Autoplay if first is video
-    if (!_viewHasAppearedInitially) {
-        if (_autoPlayOnAppear) {
-            MWPhoto *photo = [self photoAtIndex:_currentPageIndex];
-            if ([photo respondsToSelector:@selector(isVideo)] && photo.isVideo) {
-                [self playVideoAtIndex:_currentPageIndex];
-            }
-        }
-    }
-    
-    _viewHasAppearedInitially = YES;
-        
-}
-
-- (void)viewWillDisappear:(BOOL)animated {
-    
-    // Detect if rotation occurs while we're presenting a modal
-    _pageIndexBeforeRotation = _currentPageIndex;
-    
-    // Check that we're being popped for good
-    if ([self.navigationController.viewControllers objectAtIndex:0] != self &&
-        ![self.navigationController.viewControllers containsObject:self]) {
-        
-        // State
-        _viewIsActive = NO;
-        [self clearCurrentVideo]; // Clear current playing video
-    }
-    
-    // Controls
-    [self.navigationController.navigationBar.layer removeAllAnimations]; // Stop all animations on nav bar
-    [NSObject cancelPreviousPerformRequestsWithTarget:self]; // Cancel any pending toggles from taps
-    [self setControlsHidden:NO animated:NO permanent:YES];
-    
-   	// Super
-	[super viewWillDisappear:animated];
-}
-
-- (void)willMoveToParentViewController:(UIViewController *)parent {
-    if (parent && _hasBelongedToViewController) {
-        [NSException raise:@"MWPhotoBrowser Instance Reuse" format:@"MWPhotoBrowser instances cannot be reused."];
-    }
-}
-
-- (void)didMoveToParentViewController:(UIViewController *)parent {
-    if (!parent) _hasBelongedToViewController = YES;
-}
-
-
-#pragma mark - Layout
-
-- (void)viewWillLayoutSubviews {
-    [super viewWillLayoutSubviews];
-    [self layoutVisiblePages];
-}
-
-- (void)layoutVisiblePages {
-    
-	// Flag
-	_performingLayout = YES;
-	
-	// Toolbar
-	_toolbar.frame = [self frameForToolbarAtOrientation:[[UIApplication sharedApplication] statusBarOrientation]];
-    
-	// Remember index
-	NSUInteger indexPriorToLayout = _currentPageIndex;
-	
-	// Get paging scroll view frame to determine if anything needs changing
-	CGRect pagingScrollViewFrame = [self frameForPagingScrollView];
-    
-	// Frame needs changing
-    if (!_skipNextPagingScrollViewPositioning) {
-        _pagingScrollView.frame = pagingScrollViewFrame;
-    }
-    _skipNextPagingScrollViewPositioning = NO;
-	
-	// Recalculate contentSize based on current orientation
-	_pagingScrollView.contentSize = [self contentSizeForPagingScrollView];
-	
-	// Adjust frames and configuration of each visible page
-	for (MWZoomingScrollView *page in _visiblePages) {
-        NSUInteger index = page.index;
-		page.frame = [self frameForPageAtIndex:index];
-        if (page.captionView) {
-            page.captionView.frame = [self frameForCaptionView:page.captionView atIndex:index];
-        }
-        if (page.selectedButton) {
-            page.selectedButton.frame = [self frameForSelectedButton:page.selectedButton atIndex:index];
-        }
-        if (page.playButton) {
-            page.playButton.frame = [self frameForPlayButton:page.playButton atIndex:index];
-        }
-        
-        // Adjust scales if bounds has changed since last time
-        if (!CGRectEqualToRect(_previousLayoutBounds, self.view.bounds)) {
-            // Update zooms for new bounds
-            [page setMaxMinZoomScalesForCurrentBounds];
-            _previousLayoutBounds = self.view.bounds;
-        }
-
-	}
-    
-    // Adjust video loading indicator if it's visible
-    [self positionVideoLoadingIndicator];
-	
-	// Adjust contentOffset to preserve page location based on values collected prior to location
-	_pagingScrollView.contentOffset = [self contentOffsetForPageAtIndex:indexPriorToLayout];
-	[self didStartViewingPageAtIndex:_currentPageIndex]; // initial
-    
-	// Reset
-	_currentPageIndex = indexPriorToLayout;
-	_performingLayout = NO;
-    
-}
-
-#pragma mark - Rotation
-
-- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation {
-    return YES;
-}
-
-#if __IPHONE_OS_VERSION_MAX_ALLOWED < 90000
-- (NSUInteger)supportedInterfaceOrientations
-#else
-- (UIInterfaceOrientationMask)supportedInterfaceOrientations
-#endif
-{
-    return UIInterfaceOrientationMaskPortrait;
-}
-
-- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration {
-    
-	// Remember page index before rotation
-	_pageIndexBeforeRotation = _currentPageIndex;
-	_rotating = YES;
-    
-    // In iOS 7 the nav bar gets shown after rotation, but might as well do this for everything!
-    if ([self areControlsHidden]) {
-        // Force hidden
-        self.navigationController.navigationBarHidden = YES;
-    }
-}
-
-- (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration {
-	
-	// Perform layout
-	_currentPageIndex = _pageIndexBeforeRotation;
-	
-	// Delay control holding
-	[self hideControlsAfterDelay];
-    
-    // Layout
-    [self layoutVisiblePages];
-	
-}
-
-- (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation {
-	_rotating = NO;
-    // Ensure nav bar isn't re-displayed
-    if ([self areControlsHidden]) {
-        self.navigationController.navigationBarHidden = NO;
-        self.navigationController.navigationBar.alpha = 0;
-    }
-}
-
-#pragma mark - Data
-
-- (NSUInteger)currentIndex {
-    return _currentPageIndex;
-}
-
-- (void)reloadData {
-    
-    // Reset
-    _photoCount = NSNotFound;
-    
-    // Get data
-    NSUInteger numberOfPhotos = [self numberOfPhotos];
-    [self releaseAllUnderlyingPhotos:YES];
-    [_photos removeAllObjects];
-    [_thumbPhotos removeAllObjects];
-    for (int i = 0; i < numberOfPhotos; i++) {
-        [_photos addObject:[NSNull null]];
-        [_thumbPhotos addObject:[NSNull null]];
-    }
-
-    // Update current page index
-    if (numberOfPhotos > 0) {
-        _currentPageIndex = MAX(0, MIN(_currentPageIndex, numberOfPhotos - 1));
-    } else {
-        _currentPageIndex = 0;
-    }
-    
-    // Update layout
-    if ([self isViewLoaded]) {
-        while (_pagingScrollView.subviews.count) {
-            [[_pagingScrollView.subviews lastObject] removeFromSuperview];
-        }
-        [self performLayout];
-        [self.view setNeedsLayout];
-    }
-}
-
-- (NSUInteger)numberOfPhotos {
-    if (_photoCount == NSNotFound) {
-        if ([_delegate respondsToSelector:@selector(numberOfPhotosInPhotoBrowser:)]) {
-            _photoCount = [_delegate numberOfPhotosInPhotoBrowser:self];
-        } else if (_fixedPhotosArray) {
-            _photoCount = _fixedPhotosArray.count;
-        }
-    }
-    if (_photoCount == NSNotFound) _photoCount = 0;
-    return _photoCount;
-}
-
-- (id<MWPhoto>)photoAtIndex:(NSUInteger)index {
-    id <MWPhoto> photo = nil;
-    if (index < _photos.count) {
-        if ([_photos objectAtIndex:index] == [NSNull null]) {
-            if ([_delegate respondsToSelector:@selector(photoBrowser:photoAtIndex:)]) {
-                photo = [_delegate photoBrowser:self photoAtIndex:index];
-            } else if (_fixedPhotosArray && index < _fixedPhotosArray.count) {
-                photo = [_fixedPhotosArray objectAtIndex:index];
-            }
-            if (photo) [_photos replaceObjectAtIndex:index withObject:photo];
-        } else {
-            photo = [_photos objectAtIndex:index];
-        }
-    }
-    return photo;
-}
-
-- (MWCaptionView *)captionViewForPhotoAtIndex:(NSUInteger)index {
-    MWCaptionView *captionView = nil;
-    if ([_delegate respondsToSelector:@selector(photoBrowser:captionViewForPhotoAtIndex:)]) {
-        captionView = [_delegate photoBrowser:self captionViewForPhotoAtIndex:index];
-    } else {
-        id <MWPhoto> photo = [self photoAtIndex:index];
-        if ([photo respondsToSelector:@selector(caption)]) {
-            if ([photo caption]) captionView = [[MWCaptionView alloc] initWithPhoto:photo];
-        }
-    }
-    captionView.alpha = [self areControlsHidden] ? 0 : 1; // Initial alpha
-    return captionView;
-}
-
-- (BOOL)photoIsSelectedAtIndex:(NSUInteger)index {
-    BOOL value = NO;
-    if (_displaySelectionButtons) {
-        if ([self.delegate respondsToSelector:@selector(photoBrowser:isPhotoSelectedAtIndex:)]) {
-            value = [self.delegate photoBrowser:self isPhotoSelectedAtIndex:index];
-        }
-    }
-    return value;
-}
-
-- (void)setPhotoSelected:(BOOL)selected atIndex:(NSUInteger)index {
-    if (_displaySelectionButtons) {
-        if ([self.delegate respondsToSelector:@selector(photoBrowser:photoAtIndex:selectedChanged:)]) {
-            [self.delegate photoBrowser:self photoAtIndex:index selectedChanged:selected];
-        }
-    }
-}
-
-- (UIImage *)imageForPhoto:(id<MWPhoto>)photo {
-	if (photo) {
-		// Get image or obtain in background
-		if ([photo underlyingImage]) {
-			return [photo underlyingImage];
-		} else {
-            [photo loadUnderlyingImageAndNotify];
-		}
-	}
-	return nil;
-}
-
-- (void)loadAdjacentPhotosIfNecessary:(id<MWPhoto>)photo
-{
-    MWZoomingScrollView *page = [self pageDisplayingPhoto:photo];
-    
-    if (page) {
-        // If page is current page then initiate loading of previous and next pages
-        NSUInteger pageIndex = page.index;
-        if (_currentPageIndex == pageIndex) {
-            
-            if (pageIndex > 0) {
-                
-                // Preload index - 1
-                id <MWPhoto> photo = [self photoAtIndex:pageIndex-1];
-                
-                if (![photo underlyingImage]) {
-                    [photo loadUnderlyingImageAndNotify];
-                    MWLog(@"Pre-loading image at index %lu", (unsigned long)pageIndex-1);
-                }
-            }
-            
-            if (pageIndex < [self numberOfPhotos] - 1) {
-                
-                // Preload index + 1
-                id <MWPhoto> photo = [self photoAtIndex:pageIndex+1];
-                
-                if (![photo underlyingImage]) {
-                    [photo loadUnderlyingImageAndNotify];
-                    MWLog(@"Pre-loading image at index %lu", (unsigned long)pageIndex+1);
-                }
-            }
-        }
-    }
-
-    
-}
-
-#pragma mark - MWPhoto Loading Notification
-
-- (void)handleMWPhotoLoadingDidEndNotification:(NSNotification *)notification {
-    id <MWPhoto> photo = [notification object];
-    MWZoomingScrollView *page = [self pageDisplayingPhoto:photo];
-    if (page) {
-        if ([photo underlyingImage]) {
-            // Successful load
-            [page displayImage];
-            [self loadAdjacentPhotosIfNecessary:photo];
-        } else {
-            
-            // Failed to load
-            [page displayImageFailure];
-        }
-        // Update nav
-        [self updateNavigation];
-    }
-}
-
-#pragma mark - Paging
-
-- (void)tilePages {
-	
-	// Calculate which pages should be visible
-	// Ignore padding as paging bounces encroach on that
-	// and lead to false page loads
-	CGRect visibleBounds = _pagingScrollView.bounds;
-	NSInteger iFirstIndex = (NSInteger)floorf((CGRectGetMinX(visibleBounds)+PADDING*2) / CGRectGetWidth(visibleBounds));
-	NSInteger iLastIndex  = (NSInteger)floorf((CGRectGetMaxX(visibleBounds)-PADDING*2-1) / CGRectGetWidth(visibleBounds));
-    if (iFirstIndex < 0) iFirstIndex = 0;
-    if (iFirstIndex > [self numberOfPhotos] - 1) iFirstIndex = [self numberOfPhotos] - 1;
-    if (iLastIndex < 0) iLastIndex = 0;
-    if (iLastIndex > [self numberOfPhotos] - 1) iLastIndex = [self numberOfPhotos] - 1;
-	
-	// Recycle no longer needed pages
-    NSInteger pageIndex;
-	for (MWZoomingScrollView *page in _visiblePages) {
-        pageIndex = page.index;
-		if (pageIndex < (NSUInteger)iFirstIndex || pageIndex > (NSUInteger)iLastIndex) {
-			[_recycledPages addObject:page];
-            [page.captionView removeFromSuperview];
-            [page.selectedButton removeFromSuperview];
-            [page.playButton removeFromSuperview];
-            [page prepareForReuse];
-			[page removeFromSuperview];
-			MWLog(@"Removed page at index %lu", (unsigned long)pageIndex);
-		}
-	}
-	[_visiblePages minusSet:_recycledPages];
-    while (_recycledPages.count > 2) // Only keep 2 recycled pages
-        [_recycledPages removeObject:[_recycledPages anyObject]];
-	
-	// Add missing pages
-	for (NSUInteger index = (NSUInteger)iFirstIndex; index <= (NSUInteger)iLastIndex; index++) {
-		if (![self isDisplayingPageForIndex:index]) {
-            
-            // Add new page
-			MWZoomingScrollView *page = [self dequeueRecycledPage];
-			if (!page) {
-				page = [[MWZoomingScrollView alloc] initWithPhotoBrowser:self];
-			}
-			[_visiblePages addObject:page];
-			[self configurePage:page forIndex:index];
-
-			[_pagingScrollView addSubview:page];
-			MWLog(@"Added page at index %lu", (unsigned long)index);
-            
-            // Add caption
-            MWCaptionView *captionView = [self captionViewForPhotoAtIndex:index];
-            if (captionView) {
-                captionView.frame = [self frameForCaptionView:captionView atIndex:index];
-                [_pagingScrollView addSubview:captionView];
-                page.captionView = captionView;
-            }
-            
-            // Add play button if needed
-            if (page.displayingVideo) {
-                UIButton *playButton = [UIButton buttonWithType:UIButtonTypeCustom];
-                [playButton setImage:[UIImage imageForResourcePath:@"PlayButtonOverlayLarge" ofType:@"png" inBundle:[NSBundle bundleForClass:[self class]]] forState:UIControlStateNormal];
-                [playButton setImage:[UIImage imageForResourcePath:@"PlayButtonOverlayLargeTap" ofType:@"png" inBundle:[NSBundle bundleForClass:[self class]]] forState:UIControlStateHighlighted];
-                [playButton addTarget:self action:@selector(playButtonTapped:) forControlEvents:UIControlEventTouchUpInside];
-                [playButton sizeToFit];
-                playButton.frame = [self frameForPlayButton:playButton atIndex:index];
-                [_pagingScrollView addSubview:playButton];
-                page.playButton = playButton;
-            }
-            
-            // Add selected button
-            if (self.displaySelectionButtons) {
-                UIButton *selectedButton = [UIButton buttonWithType:UIButtonTypeCustom];
-                [selectedButton setImage:[UIImage imageForResourcePath:@"ImageSelectedOff" ofType:@"png" inBundle:[NSBundle bundleForClass:[self class]]] forState:UIControlStateNormal];
-                UIImage *selectedOnImage;
-                if (self.customImageSelectedIconName) {
-                    selectedOnImage = [UIImage imageNamed:self.customImageSelectedIconName];
-                } else {
-                    selectedOnImage = [UIImage imageForResourcePath:@"ImageSelectedOn" ofType:@"png" inBundle:[NSBundle bundleForClass:[self class]]];
-                }
-                [selectedButton setImage:selectedOnImage forState:UIControlStateSelected];
-                [selectedButton sizeToFit];
-                selectedButton.adjustsImageWhenHighlighted = NO;
-                [selectedButton addTarget:self action:@selector(selectedButtonTapped:) forControlEvents:UIControlEventTouchUpInside];
-                selectedButton.frame = [self frameForSelectedButton:selectedButton atIndex:index];
-                [_pagingScrollView addSubview:selectedButton];
-                page.selectedButton = selectedButton;
-                selectedButton.selected = [self photoIsSelectedAtIndex:index];
-            }
-            
-		}
-	}
-	
-}
-
-- (void)updateVisiblePageStates {
-    NSSet *copy = [_visiblePages copy];
-    for (MWZoomingScrollView *page in copy) {
-        
-        // Update selection
-        page.selectedButton.selected = [self photoIsSelectedAtIndex:page.index];
-        
-    }
-}
-
-- (BOOL)isDisplayingPageForIndex:(NSUInteger)index {
-	for (MWZoomingScrollView *page in _visiblePages)
-		if (page.index == index) return YES;
-	return NO;
-}
-
-- (MWZoomingScrollView *)pageDisplayedAtIndex:(NSUInteger)index {
-	MWZoomingScrollView *thePage = nil;
-	for (MWZoomingScrollView *page in _visiblePages) {
-		if (page.index == index) {
-			thePage = page; break;
-		}
-	}
-	return thePage;
-}
-
-- (MWZoomingScrollView *)pageDisplayingPhoto:(id<MWPhoto>)photo {
-	MWZoomingScrollView *thePage = nil;
-	for (MWZoomingScrollView *page in _visiblePages) {
-		if (page.photo == photo) {
-			thePage = page; break;
-		}
-	}
-	return thePage;
-}
-
-- (void)configurePage:(MWZoomingScrollView *)page forIndex:(NSUInteger)index {
-	page.frame = [self frameForPageAtIndex:index];
-    page.index = index;
-    page.photo = [self photoAtIndex:index];
-}
-
-- (MWZoomingScrollView *)dequeueRecycledPage {
-	MWZoomingScrollView *page = [_recycledPages anyObject];
-	if (page) {
-		[_recycledPages removeObject:page];
-	}
-	return page;
-}
-
-// Handle page changes
-- (void)didStartViewingPageAtIndex:(NSUInteger)index {
-    
-    // Handle 0 photos
-    if (![self numberOfPhotos]) {
-        // Show controls
-        [self setControlsHidden:NO animated:YES permanent:YES];
-        return;
-    }
-    
-    // Handle video on page change
-    if (!_rotating || index != _currentVideoIndex) {
-        [self clearCurrentVideo];
-    }
-    
-    // Release images further away than +/-1
-    NSUInteger i;
-    if (index > 0) {
-        // Release anything < index - 1
-        for (i = 0; i < index-1; i++) { 
-            id photo = [_photos objectAtIndex:i];
-            if (photo != [NSNull null]) {
-                [photo unloadUnderlyingImage];
-                [_photos replaceObjectAtIndex:i withObject:[NSNull null]];
-                MWLog(@"Released underlying image at index %lu", (unsigned long)i);
-            }
-        }
-    }
-    if (index < [self numberOfPhotos] - 1) {
-        // Release anything > index + 1
-        for (i = index + 2; i < _photos.count; i++) {
-            id photo = [_photos objectAtIndex:i];
-            if (photo != [NSNull null]) {
-                [photo unloadUnderlyingImage];
-                [_photos replaceObjectAtIndex:i withObject:[NSNull null]];
-                MWLog(@"Released underlying image at index %lu", (unsigned long)i);
-            }
-        }
-    }
-    
-    // Load adjacent images if needed and the photo is already
-    // loaded. Also called after photo has been loaded in background
-    id <MWPhoto> currentPhoto = [self photoAtIndex:index];
-    if ([currentPhoto underlyingImage]) {
-        // photo loaded so load ajacent now
-        [self loadAdjacentPhotosIfNecessary:currentPhoto];
-    }
-    
-    // Notify delegate
-    if (index != _previousPageIndex) {
-        if ([_delegate respondsToSelector:@selector(photoBrowser:didDisplayPhotoAtIndex:)])
-            [_delegate photoBrowser:self didDisplayPhotoAtIndex:index];
-        _previousPageIndex = index;
-    } else {
-        if ([_delegate respondsToSelector:@selector(photoBrowser:didDisplayPhotoAtIndex:)])
-            [_delegate photoBrowser:self didDisplayPhotoAtIndex:index];
-    }
-    
-    // Update nav
-    [self updateNavigation];
-}
-
-#pragma mark - Frame Calculations
-
-- (CGRect)frameForPagingScrollView {
-    CGRect frame = self.view.bounds;// [[UIScreen mainScreen] bounds];
-    frame.origin.x -= PADDING;
-    frame.size.width += (2 * PADDING);
-    return CGRectIntegral(frame);
-}
-
-- (CGRect)frameForPageAtIndex:(NSUInteger)index {
-    // We have to use our paging scroll view's bounds, not frame, to calculate the page placement. When the device is in
-    // landscape orientation, the frame will still be in portrait because the pagingScrollView is the root view controller's
-    // view, so its frame is in window coordinate space, which is never rotated. Its bounds, however, will be in landscape
-    // because it has a rotation transform applied.
-    CGRect bounds = _pagingScrollView.bounds;
-    CGRect pageFrame = bounds;
-    pageFrame.size.width -= (2 * PADDING);
-    pageFrame.origin.x = (bounds.size.width * index) + PADDING;
-    return CGRectIntegral(pageFrame);
-}
-
-- (CGSize)contentSizeForPagingScrollView {
-    // We have to use the paging scroll view's bounds to calculate the contentSize, for the same reason outlined above.
-    CGRect bounds = _pagingScrollView.bounds;
-    return CGSizeMake(bounds.size.width * [self numberOfPhotos], bounds.size.height);
-}
-
-- (CGPoint)contentOffsetForPageAtIndex:(NSUInteger)index {
-	CGFloat pageWidth = _pagingScrollView.bounds.size.width;
-	CGFloat newOffset = index * pageWidth;
-	return CGPointMake(newOffset, 0);
-}
-
-- (CGRect)frameForToolbarAtOrientation:(UIInterfaceOrientation)orientation {
-    
-    CGFloat safeAreaBottom = 0;
-    CGFloat height = 49;
-    
-    // iOS 11 safeArea
-    if (@available(iOS 11, *)) {
-        safeAreaBottom = [UIApplication sharedApplication].delegate.window.safeAreaInsets.bottom;
-    } 
-
-    if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone && UIInterfaceOrientationIsLandscape(orientation))
-        height = 39;
-    
-    return CGRectIntegral(CGRectMake(0, self.view.bounds.size.height - height - safeAreaBottom, self.view.bounds.size.width, height ));
-}
-
-- (CGRect)frameForCaptionView:(MWCaptionView *)captionView atIndex:(NSUInteger)index {
-    
-    // iOS 11 safeArea
-    CGFloat safeAreaBottom = 0;
-    if (@available(iOS 11, *)) {
-        safeAreaBottom = [UIApplication sharedApplication].delegate.window.safeAreaInsets.bottom;
-    }
-
-    CGRect pageFrame = [self frameForPageAtIndex:index];
-    CGSize captionSize = [captionView sizeThatFits:CGSizeMake(pageFrame.size.width, 0)];
-    CGRect captionFrame = CGRectMake(pageFrame.origin.x,
-                                     pageFrame.size.height - captionSize.height - (_toolbar.superview?_toolbar.frame.size.height:0) - safeAreaBottom,
-                                     pageFrame.size.width,
-                                     captionSize.height);
-    return CGRectIntegral(captionFrame);
-}
-
-- (CGRect)frameForSelectedButton:(UIButton *)selectedButton atIndex:(NSUInteger)index {
-    CGRect pageFrame = [self frameForPageAtIndex:index];
-    CGFloat padding = 20;
-    CGFloat yOffset = 0;
-    if (![self areControlsHidden]) {
-        UINavigationBar *navBar = self.navigationController.navigationBar;
-        yOffset = navBar.frame.origin.y + navBar.frame.size.height;
-    }
-    CGRect selectedButtonFrame = CGRectMake(pageFrame.origin.x + pageFrame.size.width - selectedButton.frame.size.width - padding,
-                                            padding + yOffset,
-                                            selectedButton.frame.size.width,
-                                            selectedButton.frame.size.height);
-    return CGRectIntegral(selectedButtonFrame);
-}
-
-- (CGRect)frameForPlayButton:(UIButton *)playButton atIndex:(NSUInteger)index {
-    CGRect pageFrame = [self frameForPageAtIndex:index];
-    return CGRectMake(floorf(CGRectGetMidX(pageFrame) - playButton.frame.size.width / 2),
-                      floorf(CGRectGetMidY(pageFrame) - playButton.frame.size.height / 2),
-                      playButton.frame.size.width,
-                      playButton.frame.size.height);
-}
-
-#pragma mark - UIScrollView Delegate
-
-- (void)scrollViewDidScroll:(UIScrollView *)scrollView {
-	
-    // Checks
-	if (!_viewIsActive || _performingLayout || _rotating) return;
-	
-	// Tile pages
-	[self tilePages];
-	
-	// Calculate current page
-	CGRect visibleBounds = _pagingScrollView.bounds;
-	NSInteger index = (NSInteger)(floorf(CGRectGetMidX(visibleBounds) / CGRectGetWidth(visibleBounds)));
-    if (index < 0) index = 0;
-	if (index > [self numberOfPhotos] - 1) index = [self numberOfPhotos] - 1;
-	NSUInteger previousCurrentPage = _currentPageIndex;
-	_currentPageIndex = index;
-	if (_currentPageIndex != previousCurrentPage) {
-        [self didStartViewingPageAtIndex:index];
-    }
-	
-}
-
-- (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView {
-	// Hide controls when dragging begins
-	[self setControlsHidden:YES animated:YES permanent:NO];
-}
-
-- (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView {
-	// Update nav when page changes
-	[self updateNavigation];
-}
-
-#pragma mark - Navigation
-
-- (void)updateNavigation {
-    
-	// Title
-    NSUInteger numberOfPhotos = [self numberOfPhotos];
-    if (numberOfPhotos > 1) {
-        if ([_delegate respondsToSelector:@selector(photoBrowser:titleForPhotoAtIndex:)]) {
-            self.title = [_delegate photoBrowser:self titleForPhotoAtIndex:_currentPageIndex];
-        } else {
-            self.title = [NSString stringWithFormat:@"%lu %@ %lu", (unsigned long)(_currentPageIndex+1), NSLocalizedString(@"of", @"Used in the context: 'Showing 1 of 3 items'"), (unsigned long)numberOfPhotos];
-        }
-	} else {
-		self.title = nil;
-	}
-	
-	// Buttons
-	_previousButton.enabled = (_currentPageIndex > 0);
-	_nextButton.enabled = (_currentPageIndex < numberOfPhotos - 1);
-    
-    //TWS Disable action button if there is no image or it's a video
-    /*
-    MWPhoto *photo = [self photoAtIndex:_currentPageIndex];
-    if ([photo underlyingImage] == nil || ([photo respondsToSelector:@selector(isVideo)] && photo.isVideo)) {
-        _actionButton.enabled = NO;
-        _actionButton.tintColor = [UIColor clearColor]; // Tint to hide button
-    } else {
-        _actionButton.enabled = YES;
-        _actionButton.tintColor = nil;
-    }
-	*/
-}
-
-- (void)jumpToPageAtIndex:(NSUInteger)index animated:(BOOL)animated {
-	
-	// Change page
-	if (index < [self numberOfPhotos]) {
-		CGRect pageFrame = [self frameForPageAtIndex:index];
-        [_pagingScrollView setContentOffset:CGPointMake(pageFrame.origin.x - PADDING, 0) animated:animated];
-		[self updateNavigation];
-	}
-	
-	// Update timer to give more time
-	[self hideControlsAfterDelay];
-	
-}
-
-- (void)gotoPreviousPage {
-    [self showPreviousPhotoAnimated:NO];
-}
-- (void)gotoNextPage {
-    [self showNextPhotoAnimated:NO];
-}
-
-- (void)showPreviousPhotoAnimated:(BOOL)animated {
-    [self jumpToPageAtIndex:_currentPageIndex-1 animated:animated];
-}
-
-- (void)showNextPhotoAnimated:(BOOL)animated {
-    [self jumpToPageAtIndex:_currentPageIndex+1 animated:animated];
-}
-
-#pragma mark - Interactions
-
-- (void)selectedButtonTapped:(id)sender {
-    UIButton *selectedButton = (UIButton *)sender;
-    selectedButton.selected = !selectedButton.selected;
-    NSUInteger index = NSUIntegerMax;
-    for (MWZoomingScrollView *page in _visiblePages) {
-        if (page.selectedButton == selectedButton) {
-            index = page.index;
-            break;
-        }
-    }
-    if (index != NSUIntegerMax) {
-        [self setPhotoSelected:selectedButton.selected atIndex:index];
-    }
-}
-
-- (void)playButtonTapped:(id)sender {
-    // Ignore if we're already playing a video
-    if (_currentVideoIndex != NSUIntegerMax) {
-        return;
-    }
-    NSUInteger index = [self indexForPlayButton:sender];
-    if (index != NSUIntegerMax) {
-        if (!_currentVideoPlayerViewController) {
-            [self playVideoAtIndex:index];
-        }
-    }
-}
-
-- (NSUInteger)indexForPlayButton:(UIView *)playButton {
-    NSUInteger index = NSUIntegerMax;
-    for (MWZoomingScrollView *page in _visiblePages) {
-        if (page.playButton == playButton) {
-            index = page.index;
-            break;
-        }
-    }
-    return index;
-}
-
-#pragma mark - Video
-
-- (void)playVideoAtIndex:(NSUInteger)index {
-    id photo = [self photoAtIndex:index];
-    if ([photo respondsToSelector:@selector(getVideoURL:)]) {
-        
-        // Valid for playing
-        [self clearCurrentVideo];
-        _currentVideoIndex = index;
-        [self setVideoLoadingIndicatorVisible:YES atPageIndex:index];
-        
-        // Get video and play
-        __typeof(self) __weak weakSelf = self;
-        [photo getVideoURL:^(NSURL *url) {
-            dispatch_async(dispatch_get_main_queue(), ^{
-                // If the video is not playing anymore then bail
-                __typeof(self) strongSelf = weakSelf;
-                if (!strongSelf) return;
-                if (strongSelf->_currentVideoIndex != index || !strongSelf->_viewIsActive) {
-                    return;
-                }
-                if (url) {
-                    [weakSelf _playVideo:url atPhotoIndex:index];
-                } else {
-                    [weakSelf setVideoLoadingIndicatorVisible:NO atPageIndex:index];
-                }
-            });
-        }];
-        
-    }
-}
-
-- (void)_playVideo:(NSURL *)videoURL atPhotoIndex:(NSUInteger)index {
-    
-    // Setup player
-    _currentVideoPlayerViewController = [[AVPlayerViewController alloc] init];
-    _currentVideoPlayerViewController.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
-    
-    _currentVideoPlayerItem = [[AVPlayerItem alloc] initWithURL:videoURL];
-    _currentVideoPlayerViewController.player = [[AVPlayer alloc] initWithPlayerItem:_currentVideoPlayerItem];
-    _currentVideoPlayer = _currentVideoPlayerViewController.player;
-    
-    // Remove the movie player view controller from the "playback did finish" notification observers
-    // Observe ourselves so we can get it to use the crossfade transition
-    [[NSNotificationCenter defaultCenter] removeObserver:self
-                                                    name:AVPlayerItemDidPlayToEndTimeNotification
-                                                  object:_currentVideoPlayerItem];
-    [[NSNotificationCenter defaultCenter] addObserver:self
-                                             selector:@selector(videoFinishedCallback:)
-                                                 name:AVPlayerItemDidPlayToEndTimeNotification
-                                               object:_currentVideoPlayerItem];
-    
-    // Show
-    [self presentViewController:_currentVideoPlayerViewController animated:YES completion:^{
-        [_currentVideoPlayer play];
-    }];
-    
-}
-
-- (void)videoFinishedCallback:(NSNotification*)notification {
-    
-    // Remove observer
-    [[NSNotificationCenter defaultCenter] removeObserver:self
-                                                    name:AVPlayerItemDidPlayToEndTimeNotification
-                                                  object:_currentVideoPlayerItem];
-    
-    // Clear up
-    [self clearCurrentVideo];
-    [self dismissViewControllerAnimated:YES completion:nil];
-}
-
-- (void)clearCurrentVideo {
-    [_currentVideoPlayerViewController.player pause];
-    [_currentVideoLoadingIndicator removeFromSuperview];
-    _currentVideoPlayerViewController = nil;
-    _currentVideoLoadingIndicator = nil;
-    _currentVideoPlayerItem = nil;
-    [[self pageDisplayedAtIndex:_currentVideoIndex] playButton].hidden = NO;
-    _currentVideoIndex = NSUIntegerMax;
-}
-
-- (void)setVideoLoadingIndicatorVisible:(BOOL)visible atPageIndex:(NSUInteger)pageIndex {
-    if (_currentVideoLoadingIndicator && !visible) {
-        [_currentVideoLoadingIndicator removeFromSuperview];
-        _currentVideoLoadingIndicator = nil;
-        [[self pageDisplayedAtIndex:pageIndex] playButton].hidden = NO;
-    } else if (!_currentVideoLoadingIndicator && visible) {
-        _currentVideoLoadingIndicator = [[UIActivityIndicatorView alloc] initWithFrame:CGRectZero];
-        [_currentVideoLoadingIndicator sizeToFit];
-        [_currentVideoLoadingIndicator startAnimating];
-        [_pagingScrollView addSubview:_currentVideoLoadingIndicator];
-        [self positionVideoLoadingIndicator];
-        [[self pageDisplayedAtIndex:pageIndex] playButton].hidden = YES;
-    }
-}
-
-- (void)positionVideoLoadingIndicator {
-    if (_currentVideoLoadingIndicator && _currentVideoIndex != NSUIntegerMax) {
-        CGRect frame = [self frameForPageAtIndex:_currentVideoIndex];
-        _currentVideoLoadingIndicator.center = CGPointMake(CGRectGetMidX(frame), CGRectGetMidY(frame));
-    }
-}
-
-#pragma mark - Control Hiding / Showing
-
-// If permanent then we don't set timers to hide again
-// Fades all controls on iOS 5 & 6, and iOS 7 controls slide and fade
-- (void)setControlsHidden:(BOOL)hidden animated:(BOOL)animated permanent:(BOOL)permanent {
-    
-    // Force visible
-    if (![self numberOfPhotos] || _alwaysShowControls)
-        hidden = NO;
-    
-    // Cancel any timers
-    [self cancelControlHiding];
-    
-    // Animations & positions
-    CGFloat animatonOffset = 20;
-    CGFloat animationDuration = (animated ? 0.35 : 0);
-    
-    // Toolbar, nav bar and captions
-    // Pre-appear animation positions for sliding
-    if ([self areControlsHidden] && !hidden && animated) {
-        
-        // Toolbar
-        _toolbar.frame = CGRectOffset([self frameForToolbarAtOrientation:[[UIApplication sharedApplication] statusBarOrientation]], 0, animatonOffset);
-        
-        // Captions
-        for (MWZoomingScrollView *page in _visiblePages) {
-            
-            if (page.captionView) {
-                
-                MWCaptionView *v = page.captionView;
-                
-                //TWS
-                id <MWPhoto> photo = [self photoAtIndex:self.currentIndex];
-                if (photo.caption) {
-                 
-                    if ([photo caption]) v.label.text = photo.caption;
-                }
-                
-                // Pass any index, all we're interested in is the Y
-                CGRect captionFrame = [self frameForCaptionView:v atIndex:0];
-                captionFrame.origin.x = v.frame.origin.x; // Reset X
-                v.frame = CGRectOffset(captionFrame, 0, animatonOffset);
-            }
-        }
-        
-    }
-    
-    if ([_delegate respondsToSelector:@selector(setControlsHidden:animated:permanent:)]) {
-        [_delegate setControlsHidden:hidden animated:animated permanent:permanent];
-    }
-    
-    [UIView animateWithDuration:animationDuration animations:^(void) {
-        
-        CGFloat alpha = hidden ? 0 : 1;
-
-        // Nav bar slides up on it's own on iOS 7+
-        [self.navigationController.navigationBar setAlpha:alpha];
-        
-        // Toolbar
-        _toolbar.frame = [self frameForToolbarAtOrientation:[[UIApplication sharedApplication] statusBarOrientation]];
-        if (hidden) _toolbar.frame = CGRectOffset(_toolbar.frame, 0, animatonOffset);
-        _toolbar.alpha = alpha;
-
-        // Captions
-        for (MWZoomingScrollView *page in _visiblePages) {
-            if (page.captionView) {
-                MWCaptionView *v = page.captionView;
-                // Pass any index, all we're interested in is the Y
-                CGRect captionFrame = [self frameForCaptionView:v atIndex:0];
-                captionFrame.origin.x = v.frame.origin.x; // Reset X
-                if (hidden) captionFrame = CGRectOffset(captionFrame, 0, animatonOffset);
-                v.frame = captionFrame;
-                v.alpha = alpha;
-            }
-        }
-        
-        // Selected buttons
-        for (MWZoomingScrollView *page in _visiblePages) {
-            if (page.selectedButton) {
-                UIButton *v = page.selectedButton;
-                CGRect newFrame = [self frameForSelectedButton:v atIndex:0];
-                newFrame.origin.x = v.frame.origin.x;
-                v.frame = newFrame;
-            }
-        }
-
-    } completion:^(BOOL finished) {}];
-    
-	// Control hiding timer
-	// Will cancel existing timer but only begin hiding if
-	// they are visible
-	if (!permanent) [self hideControlsAfterDelay];
-	
-}
-
-- (UIStatusBarStyle)preferredStatusBarStyle {
-    return UIStatusBarStyleLightContent;
-}
-
-- (UIStatusBarAnimation)preferredStatusBarUpdateAnimation {
-    return UIStatusBarAnimationSlide;
-}
-
-- (void)cancelControlHiding {
-	// If a timer exists then cancel and release
-	if (_controlVisibilityTimer) {
-		[_controlVisibilityTimer invalidate];
-		_controlVisibilityTimer = nil;
-	}
-}
-
-// Enable/disable control visiblity timer
-- (void)hideControlsAfterDelay {
-	if (![self areControlsHidden]) {
-        [self cancelControlHiding];
-		_controlVisibilityTimer = [NSTimer scheduledTimerWithTimeInterval:self.delayToHideElements target:self selector:@selector(hideControls) userInfo:nil repeats:NO];
-	}
-}
-
-- (BOOL)areControlsHidden {
-    return (_toolbar.alpha == 0);
-}
-
-- (void)hideControls { [self setControlsHidden:YES animated:YES permanent:NO]; }
-- (void)showControls { [self setControlsHidden:NO animated:YES permanent:NO]; }
-- (void)toggleControls { [self setControlsHidden:![self areControlsHidden] animated:YES permanent:NO]; }
-
-#pragma mark - Properties
-
-- (void)setCurrentPhotoIndex:(NSUInteger)index {
-    // Validate
-    NSUInteger photoCount = [self numberOfPhotos];
-    if (photoCount == 0) {
-        index = 0;
-    } else {
-        if (index >= photoCount)
-            index = [self numberOfPhotos]-1;
-    }
-    _currentPageIndex = index;
-	if ([self isViewLoaded]) {
-        [self jumpToPageAtIndex:index animated:NO];
-        if (!_viewIsActive)
-            [self tilePages]; // Force tiling if view is not visible
-    }
-}
-
-#pragma mark - Misc
-
-- (void)doneButtonPressed:(id)sender {
-   
-    // Dismiss view controller
-    if ([_delegate respondsToSelector:@selector(photoBrowserDidFinishPresentation:)]) {
-        // Call delegate method and let them dismiss us
-        [_delegate photoBrowserDidFinishPresentation:self];
-    }
-}
-
-#pragma mark - Delete
-
-- (void)deleteButtonPressed:(id)sender {
-    
-    if ([self.delegate respondsToSelector:@selector(photoBrowser:deleteButtonPressedForPhotoAtIndex:deleteButton:)])
-        [self.delegate photoBrowser:self deleteButtonPressedForPhotoAtIndex:_currentPageIndex deleteButton:self.deleteButton];
-}
-
-#pragma mark - Share
-
-- (void)shareButtonPressed:(id)sender {
-    
-    if ([self.delegate respondsToSelector:@selector(photoBrowser:shareButtonPressedForPhotoAtIndex:)])
-        [self.delegate photoBrowser:self shareButtonPressedForPhotoAtIndex:_currentPageIndex];
-}
-
-#pragma mark - Actions
-
-- (void)actionButtonPressed:(id)sender {
-
-    // Only react when image has loaded
-    id <MWPhoto> photo = [self photoAtIndex:_currentPageIndex];
-    if ([self numberOfPhotos] > 0 && [photo underlyingImage]) {
-        
-        // If they have defined a delegate method then just message them
-        if ([self.delegate respondsToSelector:@selector(photoBrowser:actionButtonPressedForPhotoAtIndex:)]) {
-            
-            // Let delegate handle things
-            [self.delegate photoBrowser:self actionButtonPressedForPhotoAtIndex:_currentPageIndex];
-            
-        } else {
-            
-            // Show activity view controller
-            NSMutableArray *items = [NSMutableArray arrayWithObject:[photo underlyingImage]];
-            if (photo.caption) {
-                [items addObject:photo.caption];
-            }
-            self.activityViewController = [[UIActivityViewController alloc] initWithActivityItems:items applicationActivities:nil];
-            
-            // Show
-            typeof(self) __weak weakSelf = self;
-            [self.activityViewController setCompletionWithItemsHandler:^(NSString *activityType, BOOL completed, NSArray *returnedItems, NSError *activityError) {
-                weakSelf.activityViewController = nil;
-                [weakSelf hideControlsAfterDelay];
-            }];
-            // iOS 8 - Set the Anchor Point for the popover
-            if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"8")) {
-                self.activityViewController.popoverPresentationController.barButtonItem = _actionButton;
-            }
-            [self presentViewController:self.activityViewController animated:YES completion:nil];
-
-        }
-        
-        // Keep controls hidden
-        [self setControlsHidden:NO animated:YES permanent:YES];
-
-    }
-    
-}
-
-@end

+ 0 - 117
iOSClient/Library/MWPhotoBrowser/MWPhotoBrowserPrivate.h

@@ -1,117 +0,0 @@
-//
-//  MWPhotoBrowser_Private.h
-//  MWPhotoBrowser
-//
-//  Created by Michael Waterfall on 08/10/2013.
-//
-//
-
-#import <UIKit/UIKit.h>
-#import <AVKit/AVKit.h>
-#import <MediaPlayer/MediaPlayer.h>
-#import <MBProgressHUD/MBProgressHUD.h>
-
-#import "MWZoomingScrollView.h"
-
-// Declare private methods of browser
-@interface MWPhotoBrowser () {
-    
-	// Data
-    NSUInteger _photoCount;
-    NSMutableArray *_photos;
-    NSMutableArray *_thumbPhotos;
-	NSArray *_fixedPhotosArray; // Provided via init
-	
-	// Views
-	UIScrollView *_pagingScrollView;
-	
-	// Paging & layout
-	NSMutableSet *_visiblePages, *_recycledPages;
-	NSUInteger _currentPageIndex;
-    NSUInteger _previousPageIndex;
-    CGRect _previousLayoutBounds;
-	NSUInteger _pageIndexBeforeRotation;
-	
-	// Navigation & controls
-	NSTimer *_controlVisibilityTimer;
-    MBProgressHUD *_progressHUD;
-    
-    // Appearance
-    BOOL _previousNavBarHidden;
-    BOOL _previousNavBarTranslucent;
-    UIBarStyle _previousNavBarStyle;
-    UIColor *_previousNavBarTintColor;
-    UIColor *_previousNavBarBarTintColor;
-    UIBarButtonItem *_previousViewControllerBackButton;
-    UIImage *_previousNavigationBarBackgroundImageDefault;
-    UIImage *_previousNavigationBarBackgroundImageLandscapePhone;
-    
-    // Video
-    AVPlayerViewController *_currentVideoPlayerViewController;
-    AVPlayerItem *_currentVideoPlayerItem;
-    NSUInteger _currentVideoIndex;
-    UIActivityIndicatorView *_currentVideoLoadingIndicator;
-    
-    // Misc
-    BOOL _hasBelongedToViewController;
-    BOOL _isVCBasedStatusBarAppearance;
-    BOOL _statusBarShouldBeHidden;
-    BOOL _displayActionButton;
-	BOOL _performingLayout;
-	BOOL _rotating;
-    BOOL _viewIsActive; // active as in it's in the view heirarchy
-    BOOL _didSavePreviousStateOfNavBar;
-    BOOL _skipNextPagingScrollViewPositioning;
-    BOOL _viewHasAppearedInitially;
-}
-
-// Properties
-@property (nonatomic) UIActivityViewController *activityViewController;
-
-// Layout
-- (void)layoutVisiblePages;
-- (void)performLayout;
-- (BOOL)presentingViewControllerPrefersStatusBarHidden;
-
-// Paging
-- (void)tilePages;
-- (BOOL)isDisplayingPageForIndex:(NSUInteger)index;
-- (MWZoomingScrollView *)pageDisplayedAtIndex:(NSUInteger)index;
-- (MWZoomingScrollView *)pageDisplayingPhoto:(id<MWPhoto>)photo;
-- (MWZoomingScrollView *)dequeueRecycledPage;
-- (void)configurePage:(MWZoomingScrollView *)page forIndex:(NSUInteger)index;
-- (void)didStartViewingPageAtIndex:(NSUInteger)index;
-
-// Frames
-- (CGRect)frameForPagingScrollView;
-- (CGRect)frameForPageAtIndex:(NSUInteger)index;
-- (CGSize)contentSizeForPagingScrollView;
-- (CGPoint)contentOffsetForPageAtIndex:(NSUInteger)index;
-- (CGRect)frameForToolbarAtOrientation:(UIInterfaceOrientation)orientation;
-- (CGRect)frameForCaptionView:(MWCaptionView *)captionView atIndex:(NSUInteger)index;
-- (CGRect)frameForSelectedButton:(UIButton *)selectedButton atIndex:(NSUInteger)index;
-
-// Navigation
-- (void)updateNavigation;
-- (void)jumpToPageAtIndex:(NSUInteger)index animated:(BOOL)animated;
-- (void)gotoPreviousPage;
-- (void)gotoNextPage;
-
-// Controls
-- (void)cancelControlHiding;
-- (void)hideControlsAfterDelay;
-- (void)setControlsHidden:(BOOL)hidden animated:(BOOL)animated permanent:(BOOL)permanent;
-- (void)toggleControls;
-- (BOOL)areControlsHidden;
-
-// Data
-- (NSUInteger)numberOfPhotos;
-- (id<MWPhoto>)photoAtIndex:(NSUInteger)index;
-- (UIImage *)imageForPhoto:(id<MWPhoto>)photo;
-- (BOOL)photoIsSelectedAtIndex:(NSUInteger)index;
-- (void)setPhotoSelected:(BOOL)selected atIndex:(NSUInteger)index;
-- (void)loadAdjacentPhotosIfNecessary:(id<MWPhoto>)photo;
-- (void)releaseAllUnderlyingPhotos:(BOOL)preserveCurrent;
-
-@end
-

+ 0 - 71
iOSClient/Library/MWPhotoBrowser/MWPhotoProtocol.h

@@ -1,71 +0,0 @@
-//
-//  MWPhotoProtocol.h
-//  MWPhotoBrowser
-//
-//  Created by Michael Waterfall on 02/01/2012.
-//  Copyright (c) 2012 __MyCompanyName__. All rights reserved.
-//
-
-#import <Foundation/Foundation.h>
-
-// Notifications
-#define MWPHOTO_LOADING_DID_END_NOTIFICATION @"MWPHOTO_LOADING_DID_END_NOTIFICATION"
-#define MWPHOTO_PROGRESS_NOTIFICATION @"MWPHOTO_PROGRESS_NOTIFICATION"
-
-// If you wish to use your own data models for photo then they must conform
-// to this protocol. See instructions for details on each method.
-// Otherwise you can use the MWPhoto object or subclass it yourself to
-// store more information per photo.
-//
-// You can see the MWPhoto class for an example implementation of this protocol
-//
-@protocol MWPhoto <NSObject>
-
-@required
-
-// Return underlying UIImage to be displayed
-// Return nil if the image is not immediately available (loaded into memory, preferably
-// already decompressed) and needs to be loaded from a source (cache, file, web, etc)
-// IMPORTANT: You should *NOT* use this method to initiate
-// fetching of images from any external of source. That should be handled
-// in -loadUnderlyingImageAndNotify: which may be called by the photo browser if this
-// methods returns nil.
-@property (nonatomic, strong) UIImage *underlyingImage;
-
-// Called when the browser has determined the underlying images is not
-// already loaded into memory but needs it.
-- (void)loadUnderlyingImageAndNotify;
-
-// Fetch the image data from a source and notify when complete.
-// You must load the image asyncronously (and decompress it for better performance).
-// It is recommended that you use SDWebImageDecoder to perform the decompression.
-// See MWPhoto object for an example implementation.
-// When the underlying UIImage is loaded (or failed to load) you should post the following
-// notification:
-// [[NSNotificationCenter defaultCenter] postNotificationName:MWPHOTO_LOADING_DID_END_NOTIFICATION
-//                                                     object:self];
-- (void)performLoadUnderlyingImageAndNotify;
-
-// This is called when the photo browser has determined the photo data
-// is no longer needed or there are low memory conditions
-// You should release any underlying (possibly large and decompressed) image data
-// as long as the image can be re-loaded (from cache, file, or URL)
-- (void)unloadUnderlyingImage;
-
-@optional
-
-// If photo is empty, in which case, don't show loading error icons
-@property (nonatomic) BOOL emptyImage;
-
-// Video
-@property (nonatomic) BOOL isVideo;
-- (void)getVideoURL:(void (^)(NSURL *url))completion;
-
-// Return a caption string to be displayed over the image
-// Return nil to display no caption
-- (NSString *)caption;
-
-// Cancel any background loading of image data
-- (void)cancelAnyLoading;
-
-@end

+ 0 - 29
iOSClient/Library/MWPhotoBrowser/MWTapDetectingImageView.h

@@ -1,29 +0,0 @@
-//
-//  UIImageViewTap.h
-//  Momento
-//
-//  Created by Michael Waterfall on 04/11/2009.
-//  Copyright 2009 d3i. All rights reserved.
-//
-
-#import <Foundation/Foundation.h>
-#import <UIKit/UIKit.h>
-
-
-@protocol MWTapDetectingImageViewDelegate;
-
-@interface MWTapDetectingImageView : UIImageView {}
-
-@property (nonatomic, weak) id <MWTapDetectingImageViewDelegate> tapDelegate;
-
-@end
-
-@protocol MWTapDetectingImageViewDelegate <NSObject>
-
-@optional
-
-- (void)imageView:(UIImageView *)imageView singleTapDetected:(UITouch *)touch;
-- (void)imageView:(UIImageView *)imageView doubleTapDetected:(UITouch *)touch;
-- (void)imageView:(UIImageView *)imageView tripleTapDetected:(UITouch *)touch;
-
-@end

+ 0 - 68
iOSClient/Library/MWPhotoBrowser/MWTapDetectingImageView.m

@@ -1,68 +0,0 @@
-//
-//  UIImageViewTap.m
-//  Momento
-//
-//  Created by Michael Waterfall on 04/11/2009.
-//  Copyright 2009 d3i. All rights reserved.
-//
-
-#import "MWTapDetectingImageView.h"
-
-@implementation MWTapDetectingImageView
-
-- (id)initWithFrame:(CGRect)frame {
-	if ((self = [super initWithFrame:frame])) {
-		self.userInteractionEnabled = YES;
-	}
-	return self;
-}
-
-- (id)initWithImage:(UIImage *)image {
-	if ((self = [super initWithImage:image])) {
-		self.userInteractionEnabled = YES;
-	}
-	return self;
-}
-
-- (id)initWithImage:(UIImage *)image highlightedImage:(UIImage *)highlightedImage {
-	if ((self = [super initWithImage:image highlightedImage:highlightedImage])) {
-		self.userInteractionEnabled = YES;
-	}
-	return self;
-}
-
-- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event {
-	UITouch *touch = [touches anyObject];
-	NSUInteger tapCount = touch.tapCount;
-	switch (tapCount) {
-		case 1:
-			[self handleSingleTap:touch];
-			break;
-		case 2:
-			[self handleDoubleTap:touch];
-			break;
-		case 3:
-			[self handleTripleTap:touch];
-			break;
-		default:
-			break;
-	}
-	[[self nextResponder] touchesEnded:touches withEvent:event];
-}
-
-- (void)handleSingleTap:(UITouch *)touch {
-	if ([_tapDelegate respondsToSelector:@selector(imageView:singleTapDetected:)])
-		[_tapDelegate imageView:self singleTapDetected:touch];
-}
-
-- (void)handleDoubleTap:(UITouch *)touch {
-	if ([_tapDelegate respondsToSelector:@selector(imageView:doubleTapDetected:)])
-		[_tapDelegate imageView:self doubleTapDetected:touch];
-}
-
-- (void)handleTripleTap:(UITouch *)touch {
-	if ([_tapDelegate respondsToSelector:@selector(imageView:tripleTapDetected:)])
-		[_tapDelegate imageView:self tripleTapDetected:touch];
-}
-
-@end

+ 0 - 29
iOSClient/Library/MWPhotoBrowser/MWTapDetectingView.h

@@ -1,29 +0,0 @@
-//
-//  UIViewTap.h
-//  Momento
-//
-//  Created by Michael Waterfall on 04/11/2009.
-//  Copyright 2009 d3i. All rights reserved.
-//
-
-#import <Foundation/Foundation.h>
-#import <UIKit/UIKit.h>
-
-
-@protocol MWTapDetectingViewDelegate;
-
-@interface MWTapDetectingView : UIView {}
-
-@property (nonatomic, weak) id <MWTapDetectingViewDelegate> tapDelegate;
-
-@end
-
-@protocol MWTapDetectingViewDelegate <NSObject>
-
-@optional
-
-- (void)view:(UIView *)view singleTapDetected:(UITouch *)touch;
-- (void)view:(UIView *)view doubleTapDetected:(UITouch *)touch;
-- (void)view:(UIView *)view tripleTapDetected:(UITouch *)touch;
-
-@end

+ 0 - 61
iOSClient/Library/MWPhotoBrowser/MWTapDetectingView.m

@@ -1,61 +0,0 @@
-//
-//  UIViewTap.m
-//  Momento
-//
-//  Created by Michael Waterfall on 04/11/2009.
-//  Copyright 2009 d3i. All rights reserved.
-//
-
-#import "MWTapDetectingView.h"
-
-@implementation MWTapDetectingView
-
-- (id)init {
-	if ((self = [super init])) {
-		self.userInteractionEnabled = YES;
-	}
-	return self;
-}
-
-- (id)initWithFrame:(CGRect)frame {
-	if ((self = [super initWithFrame:frame])) {
-		self.userInteractionEnabled = YES;
-	}
-	return self;
-}
-
-- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event {
-	UITouch *touch = [touches anyObject];
-	NSUInteger tapCount = touch.tapCount;
-	switch (tapCount) {
-		case 1:
-			[self handleSingleTap:touch];
-			break;
-		case 2:
-			[self handleDoubleTap:touch];
-			break;
-		case 3:
-			[self handleTripleTap:touch];
-			break;
-		default:
-			break;
-	}
-	[[self nextResponder] touchesEnded:touches withEvent:event];
-}
-
-- (void)handleSingleTap:(UITouch *)touch {
-	if ([_tapDelegate respondsToSelector:@selector(view:singleTapDetected:)])
-		[_tapDelegate view:self singleTapDetected:touch];
-}
-
-- (void)handleDoubleTap:(UITouch *)touch {
-	if ([_tapDelegate respondsToSelector:@selector(view:doubleTapDetected:)])
-		[_tapDelegate view:self doubleTapDetected:touch];
-}
-
-- (void)handleTripleTap:(UITouch *)touch {
-	if ([_tapDelegate respondsToSelector:@selector(view:tripleTapDetected:)])
-		[_tapDelegate view:self tripleTapDetected:touch];
-}
-
-@end

+ 0 - 34
iOSClient/Library/MWPhotoBrowser/MWZoomingScrollView.h

@@ -1,34 +0,0 @@
-//
-//  ZoomingScrollView.h
-//  MWPhotoBrowser
-//
-//  Created by Michael Waterfall on 14/10/2010.
-//  Copyright 2010 d3i. All rights reserved.
-//
-
-#import <Foundation/Foundation.h>
-#import "MWPhotoProtocol.h"
-#import "MWTapDetectingImageView.h"
-#import "MWTapDetectingView.h"
-
-@class MWPhotoBrowser, MWPhoto, MWCaptionView;
-
-@interface MWZoomingScrollView : UIScrollView <UIScrollViewDelegate, MWTapDetectingImageViewDelegate, MWTapDetectingViewDelegate> {
-
-}
-
-@property () NSUInteger index;
-@property (nonatomic) id <MWPhoto> photo;
-@property (nonatomic, weak) MWCaptionView *captionView;
-@property (nonatomic, weak) UIButton *selectedButton;
-@property (nonatomic, weak) UIButton *playButton;
-
-- (id)initWithPhotoBrowser:(MWPhotoBrowser *)browser;
-- (void)displayImage;
-- (void)displayImageFailure;
-- (void)setMaxMinZoomScalesForCurrentBounds;
-- (void)prepareForReuse;
-- (BOOL)displayingVideo;
-- (void)setImageHidden:(BOOL)hidden;
-
-@end

+ 0 - 402
iOSClient/Library/MWPhotoBrowser/MWZoomingScrollView.m

@@ -1,402 +0,0 @@
-//
-//  ZoomingScrollView.m
-//  MWPhotoBrowser
-//
-//  Created by Michael Waterfall on 14/10/2010.
-//  Copyright 2010 d3i. All rights reserved.
-//
-
-#import "MWCommon.h"
-#import "MWZoomingScrollView.h"
-#import "MWPhotoBrowser.h"
-#import "MWPhoto.h"
-#import "MWPhotoBrowserPrivate.h"
-#import "UIImage+MWPhotoBrowser.h"
-#import "NCBridgeSwift.h"
-
-// Private methods and properties
-@interface MWZoomingScrollView () {
-    
-    MWPhotoBrowser __weak *_photoBrowser;
-	MWTapDetectingView *_tapView; // for background taps
-	MWTapDetectingImageView *_photoImageView;
-    UIImageView *_loadingError;
-    
-}
-
-@end
-
-@implementation MWZoomingScrollView
-
-- (id)initWithPhotoBrowser:(MWPhotoBrowser *)browser {
-    if ((self = [super init])) {
-        
-        // Setup
-        _index = NSUIntegerMax;
-        _photoBrowser = browser;
-        
-		// Tap view for background
-		_tapView = [[MWTapDetectingView alloc] initWithFrame:self.bounds];
-		_tapView.tapDelegate = self;
-		_tapView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
-		_tapView.backgroundColor = NCBrandColor.sharedInstance.backgroundView; //TWS
-		[self addSubview:_tapView];
-		
-		// Image view
-		_photoImageView = [[MWTapDetectingImageView alloc] initWithFrame:CGRectZero];
-		_photoImageView.tapDelegate = self;
-		_photoImageView.contentMode = UIViewContentModeCenter;
-		_photoImageView.backgroundColor = NCBrandColor.sharedInstance.backgroundView; //TWS
-		[self addSubview:_photoImageView];
-				
-		// Setup
-		self.backgroundColor = NCBrandColor.sharedInstance.backgroundView; //TWS
-		self.delegate = self;
-		self.showsHorizontalScrollIndicator = NO;
-		self.showsVerticalScrollIndicator = NO;
-		self.decelerationRate = UIScrollViewDecelerationRateFast;
-		self.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
-        
-    }
-    return self;
-}
-
-- (void)dealloc {
-    [[NSNotificationCenter defaultCenter] removeObserver:self];
-}
-
-- (void)prepareForReuse {
-    [self hideImageFailure];
-    self.photo = nil;
-    self.captionView = nil;
-    self.selectedButton = nil;
-    self.playButton = nil;
-    _photoImageView.hidden = NO;
-    _photoImageView.image = nil;
-    _index = NSUIntegerMax;
-}
-
-- (BOOL)displayingVideo {
-    return [_photo respondsToSelector:@selector(isVideo)] && _photo.isVideo;
-}
-
-- (void)setImageHidden:(BOOL)hidden {
-    _photoImageView.hidden = hidden;
-}
-
-#pragma mark - Image
-
-- (void)setPhoto:(id<MWPhoto>)photo {
-    // Cancel any loading on old photo
-    if (_photo && photo == nil) {
-        if ([_photo respondsToSelector:@selector(cancelAnyLoading)]) {
-            [_photo cancelAnyLoading];
-        }
-    }
-    _photo = photo;
-    UIImage *img = [_photoBrowser imageForPhoto:_photo];
-    if (img) {
-        [self displayImage];
-    } else {
-        // Will be loading so show loading
-        [self showLoadingIndicator];
-    }
-}
-
-// Get and display image
-- (void)displayImage {
-	if (_photo && _photoImageView.image == nil) {
-		
-		// Reset
-		self.maximumZoomScale = 1;
-		self.minimumZoomScale = 1;
-		self.zoomScale = 1;
-		self.contentSize = CGSizeMake(0, 0);
-		
-		// Get image from browser as it handles ordering of fetching
-		UIImage *img = [_photoBrowser imageForPhoto:_photo];
-		if (img) {
-						
-			// Set image
-			_photoImageView.image = img;
-			_photoImageView.hidden = NO;
-			
-			// Setup photo frame
-			CGRect photoImageViewFrame;
-			photoImageViewFrame.origin = CGPointZero;
-			photoImageViewFrame.size = img.size;
-			_photoImageView.frame = photoImageViewFrame;
-			self.contentSize = photoImageViewFrame.size;
-
-			// Set zoom to minimum zoom
-			[self setMaxMinZoomScalesForCurrentBounds];
-			
-		} else  {
-
-            // Show image failure
-            [self displayImageFailure];
-			
-		}
-		[self setNeedsLayout];
-	}
-}
-
-// Image failed so just show black!
-- (void)displayImageFailure {
-    _photoImageView.image = nil;
-    
-    // Show if image is not empty
-    if (![_photo respondsToSelector:@selector(emptyImage)] || !_photo.emptyImage) {
-        if (!_loadingError) {
-            _loadingError = [UIImageView new];
-            _loadingError.image = [UIImage imageForResourcePath:@"ImageError" ofType:@"png" inBundle:[NSBundle bundleForClass:[self class]]];
-            _loadingError.userInteractionEnabled = NO;
-            _loadingError.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleTopMargin |
-            UIViewAutoresizingFlexibleBottomMargin | UIViewAutoresizingFlexibleRightMargin;
-            [_loadingError sizeToFit];
-            [self addSubview:_loadingError];
-        }
-        _loadingError.frame = CGRectMake(floorf((self.bounds.size.width - _loadingError.frame.size.width) / 2.),
-                                         floorf((self.bounds.size.height - _loadingError.frame.size.height) / 2),
-                                         _loadingError.frame.size.width,
-                                         _loadingError.frame.size.height);
-    }
-}
-
-- (void)hideImageFailure {
-    if (_loadingError) {
-        [_loadingError removeFromSuperview];
-        _loadingError = nil;
-    }
-}
-
-#pragma mark - Loading Progress
-
-
-//TWS
-- (void)showLoadingIndicator {
-    self.zoomScale = 0.1;
-    self.minimumZoomScale = 0.1;
-    self.maximumZoomScale = 0.1;
-    [self hideImageFailure];
-}
-
-#pragma mark - Setup
-
-- (CGFloat)initialZoomScaleWithMinScale {
-    CGFloat zoomScale = self.minimumZoomScale;
-    if (_photoImageView && _photoBrowser.zoomPhotosToFill) {
-        // Zoom image to fill if the aspect ratios are fairly similar
-        CGSize boundsSize = self.bounds.size;
-        CGSize imageSize = _photoImageView.image.size;
-        CGFloat boundsAR = boundsSize.width / boundsSize.height;
-        CGFloat imageAR = imageSize.width / imageSize.height;
-        CGFloat xScale = boundsSize.width / imageSize.width;    // the scale needed to perfectly fit the image width-wise
-        CGFloat yScale = boundsSize.height / imageSize.height;  // the scale needed to perfectly fit the image height-wise
-        // Zooms standard portrait images on a 3.5in screen but not on a 4in screen.
-        if (ABS(boundsAR - imageAR) < 0.17) {
-            zoomScale = MAX(xScale, yScale);
-            // Ensure we don't zoom in or out too far, just in case
-            zoomScale = MIN(MAX(self.minimumZoomScale, zoomScale), self.maximumZoomScale);
-        }
-    }
-    return zoomScale;
-}
-
-- (void)setMaxMinZoomScalesForCurrentBounds {
-    
-    // Reset
-    self.maximumZoomScale = 1;
-    self.minimumZoomScale = 1;
-    self.zoomScale = 1;
-    
-    // Bail if no image
-    if (_photoImageView.image == nil) return;
-    
-    // Reset position
-    _photoImageView.frame = CGRectMake(0, 0, _photoImageView.frame.size.width, _photoImageView.frame.size.height);
-	
-    // Sizes
-    CGSize boundsSize = self.bounds.size;
-    CGSize imageSize = _photoImageView.image.size;
-    
-    // Calculate Min
-    CGFloat xScale = boundsSize.width / imageSize.width;    // the scale needed to perfectly fit the image width-wise
-    CGFloat yScale = boundsSize.height / imageSize.height;  // the scale needed to perfectly fit the image height-wise
-    CGFloat minScale = MIN(xScale, yScale);                 // use minimum of these to allow the image to become fully visible
-    
-    // Calculate Max
-    CGFloat maxScale = 3;
-    if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
-        // Let them go a bit bigger on a bigger screen!
-        maxScale = 4;
-    }
-    
-    // Image is smaller than screen so no zooming!
-    if (xScale >= 1 && yScale >= 1) {
-        minScale = 1.0;
-    }
-    
-    // Set min/max zoom
-    self.maximumZoomScale = maxScale;
-    self.minimumZoomScale = minScale;
-    
-    // Initial zoom
-    self.zoomScale = [self initialZoomScaleWithMinScale];
-    
-    // If we're zooming to fill then centralise
-    if (self.zoomScale != minScale) {
-        
-        // Centralise
-        self.contentOffset = CGPointMake((imageSize.width * self.zoomScale - boundsSize.width) / 2.0,
-                                         (imageSize.height * self.zoomScale - boundsSize.height) / 2.0);
-
-    }
-    
-    // Disable scrolling initially until the first pinch to fix issues with swiping on an initally zoomed in photo
-    self.scrollEnabled = NO;
-    
-    // If it's a video then disable zooming
-    if ([self displayingVideo]) {
-        self.maximumZoomScale = self.zoomScale;
-        self.minimumZoomScale = self.zoomScale;
-    }
-
-    // Layout
-	[self setNeedsLayout];
-
-}
-
-#pragma mark - Layout
-
-- (void)layoutSubviews {
-	
-	// Update tap view frame
-	_tapView.frame = self.bounds;
-	
-	// Position indicators (centre does not seem to work!)
-    if (_loadingError)
-        _loadingError.frame = CGRectMake(floorf((self.bounds.size.width - _loadingError.frame.size.width) / 2.),
-                                         floorf((self.bounds.size.height - _loadingError.frame.size.height) / 2),
-                                         _loadingError.frame.size.width,
-                                         _loadingError.frame.size.height);
-
-	// Super
-	[super layoutSubviews];
-	
-    // Center the image as it becomes smaller than the size of the screen
-    CGSize boundsSize = self.bounds.size;
-    CGRect frameToCenter = _photoImageView.frame;
-    
-    // Horizontally
-    if (frameToCenter.size.width < boundsSize.width) {
-        frameToCenter.origin.x = floorf((boundsSize.width - frameToCenter.size.width) / 2.0);
-	} else {
-        frameToCenter.origin.x = 0;
-	}
-    
-    // Vertically
-    if (frameToCenter.size.height < boundsSize.height) {
-        frameToCenter.origin.y = floorf((boundsSize.height - frameToCenter.size.height) / 2.0);
-	} else {
-        frameToCenter.origin.y = 0;
-	}
-    
-	// Center
-	if (!CGRectEqualToRect(_photoImageView.frame, frameToCenter))
-		_photoImageView.frame = frameToCenter;
-	
-}
-
-#pragma mark - UIScrollViewDelegate
-
-- (UIView *)viewForZoomingInScrollView:(UIScrollView *)scrollView {
-	return _photoImageView;
-}
-
-- (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView {
-	[_photoBrowser cancelControlHiding];
-}
-
-- (void)scrollViewWillBeginZooming:(UIScrollView *)scrollView withView:(UIView *)view {
-    self.scrollEnabled = YES; // reset
-	[_photoBrowser cancelControlHiding];
-}
-
-- (void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL)decelerate {
-	[_photoBrowser hideControlsAfterDelay];
-}
-
-- (void)scrollViewDidZoom:(UIScrollView *)scrollView {
-    [self setNeedsLayout];
-    [self layoutIfNeeded];
-}
-
-#pragma mark - Tap Detection
-
-- (void)handleSingleTap:(CGPoint)touchPoint {
-	[_photoBrowser performSelector:@selector(toggleControls) withObject:nil afterDelay:0.2];
-}
-
-- (void)handleDoubleTap:(CGPoint)touchPoint {
-    
-    // Dont double tap to zoom if showing a video
-    if ([self displayingVideo]) {
-        return;
-    }
-	
-	// Cancel any single tap handling
-	[NSObject cancelPreviousPerformRequestsWithTarget:_photoBrowser];
-	
-	// Zoom
-	if (self.zoomScale != self.minimumZoomScale && self.zoomScale != [self initialZoomScaleWithMinScale]) {
-		
-		// Zoom out
-		[self setZoomScale:self.minimumZoomScale animated:YES];
-		
-	} else {
-		
-		// Zoom in to twice the size
-        CGFloat newZoomScale = ((self.maximumZoomScale + self.minimumZoomScale) / 2);
-        CGFloat xsize = self.bounds.size.width / newZoomScale;
-        CGFloat ysize = self.bounds.size.height / newZoomScale;
-        [self zoomToRect:CGRectMake(touchPoint.x - xsize/2, touchPoint.y - ysize/2, xsize, ysize) animated:YES];
-
-	}
-	
-	// Delay controls
-	[_photoBrowser hideControlsAfterDelay];
-	
-}
-
-// Image View
-- (void)imageView:(UIImageView *)imageView singleTapDetected:(UITouch *)touch { 
-    [self handleSingleTap:[touch locationInView:imageView]];
-}
-- (void)imageView:(UIImageView *)imageView doubleTapDetected:(UITouch *)touch {
-    [self handleDoubleTap:[touch locationInView:imageView]];
-}
-
-// Background View
-- (void)view:(UIView *)view singleTapDetected:(UITouch *)touch {
-    // Translate touch location to image view location
-    CGFloat touchX = [touch locationInView:view].x;
-    CGFloat touchY = [touch locationInView:view].y;
-    touchX *= 1/self.zoomScale;
-    touchY *= 1/self.zoomScale;
-    touchX += self.contentOffset.x;
-    touchY += self.contentOffset.y;
-    [self handleSingleTap:CGPointMake(touchX, touchY)];
-}
-- (void)view:(UIView *)view doubleTapDetected:(UITouch *)touch {
-    // Translate touch location to image view location
-    CGFloat touchX = [touch locationInView:view].x;
-    CGFloat touchY = [touch locationInView:view].y;
-    touchX *= 1/self.zoomScale;
-    touchY *= 1/self.zoomScale;
-    touchX += self.contentOffset.x;
-    touchY += self.contentOffset.y;
-    [self handleDoubleTap:CGPointMake(touchX, touchY)];
-}
-
-@end

+ 0 - 18
iOSClient/Library/MWPhotoBrowser/UIImage+MWPhotoBrowser.h

@@ -1,18 +0,0 @@
-//
-//  UIImage+MWPhotoBrowser.h
-//  Pods
-//
-//  Created by Michael Waterfall on 05/07/2015.
-//
-//
-
-#import <Foundation/Foundation.h>
-#import <UIKit/UIKit.h>
-
-
-@interface UIImage (MWPhotoBrowser)
-
-+ (UIImage *)imageForResourcePath:(NSString *)path ofType:(NSString *)type inBundle:(NSBundle *)bundle;
-+ (UIImage *)clearImageWithSize:(CGSize)size;
-
-@end

+ 0 - 24
iOSClient/Library/MWPhotoBrowser/UIImage+MWPhotoBrowser.m

@@ -1,24 +0,0 @@
-//
-//  UIImage+MWPhotoBrowser.m
-//  Pods
-//
-//  Created by Michael Waterfall on 05/07/2015.
-//
-//
-
-#import "UIImage+MWPhotoBrowser.h"
-
-@implementation UIImage (MWPhotoBrowser)
-
-+ (UIImage *)imageForResourcePath:(NSString *)path ofType:(NSString *)type inBundle:(NSBundle *)bundle {
-    return [UIImage imageWithContentsOfFile:[bundle pathForResource:path ofType:type]];
-}
-
-+ (UIImage *)clearImageWithSize:(CGSize)size {
-    UIGraphicsBeginImageContextWithOptions(size, NO, [UIScreen mainScreen].scale);
-    UIImage *blank = UIGraphicsGetImageFromCurrentImageContext();
-    UIGraphicsEndImageContext();
-    return blank;
-}
-
-@end

+ 8 - 7
iOSClient/Main/CCMain.m

@@ -89,13 +89,6 @@
         
         appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
         appDelegate.activeMain = self;
-        
-        [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(initializeMain:) name:@"initializeMain" object:nil];
-        [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(clearDateReadDataSource:) name:@"clearDateReadDataSource" object:nil];
-        [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(setTitle) name:@"setTitleMain" object:nil];
-        [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(triggerProgressTask:) name:@"NotificationProgressTask" object:nil];
-        [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(deleteFile:) name:k_notificationCenter_deleteFile object:nil];
-        [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(changeTheming) name:k_notificationCenter_changeTheming object:nil];
     }
     
     return self;
@@ -130,6 +123,14 @@
     self.searchController.delegate = self;
     self.searchController.searchBar.delegate = self;
     
+    // Notifiation
+    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(initializeMain:) name:@"initializeMain" object:nil];
+    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(clearDateReadDataSource:) name:@"clearDateReadDataSource" object:nil];
+    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(setTitle) name:@"setTitleMain" object:nil];
+    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(triggerProgressTask:) name:@"NotificationProgressTask" object:nil];
+    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(deleteFile:) name:k_notificationCenter_deleteFile object:nil];
+    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(changeTheming) name:k_notificationCenter_changeTheming object:nil];
+    
     // Search
     self.definesPresentationContext = YES;
     self.searchController.searchResultsUpdater = self;

+ 3 - 2
iOSClient/Share/NCSharePaging.swift

@@ -39,6 +39,8 @@ class NCSharePaging: UIViewController {
         
         pagingViewController.metadata = metadata
         
+        NotificationCenter.default.addObserver(self, selector: #selector(self.changeTheming), name: NSNotification.Name(rawValue: k_notificationCenter_changeTheming), object: nil)
+        
         // Navigation Controller
         var image = CCGraphics.changeThemingColorImage(UIImage(named: "exitCircle")!, width: 60, height: 60, color: NCBrandColor.sharedInstance.brandText)
         image = image?.withRenderingMode(.alwaysOriginal)
@@ -72,13 +74,12 @@ class NCSharePaging: UIViewController {
         let pagingIndexItem = self.pagingViewController(pagingViewController, pagingItemForIndex: indexPage) as PagingIndexItem
         self.title = pagingIndexItem.title
         
-        // changeTheming
-        NotificationCenter.default.addObserver(self, selector: #selector(self.changeTheming), name: NSNotification.Name(rawValue: k_notificationCenter_changeTheming), object: nil)
         changeTheming()
     }
     
     @objc func changeTheming() {
         appDelegate.changeTheming(self, tableView: nil, collectionView: nil, form: true)
+        view.backgroundColor = NCBrandColor.sharedInstance.backgroundForm
         
         pagingViewController.backgroundColor = NCBrandColor.sharedInstance.backgroundForm
         pagingViewController.selectedBackgroundColor = NCBrandColor.sharedInstance.backgroundForm

+ 2 - 2
iOSClient/Shares/NCShares.m

@@ -64,10 +64,10 @@
         [self registerForPreviewingWithDelegate:self sourceView:self.view];
     }
     
+    // Notification
     [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(reloadDatasource) name:@"SharesReloadDatasource" object:nil];
-    
-    // changeTheming
     [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(changeTheming) name:k_notificationCenter_changeTheming object:nil];
+    
     [self changeTheming];
 }