VoiceMemosClone
VoiceMemosClone copied to clipboard
Autolayout fix for RecorderViewController
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))
Thanks, You can fork the repo and when you are done you submit a PR.