Skip to content

Commit

Permalink
Merge pull request mikaoj#311 from michafaw/improvement/ObjcAccessToC…
Browse files Browse the repository at this point in the history
…lasses

 Improve Objc access in controller, settings, and gradient view
  • Loading branch information
mikaoj authored Nov 17, 2020
2 parents db9bd79 + 391658f commit 10bccd9
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
1 change: 1 addition & 0 deletions Sources/Controller/ImagePickerController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import UIKit
import Photos

// MARK: ImagePickerController
@objc(BSImagePickerController)
@objcMembers open class ImagePickerController: UINavigationController {
// MARK: Public properties
public weak var imagePickerDelegate: ImagePickerControllerDelegate?
Expand Down
17 changes: 11 additions & 6 deletions Sources/Model/Settings.swift
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,9 @@ import Photos
NSAttributedString.Key.foregroundColor: UIColor.systemPrimaryTextColor
]
}

public class Selection : NSObject {

@objc(BSImagePickerSelection)
@objcMembers public class Selection : NSObject {
/// Max number of selections allowed
public lazy var max: Int = Int.max

Expand All @@ -76,7 +77,8 @@ import Photos
@objc public lazy var unselectOnReachingMax : Bool = false
}

public class List : NSObject {
@objc(BSImagePickerList)
@objcMembers public class List : NSObject {
/// How much spacing between cells
public lazy var spacing: CGFloat = 2

Expand All @@ -100,8 +102,10 @@ import Photos
public lazy var enabled: Bool = true
}

public class Fetch : NSObject {
public class Album : NSObject {
@objc(BSImagePickerFetch)
@objcMembers public class Fetch : NSObject {
@objc(BSImagePickerAlbum)
@objcMembers public class Album : NSObject {
/// Fetch options for albums/collections
public lazy var options: PHFetchOptions = {
let fetchOptions = PHFetchOptions()
Expand All @@ -120,7 +124,8 @@ import Photos
]
}

public class Assets : NSObject {
@objc(BSImagePickerAssets)
@objcMembers public class Assets : NSObject {
/// Fetch options for assets

/// Simple wrapper around PHAssetMediaType to ensure we only expose the supported types.
Expand Down
1 change: 1 addition & 0 deletions Sources/Scene/Assets/GradientView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import Foundation
import UIKit

@objc(BSImagePickerGradientView)
class GradientView: UIView {
override class var layerClass: AnyClass {
return CAGradientLayer.self
Expand Down

0 comments on commit 10bccd9

Please sign in to comment.