Skip to content
This repository has been archived by the owner on Mar 29, 2021. It is now read-only.

Autolayout fix for RecorderViewController #6

Open
bawarkamalqader opened this issue Apr 1, 2019 · 1 comment
Open

Autolayout fix for RecorderViewController #6

bawarkamalqader opened this issue Apr 1, 2019 · 1 comment

Comments

@bawarkamalqader
Copy link

bawarkamalqader commented Apr 1, 2019

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))

@HassanElDesouky
Copy link
Owner

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants