Add feature flag for image editor.

This commit is contained in:
Matthew Chen 2019-01-04 11:57:08 -05:00
parent 8d8469d1ca
commit 5e3de84fdc
2 changed files with 10 additions and 3 deletions

View file

@ -1,5 +1,5 @@
//
// Copyright (c) 2018 Open Whisper Systems. All rights reserved.
// Copyright (c) 2019 Open Whisper Systems. All rights reserved.
//
import Foundation
@ -68,7 +68,8 @@ class SignalAttachmentItem: Hashable {
// Try and make a ImageEditorModel.
// This will only apply for valid images.
if let dataUrl: URL = attachment.dataUrl,
if ImageEditorModel.isFeatureEnabled,
let dataUrl: URL = attachment.dataUrl,
dataUrl.isFileURL {
let path = dataUrl.path
do {

View file

@ -1,5 +1,5 @@
//
// Copyright (c) 2018 Open Whisper Systems. All rights reserved.
// Copyright (c) 2019 Open Whisper Systems. All rights reserved.
//
import UIKit
@ -354,6 +354,12 @@ public protocol ImageEditorModelDelegate: class {
@objc
public class ImageEditorModel: NSObject {
@objc
public static var isFeatureEnabled: Bool {
return _isDebugAssertConfiguration()
}
@objc
public weak var delegate: ImageEditorModelDelegate?