Skip to content

Commit c5e9c70

Browse files
authored
Merge pull request #118 from tumblr/fix/tumblr-compatibility-changes
Tumblr compatibility changes
2 parents 5b0cb98 + a1bdff6 commit c5e9c70

File tree

7 files changed

+22
-16
lines changed

7 files changed

+22
-16
lines changed

Classes/Analytics/KanvasAnalyticsProvider.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public enum KanvasColorSelectionTool: Int {
3737
}
3838
}
3939

40-
@objc public enum KanvasDrawingAction: Int {
40+
public enum KanvasDrawingAction: Int {
4141
case tap, fill, stroke
4242

4343
public func string() -> String {

Classes/Camera/CameraController.swift

+10
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,16 @@ public struct KanvasMedia {
5050
type: .image
5151
)
5252
}
53+
54+
public init(type: MediaType, url: URL, info: MediaInfo, size: CGSize) {
55+
self.init(unmodified: nil,
56+
output: url,
57+
info: info,
58+
size: size,
59+
archive: nil,
60+
type: type
61+
)
62+
}
5363
}
5464

5565
public enum MediaType {

Classes/Editor/EditorViewController.swift

+1
Original file line numberDiff line numberDiff line change
@@ -1219,6 +1219,7 @@ public final class EditorViewController: UIViewController, MediaPlayerController
12191219

12201220
func onPostingOptionsDismissed() {
12211221
startPlayerFromSegments()
1222+
hideLoading()
12221223
}
12231224

12241225
func onQuickPostButtonSubmitted() {

Classes/Extensions/UIColor+Hex.swift

+1-13
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import Foundation
88
import UIKit
99

10-
public extension UIColor {
10+
extension UIColor {
1111

1212
/**
1313
Create UIColor from the given hex value
@@ -57,16 +57,4 @@ public extension UIColor {
5757
alpha: alpha
5858
)
5959
}
60-
61-
/**
62-
Create UIColor from the given hex Integer
63-
64-
- parameter hex: Int value to be converted to UIColor
65-
- note: Method is used to bridge objc without a large multi file rewrite
66-
*/
67-
@objc(colorWithHex:)
68-
static func color(hex: UInt) -> UIColor {
69-
return UIColor(hex: UInt32(hex))
70-
}
71-
7260
}

Kanvas.podspec

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |spec|
22
spec.name = "Kanvas"
3-
spec.version = "1.2.8"
3+
spec.version = "1.3.0"
44
spec.summary = "A custom camera built for iOS."
55
spec.homepage = "https://github.com/tumblr/kanvas-ios"
66
spec.license = "MPLv2"

KanvasExample/KanvasExample.xcodeproj/project.pbxproj

+7-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
archiveVersion = 1;
44
classes = {
55
};
6-
objectVersion = 50;
6+
objectVersion = 51;
77
objects = {
88

99
/* Begin PBXBuildFile section */
@@ -211,6 +211,8 @@
211211
F597B4E824B3E66700843540 /* KanvasCustomUI.swift in Sources */ = {isa = PBXBuildFile; fileRef = F597B4E624B3E66500843540 /* KanvasCustomUI.swift */; };
212212
F597B50924B4FAD100843540 /* KanvasFontsTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F597B50824B4FAD100843540 /* KanvasFontsTests.swift */; };
213213
F597B50B24B5017B00843540 /* MediaInfoTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F597B50A24B5017B00843540 /* MediaInfoTests.swift */; };
214+
F5C0D31B267B19D200431C75 /* UIColor+Hex.swift in Sources */ = {isa = PBXBuildFile; fileRef = F5C0D31A267B19D200431C75 /* UIColor+Hex.swift */; };
215+
F5C0D31E267B1A0F00431C75 /* UIColor+Hex.swift in Sources */ = {isa = PBXBuildFile; fileRef = F5C0D31A267B19D200431C75 /* UIColor+Hex.swift */; };
214216
F5E448CA24B8E23000403A7C /* KanvasCustomUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F5E448C924B8E23000403A7C /* KanvasCustomUITests.swift */; };
215217
/* End PBXBuildFile section */
216218

@@ -430,6 +432,7 @@
430432
F597B4E624B3E66500843540 /* KanvasCustomUI.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = KanvasCustomUI.swift; sourceTree = "<group>"; };
431433
F597B50824B4FAD100843540 /* KanvasFontsTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KanvasFontsTests.swift; sourceTree = "<group>"; };
432434
F597B50A24B5017B00843540 /* MediaInfoTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MediaInfoTests.swift; sourceTree = "<group>"; };
435+
F5C0D31A267B19D200431C75 /* UIColor+Hex.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = "UIColor+Hex.swift"; path = "../../Classes/Extensions/UIColor+Hex.swift"; sourceTree = "<group>"; };
433436
F5E448C924B8E23000403A7C /* KanvasCustomUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KanvasCustomUITests.swift; sourceTree = "<group>"; };
434437
/* End PBXFileReference section */
435438

@@ -967,6 +970,7 @@
967970
76A50BEB22FCB65D00D314AF /* ExampleKanvasDashboardController.swift */,
968971
655163A02396E63F0043C01A /* Stickers */,
969972
F597B4E024B3E57300843540 /* UIColor+Colors.swift */,
973+
F5C0D31A267B19D200431C75 /* UIColor+Hex.swift */,
970974
F597B4E324B3E63200843540 /* UIFont+Fonts.swift */,
971975
);
972976
path = KanvasExample;
@@ -1298,6 +1302,7 @@
12981302
0EAE0CB92139EC85004CD7FF /* KanvasAnalyticsStub.swift in Sources */,
12991303
F597B4E724B3E66500843540 /* KanvasCustomUI.swift in Sources */,
13001304
F597B4E124B3E57300843540 /* UIColor+Colors.swift in Sources */,
1305+
F5C0D31B267B19D200431C75 /* UIColor+Hex.swift in Sources */,
13011306
76FFF24822DCD991000A0D04 /* FeatureTableView.swift in Sources */,
13021307
655163A22396E6AC0043C01A /* ExperimentalStickerProvider.swift in Sources */,
13031308
F597B4E424B3E63300843540 /* UIFont+Fonts.swift in Sources */,
@@ -1343,6 +1348,7 @@
13431348
65303C37253FC31D0045E18F /* StyleMenuControllerTests.swift in Sources */,
13441349
0EBE144E2123727800E9D0C8 /* CameraSettingsTests.swift in Sources */,
13451350
654AE16222E8B8DD00C8C0E4 /* StrokeSelectorViewTests.swift in Sources */,
1351+
F5C0D31E267B1A0F00431C75 /* UIColor+Hex.swift in Sources */,
13461352
ABE49906213712E100379F7F /* OptionsControllerTests.swift in Sources */,
13471353
658A329B239FFD9B00EEC1D3 /* StickerMenuControllerTests.swift in Sources */,
13481354
76BC5BAE220CCFF2007A9289 /* Array+MoveTests.swift in Sources */,

KanvasExample/KanvasExample/UIColor+Colors.swift

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
//
66

77
import UIKit
8+
import Kanvas
89

910
extension UIColor {
1011

0 commit comments

Comments
 (0)