diff --git a/MediaBrowser.xcodeproj/project.pbxproj b/MediaBrowser.xcodeproj/project.pbxproj index 07b1669..bea76b2 100644 --- a/MediaBrowser.xcodeproj/project.pbxproj +++ b/MediaBrowser.xcodeproj/project.pbxproj @@ -488,7 +488,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.1; + IPHONEOS_DEPLOYMENT_TARGET = 15.6; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; @@ -547,7 +547,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.1; + IPHONEOS_DEPLOYMENT_TARGET = 15.6; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; diff --git a/MediaBrowser/MediaBrowser+Paging.swift b/MediaBrowser/MediaBrowser+Paging.swift index b1af133..9ae918e 100644 --- a/MediaBrowser/MediaBrowser+Paging.swift +++ b/MediaBrowser/MediaBrowser+Paging.swift @@ -6,7 +6,7 @@ // Copyright © 2019 Seungyoun Yi. All rights reserved. // -import Foundation +import UIKit extension MediaBrowser { /** setCurrentIndex to show first. diff --git a/MediaBrowser/MediaBrowser+UIScrollViewDelegate.swift b/MediaBrowser/MediaBrowser+UIScrollViewDelegate.swift index a378056..02fbcf3 100644 --- a/MediaBrowser/MediaBrowser+UIScrollViewDelegate.swift +++ b/MediaBrowser/MediaBrowser+UIScrollViewDelegate.swift @@ -6,7 +6,7 @@ // Copyright © 2019 Seungyoun Yi. All rights reserved. // -import Foundation +import UIKit extension MediaBrowser: UIScrollViewDelegate { public func scrollViewDidScroll(_ scrollView: UIScrollView) { diff --git a/MediaBrowser/MediaBrowser.swift b/MediaBrowser/MediaBrowser.swift index d51b104..0c9611c 100755 --- a/MediaBrowser/MediaBrowser.swift +++ b/MediaBrowser/MediaBrowser.swift @@ -290,9 +290,7 @@ func floorcgf(x: CGFloat) -> CGFloat { hidesBottomBarWhenPushed = true - automaticallyAdjustsScrollViewInsets = false -// extendedLayoutIncludesOpaqueBars = true -// navigationController?.view.backgroundColor = UIColor.white + pagingScrollView.contentInsetAdjustmentBehavior = .never // Listen for Media falsetifications NotificationCenter.default.addObserver( @@ -383,7 +381,7 @@ func floorcgf(x: CGFloat) -> CGFloat { toolbar.barTintColor = toolbarBarTintColor toolbar.backgroundColor = toolbarBackgroundColor toolbar.alpha = toolbarAlpha - toolbar.barStyle = .blackTranslucent + toolbar.barStyle = .black toolbar.isTranslucent = true toolbar.autoresizingMask = [.flexibleTopMargin, .flexibleWidth] @@ -643,7 +641,7 @@ func floorcgf(x: CGFloat) -> CGFloat { } // Set style - if !leaveStatusBarAlone && UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiom.phone { + if !leaveStatusBarAlone && UIDevice.current.userInterfaceIdiom == .phone { previousStatusBarStyle = UIApplication.shared.statusBarStyle UIApplication.shared.setStatusBarStyle(statusBarStyle, animated: animated) } @@ -728,7 +726,7 @@ func floorcgf(x: CGFloat) -> CGFloat { setControlsHidden(hidden: false, animated: false, permanent: true) // Status bar - if !leaveStatusBarAlone && UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiom.phone { + if !leaveStatusBarAlone && UIDevice.current.userInterfaceIdiom == .phone { UIApplication.shared.setStatusBarStyle(previousStatusBarStyle, animated: animated) } diff --git a/MediaBrowser/MediaBrowserDelegate.swift b/MediaBrowser/MediaBrowserDelegate.swift index 8c58aaf..4704308 100644 --- a/MediaBrowser/MediaBrowserDelegate.swift +++ b/MediaBrowser/MediaBrowserDelegate.swift @@ -9,8 +9,7 @@ import UIKit /// Required delegate to use MediaBrowser -@objc -public protocol MediaBrowserDelegate { +public protocol MediaBrowserDelegate: AnyObject { //MARK: Required methods /** diff --git a/MediaBrowser/MediaCaptionView.swift b/MediaBrowser/MediaCaptionView.swift index 8da550a..13ec471 100755 --- a/MediaBrowser/MediaCaptionView.swift +++ b/MediaBrowser/MediaCaptionView.swift @@ -70,10 +70,7 @@ public class MediaCaptionView: UIToolbar { tintColor = nil barTintColor = nil backgroundColor = UIColor.clear -// isOpaque = false -// isTranslucent = true -// clipsToBounds = true - barStyle = .blackTranslucent + barStyle = .black isTranslucent = true autoresizingMask = diff --git a/MediaBrowser/MediaTapDetectingImageView.swift b/MediaBrowser/MediaTapDetectingImageView.swift index 281af0c..3f01e53 100755 --- a/MediaBrowser/MediaTapDetectingImageView.swift +++ b/MediaBrowser/MediaTapDetectingImageView.swift @@ -7,7 +7,7 @@ // // -import Foundation +import UIKit class MediaTapDetectingImageView: UIImageView { weak var tapDelegate: TapDetectingImageViewDelegate? diff --git a/MediaBrowser/MediaTapDetectingView.swift b/MediaBrowser/MediaTapDetectingView.swift index 6a56014..9c3d7bb 100755 --- a/MediaBrowser/MediaTapDetectingView.swift +++ b/MediaBrowser/MediaTapDetectingView.swift @@ -7,7 +7,7 @@ // // -import Foundation +import UIKit class MediaTapDetectingView: UIView { weak var tapDelegate: TapDetectingViewDelegate? diff --git a/MediaBrowser/MediaZoomingScrollView.swift b/MediaBrowser/MediaZoomingScrollView.swift index 91c15b3..b4695b7 100755 --- a/MediaBrowser/MediaZoomingScrollView.swift +++ b/MediaBrowser/MediaZoomingScrollView.swift @@ -292,7 +292,7 @@ class MediaZoomingScrollView: UIScrollView, UIScrollViewDelegate, TapDetectingIm // Calculate Max var maxScale: CGFloat = 3.0 - if UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiom.pad { + if UIDevice.current.userInterfaceIdiom == .pad { // Let them go a bit bigger on a bigger screen! maxScale = 4.0 } diff --git a/MediaBrowser/UIImageExtension.swift b/MediaBrowser/UIImageExtension.swift index 636a0d4..666dd4d 100755 --- a/MediaBrowser/UIImageExtension.swift +++ b/MediaBrowser/UIImageExtension.swift @@ -7,7 +7,7 @@ // // -import Foundation +import UIKit public extension UIImage { /// Get bundle Image or return nil when it is not exist diff --git a/Package.swift b/Package.swift index 8ebc2e5..b0e97b2 100644 --- a/Package.swift +++ b/Package.swift @@ -1,5 +1,27 @@ +// swift-tools-version:5.5 +// The swift-tools-version declares the minimum version of Swift required to build this package. + import PackageDescription let package = Package( - name: "MediaBrowser" + name: "MediaBrowser", + platforms: [ + .iOS(.v13) + ], + products: [ + .library( + name: "MediaBrowser", + targets: ["MediaBrowser"]) + ], + dependencies: [ + .package(name: "SDWebImage", url: "https://github.com/SDWebImage/SDWebImage.git", .branch("master")), + .package(name: "UICircularProgressRing", url: "https://github.com/luispadron/UICircularProgressRing.git", from: "6.3.0") + ], + targets: [ + .target( + name: "MediaBrowser", + dependencies: ["SDWebImage", "UICircularProgressRing"], + path: "MediaBrowser" + ) + ] ) diff --git a/Podfile b/Podfile index d08c445..31fe40b 100644 --- a/Podfile +++ b/Podfile @@ -1,4 +1,4 @@ -platform :ios, '8.1' +platform :ios, '15.6' target 'MediaBrowser' do use_frameworks!