Skip to content

Commit 494c1a1

Browse files
author
Ruben Nine
committed
Removing Objc-C support in Transform classes.
1 parent 6b6a090 commit 494c1a1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+233
-292
lines changed

Sources/FilestackSDK/Public/Models/Transformable.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import Foundation
1212
///
1313
/// See [Image Transformations Overview](https://www.filestack.com/docs/image-transformations) for more information
1414
/// about image transformations.
15-
@objc(FSTransformable)
1615
public class Transformable: NSObject {
1716
// MARK: - Public Properties
1817

@@ -88,7 +87,6 @@ public extension Transformable {
8887
/// Adds a new transformation to the transformation chain.
8988
///
9089
/// - Parameter transform: The `Transform` to add.
91-
@objc(add:)
9290
@discardableResult
9391
func add(transform: Transform) -> Self {
9492
transformationTasks.append(transform.task)

Sources/FilestackSDK/Public/Transforms/ASCIITransform.swift

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,11 @@ import Foundation
1010
import UIKit
1111

1212
/// Converts the image to black and white.
13-
@objc(FSASCIITransform)
1413
public class ASCIITransform: Transform {
1514
// MARK: - Lifecycle
1615

1716
/// Initializes an `ASCIITransform` object.
18-
@objc public init() {
17+
public init() {
1918
super.init(name: "ascii")
2019
}
2120
}
@@ -27,23 +26,23 @@ public extension ASCIITransform {
2726
///
2827
/// - Parameter value: Sets the background color to display behind the image.
2928
@discardableResult
30-
@objc func background(_ value: UIColor) -> Self {
29+
func background(_ value: UIColor) -> Self {
3130
return appending(key: "background", value: value.hexString)
3231
}
3332

3433
/// Adds the `foreground` option.
3534
///
3635
/// - Parameter value: Sets the foreground color to display behind the image.
3736
@discardableResult
38-
@objc func foreground(_ value: UIColor) -> Self {
37+
func foreground(_ value: UIColor) -> Self {
3938
return appending(key: "foreground", value: value.hexString)
4039
}
4140

4241
/// Adds the `colored` option.
4342
///
4443
/// Sets output as colored.
4544
@discardableResult
46-
@objc func colored() -> Self {
45+
func colored() -> Self {
4746
return appending(key: "colored", value: true)
4847
}
4948

@@ -52,13 +51,13 @@ public extension ASCIITransform {
5251
/// - Parameter value: The size of the overlayed image as a percentage of its original size.
5352
/// Valid range: `10...100`
5453
@discardableResult
55-
@objc func size(_ value: Int) -> Self {
54+
func size(_ value: Int) -> Self {
5655
return appending(key: "size", value: value)
5756
}
5857

5958
/// Reverses the character set used to generate the ASCII output. Works well with dark backgrounds.
6059
@discardableResult
61-
@objc func reverse() -> Self {
60+
func reverse() -> Self {
6261
return colored().appending(key: "reverse", value: true)
6362
}
6463
}

Sources/FilestackSDK/Public/Transforms/AVTransform.swift

Lines changed: 30 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,11 @@
99
import Foundation
1010

1111
/// Converts a video or audio to a different format, resolution, sample rate, etc.
12-
@objc(FSAVTransform)
1312
public class AVTransform: Transform {
1413
// MARK: - Lifecycle
1514

1615
/// Initializes an `AVTransform` object.
17-
@objc public init() {
16+
public init() {
1817
super.init(name: "video_convert")
1918
}
2019
}
@@ -28,7 +27,7 @@ public extension AVTransform {
2827
/// See (File Processing - Video Conversion)[https://www.filestack.com/docs/video-transformations]
2928
/// for more information about supported presets.
3029
@discardableResult
31-
@objc func preset(_ value: String) -> Self {
30+
func preset(_ value: String) -> Self {
3231
return appending(key: "preset", value: value)
3332
}
3433

@@ -37,55 +36,55 @@ public extension AVTransform {
3736
/// - Parameter value: Restarts completed or pending video encoding. If a transcoding fails, and you make the same
3837
/// request again, it will not restart the transcoding process unless this parameter is set to `true`.
3938
@discardableResult
40-
@objc func force(_ value: Bool) -> Self {
39+
func force(_ value: Bool) -> Self {
4140
return appending(key: "force", value: value)
4241
}
4342

4443
/// Adds the `width` option.
4544
///
4645
/// - Parameter value: Set the width in pixels of the video that is generated by the transcoding process.
4746
@discardableResult
48-
@objc func width(_ value: Int) -> Self {
47+
func width(_ value: Int) -> Self {
4948
return appending(key: "width", value: value)
5049
}
5150

5251
/// Adds the `height` option.
5352
///
5453
/// - Parameter value: Set the height in pixels of the video that is generated by the transcoding process.
5554
@discardableResult
56-
@objc func height(_ value: Int) -> Self {
55+
func height(_ value: Int) -> Self {
5756
return appending(key: "height", value: value)
5857
}
5958

6059
/// Adds the `title` option.
6160
///
6261
/// - Parameter value: Set the title in the file metadata.
6362
@discardableResult
64-
@objc func title(_ value: String) -> Self {
63+
func title(_ value: String) -> Self {
6564
return appending(key: "title", value: value)
6665
}
6766

6867
/// Adds the `extName` option.
6968
///
7069
/// - Parameter value: Set the file extension for the video that is generated by the transcoding process.
7170
@discardableResult
72-
@objc func extName(_ value: String) -> Self {
71+
func extName(_ value: String) -> Self {
7372
return appending(key: "extname", value: value)
7473
}
7574

7675
/// Adds the `fileName` option.
7776
///
7877
/// - Parameter value: Set the filename of the video that is generated by the transcoding process.
7978
@discardableResult
80-
@objc func fileName(_ value: String) -> Self {
79+
func fileName(_ value: String) -> Self {
8180
return appending(key: "filename", value: value)
8281
}
8382

8483
/// Adds the `location` option.
8584
///
8685
/// - Parameter value: An `StorageLocation` value.
8786
@discardableResult
88-
@objc func location(_ value: StorageLocation) -> Self {
87+
func location(_ value: StorageLocation) -> Self {
8988
return appending(key: "location", value: value)
9089
}
9190

@@ -95,15 +94,15 @@ public extension AVTransform {
9594
/// For S3, this is the key where the file will be stored at. By default, Filestack stores the file at the root at
9695
/// a unique id, followed by an underscore, followed by the filename, for example: `3AB239102DB_myvideo.mp4`.
9796
@discardableResult
98-
@objc func path(_ value: String) -> Self {
97+
func path(_ value: String) -> Self {
9998
return appending(key: "path", value: value)
10099
}
101100

102101
/// Adds the `access` option.
103102
///
104103
/// - Parameter value: An `StorageAccess` value.
105104
@discardableResult
106-
@objc func access(_ value: StorageAccess) -> Self {
105+
func access(_ value: StorageAccess) -> Self {
107106
return appending(key: "access", value: value)
108107
}
109108

@@ -112,23 +111,23 @@ public extension AVTransform {
112111
/// - Parameter value: The bucket or container in the specified file store where the file
113112
/// should end up.
114113
@discardableResult
115-
@objc func container(_ value: String) -> Self {
114+
func container(_ value: String) -> Self {
116115
return appending(key: "container", value: value)
117116
}
118117

119118
/// Adds the `upscale` option.
120119
///
121120
/// - Parameter value: Upscale the video resolution to match your profile. Defaults to `true`.
122121
@discardableResult
123-
@objc func upscale(_ value: Bool) -> Self {
122+
func upscale(_ value: Bool) -> Self {
124123
return appending(key: "upscale", value: value)
125124
}
126125

127126
/// Adds the `aspectMode` option.
128127
///
129128
/// - Parameter value: An `TransformAspectMode` value.
130129
@discardableResult
131-
@objc func aspectMode(_ value: TransformAspectMode) -> Self {
130+
func aspectMode(_ value: TransformAspectMode) -> Self {
132131
return appending(key: "aspect_mode", value: value)
133132
}
134133

@@ -137,7 +136,7 @@ public extension AVTransform {
137136
/// - Parameter value: Specify that the transcoding process should do two passes to improve video quality.
138137
/// Defaults to `false`.
139138
@discardableResult
140-
@objc func twoPass(_ value: Bool) -> Self {
139+
func twoPass(_ value: Bool) -> Self {
141140
return appending(key: "two_pass", value: value)
142141
}
143142

@@ -146,7 +145,7 @@ public extension AVTransform {
146145
/// - Parameter value: Specify the video bitrate for the video that is generated by the transcoding process.
147146
/// Valid range: `1...5000`
148147
@discardableResult
149-
@objc func videoBitRate(_ value: Int) -> Self {
148+
func videoBitRate(_ value: Int) -> Self {
150149
return appending(key: "video_bitrate", value: value)
151150
}
152151

@@ -155,7 +154,7 @@ public extension AVTransform {
155154
/// - Parameter value: Specify the frames per second of the video that is generated by the transcoding process.
156155
/// Valid range: `1...300`. If ommited, uses the original fps of the source file.
157156
@discardableResult
158-
@objc func fps(_ value: Int) -> Self {
157+
func fps(_ value: Int) -> Self {
159158
return appending(key: "fps", value: value)
160159
}
161160

@@ -164,7 +163,7 @@ public extension AVTransform {
164163
/// - Parameter value: Adds a key frame every `keyframeInterval` frames to the video that is generated by the
165164
/// transcoding process. Default is `250`.
166165
@discardableResult
167-
@objc func keyframeInterval(_ value: Int) -> Self {
166+
func keyframeInterval(_ value: Int) -> Self {
168167
return appending(key: "keyframe_interval", value: value)
169168
}
170169

@@ -173,7 +172,7 @@ public extension AVTransform {
173172
/// - Parameter value: Sets the audio bitrate for the video that is generated by the transcoding process.
174173
/// Valid range: `0...999`
175174
@discardableResult
176-
@objc func audioBitRate(_ value: Int) -> Self {
175+
func audioBitRate(_ value: Int) -> Self {
177176
return appending(key: "audio_bitrate", value: value)
178177
}
179178

@@ -182,7 +181,7 @@ public extension AVTransform {
182181
/// - Parameter value: Set the audio sample rate for the video that is generated by the transcoding process.
183182
/// Valid range: `0...99999`. Default is `44100`.
184183
@discardableResult
185-
@objc func audioSampleRate(_ value: Int) -> Self {
184+
func audioSampleRate(_ value: Int) -> Self {
186185
return appending(key: "audio_samplerate", value: value)
187186
}
188187

@@ -191,7 +190,7 @@ public extension AVTransform {
191190
/// - Parameter value: Set the number of audio channels for the video that is generated by the transcoding process.
192191
/// Valid range: `1...12`. Default is same as source video.
193192
@discardableResult
194-
@objc func audioChannels(_ value: Int) -> Self {
193+
func audioChannels(_ value: Int) -> Self {
195194
return appending(key: "audio_channels", value: value)
196195
}
197196

@@ -200,7 +199,7 @@ public extension AVTransform {
200199
/// - Parameter value: Set the length of the video that is generated by the transcoding process. Valid format
201200
/// should include hours, minutes and seconds.
202201
@discardableResult
203-
@objc func clipLength(_ value: String) -> Self {
202+
func clipLength(_ value: String) -> Self {
204203
return appending(key: "clip_length", value: value)
205204
}
206205

@@ -210,15 +209,15 @@ public extension AVTransform {
210209
/// will start the video transcode 10 seconds into the source video. Valid format should include hours, minutes
211210
/// and seconds.
212211
@discardableResult
213-
@objc func clipOffset(_ value: String) -> Self {
212+
func clipOffset(_ value: String) -> Self {
214213
return appending(key: "clip_offset", value: value)
215214
}
216215

217216
/// Adds the `watermarkURL` option.
218217
///
219218
/// - Parameter value: The Filestack handle or URL of the image file to use as a watermark on the transcoded video.
220219
@discardableResult
221-
@objc func watermarkURL(_ value: URL) -> Self {
220+
func watermarkURL(_ value: URL) -> Self {
222221
return appending(key: "watermark_url", value: value)
223222
}
224223

@@ -227,7 +226,7 @@ public extension AVTransform {
227226
/// - Parameter value: The distance from the top of the video frame to place the watermark on the video.
228227
/// Valid range: `0...9999`
229228
@discardableResult
230-
@objc func watermarkTop(_ value: Int) -> Self {
229+
func watermarkTop(_ value: Int) -> Self {
231230
return appending(key: "watermark_top", value: value)
232231
}
233232

@@ -236,7 +235,7 @@ public extension AVTransform {
236235
/// - Parameter value: The distance from the bottom of the video frame to place the watermark on the video.
237236
/// Valid range: `0...9999`
238237
@discardableResult
239-
@objc func watermarkBottom(_ value: Int) -> Self {
238+
func watermarkBottom(_ value: Int) -> Self {
240239
return appending(key: "watermark_bottom", value: value)
241240
}
242241

@@ -245,7 +244,7 @@ public extension AVTransform {
245244
/// - Parameter value: The distance from the left of the video frame to place the watermark on the video.
246245
/// Valid range: `0...9999`
247246
@discardableResult
248-
@objc func watermarkLeft(_ value: Int) -> Self {
247+
func watermarkLeft(_ value: Int) -> Self {
249248
return appending(key: "watermark_left", value: value)
250249
}
251250

@@ -254,23 +253,23 @@ public extension AVTransform {
254253
/// - Parameter value: The distance from the right of the video frame to place the watermark on the video.
255254
/// Valid range: `0...9999`
256255
@discardableResult
257-
@objc func watermarkRight(_ value: Int) -> Self {
256+
func watermarkRight(_ value: Int) -> Self {
258257
return appending(key: "watermark_right", value: value)
259258
}
260259

261260
/// Adds the `watermarkWidth` option.
262261
///
263262
/// - Parameter value: Resize the width of the watermark.
264263
@discardableResult
265-
@objc func watermarkWidth(_ value: Int) -> Self {
264+
func watermarkWidth(_ value: Int) -> Self {
266265
return appending(key: "watermark_width", value: value)
267266
}
268267

269268
/// Adds the `watermarkHeight` option.
270269
///
271270
/// - Parameter value: Resize the height of the watermark.
272271
@discardableResult
273-
@objc func watermarkHeight(_ value: Int) -> Self {
272+
func watermarkHeight(_ value: Int) -> Self {
274273
return appending(key: "watermark_height", value: value)
275274
}
276275
}

0 commit comments

Comments
 (0)