Skip to content

Commit

Permalink
Merge pull request #119 from tumblr/bjtitus/tumblr-fixes
Browse files Browse the repository at this point in the history
Fixes for Tumblr integration issues
  • Loading branch information
bjtitus authored Jul 1, 2021
2 parents c5e9c70 + 21d6f7e commit 7b03e71
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 9 deletions.
11 changes: 7 additions & 4 deletions Classes/Camera/CameraController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,9 @@ open class CameraController: UIViewController, MediaClipsEditorDelegate, CameraP
}()
private lazy var modeAndShootController: ModeSelectorAndShootController = {
let controller = ModeSelectorAndShootController(settings: self.settings)
controller.modeView.shootButton.trashView.completion = { [weak self] in
self?.clipsController.removeDraggingClip()
}
controller.delegate = self
return controller
}()
Expand Down Expand Up @@ -405,6 +408,9 @@ open class CameraController: UIViewController, MediaClipsEditorDelegate, CameraP
quickBlogSelectorCoordinator: quickBlogSelectorCoordinator,
edit: edit,
tagCollection: tagCollection)
controller.editorView.movableViewCanvas.trashCompletion = { [weak self] in
self?.clipsController.removeDraggingClip()
}
controller.delegate = self
return controller
}
Expand Down Expand Up @@ -855,10 +861,7 @@ open class CameraController: UIViewController, MediaClipsEditorDelegate, CameraP
}

func nextButtonWasPressed() {
if let lastSegment = cameraInputController.segments().last {
let segments = [lastSegment]
showPreviewWithSegments(segments, selected: segments.startIndex)
}
showPreviewWithSegments(cameraInputController.segments(), selected: segments.startIndex)
analyticsProvider?.logNextTapped()
}

Expand Down
2 changes: 1 addition & 1 deletion Classes/ModeSelector/ModeSelectorAndShootView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,11 @@ final class ModeSelectorAndShootView: IgnoreTouchesView, EasyTipViewDelegate {
}

private let settings: CameraSettings
private let shootButton: ShootButtonView
private let modeSelectorButton: ModeButtonView
private let mediaPickerButton: MediaPickerButtonView
private var modeSelectorTooltip: EasyTipView?
private var shutterButtonTooltip: EasyTipView?
let shootButton: ShootButtonView
let modeSelectorView: UIView


Expand Down
3 changes: 2 additions & 1 deletion Classes/ModeSelector/ShootButtonView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ private enum ShootButtonState {
final class ShootButtonView: IgnoreTouchesView, UIDropInteractionDelegate {

weak var delegate: ShootButtonViewDelegate?

let trashView: TrashView

private let containerView: UIView
private let imageView: UIImageView
Expand All @@ -76,7 +78,6 @@ final class ShootButtonView: IgnoreTouchesView, UIDropInteractionDelegate {
private let tapRecognizer: UITapGestureRecognizer
private let longPressRecognizer: UILongPressGestureRecognizer
private let borderView: UIView
private let trashView: TrashView
private let baseColor: UIColor

private var containerWidthConstraint: NSLayoutConstraint?
Expand Down
7 changes: 7 additions & 0 deletions Classes/Preview/CameraPreviewViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,13 @@ extension CameraPreviewViewController: CameraPreviewViewDelegate {
// then single photos from that mode should still export as video.
if settings.features.gifs,
let group = cameraMode?.group, group == .gif {
GIFEncoderImageIO().encode(video: videoURL, loopCount: 0, framesPerSecond: KanvasTimes.gifPreferredFramesPerSecond) { gifURL in
performUIUpdate {
self.delegate?.didFinishExportingFrames(url: gifURL)
self.hideLoading()
}
}
} else {
performUIUpdate {
self.delegate?.didFinishExportingVideo(url: videoURL)
self.hideLoading()
Expand Down
2 changes: 1 addition & 1 deletion Kanvas.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |spec|
spec.name = "Kanvas"
spec.version = "1.3.0"
spec.version = "1.3.1"
spec.summary = "A custom camera built for iOS."
spec.homepage = "https://github.com/tumblr/kanvas-ios"
spec.license = "MPLv2"
Expand Down
4 changes: 2 additions & 2 deletions KanvasExample/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ PODS:
- FBSnapshotTestCase/Core (2.1.4)
- FBSnapshotTestCase/SwiftSupport (2.1.4):
- FBSnapshotTestCase/Core
- Kanvas (1.2.8)
- Kanvas (1.3.1)

DEPENDENCIES:
- FBSnapshotTestCase (= 2.1.4)
Expand All @@ -20,7 +20,7 @@ EXTERNAL SOURCES:

SPEC CHECKSUMS:
FBSnapshotTestCase: 094f9f314decbabe373b87cc339bea235a63e07a
Kanvas: 9eab00cc89669b38858d42d5f30c810876b31344
Kanvas: faba43c849ca46b304f760ebbf993f0b94bc6a32

PODFILE CHECKSUM: 14b28dd726149c0d01dba9154d5bb095d9ba6a18

Expand Down

0 comments on commit 7b03e71

Please sign in to comment.