VoiceMemosClone icon indicating copy to clipboard operation
VoiceMemosClone copied to clipboard

Autolayout fix for RecorderViewController

Open bawarkamalqader opened this issue 5 years ago • 1 comments

I found a solution for the autolayout fix needed in RecorderViewController.

First change the setupAudioView() function in RecorderViewController.swift

fileprivate func setupAudioView() { view.addSubview(audioView) audioView.translatesAutoresizingMaskIntoConstraints = false audioView.leadingAnchor.constraint(equalTo: view.layoutMarginsGuide.leadingAnchor).isActive = true audioView.trailingAnchor.constraint(equalTo: view.layoutMarginsGuide.trailingAnchor).isActive = true audioView.centerXAnchor.constraint(equalTo: view.layoutMarginsGuide.centerXAnchor).isActive = true audioView.heightAnchor.constraint(equalToConstant: 140).isActive = true audioView.alpha = 0 audioView.isHidden = true }

then in AudioVisualizerView.swift, one more thing should be done, change the waveforms array like this;

var waveforms: [Int] = Array(repeating: 0, count: Int(UIScreen.main.bounds.width/3))

bawarkamalqader avatar Apr 01 '19 03:04 bawarkamalqader

Thanks, You can fork the repo and when you are done you submit a PR.

HassanElDesouky avatar Apr 01 '19 19:04 HassanElDesouky