ObjecTips

Swift & Objective-C で iOS とか macOS とか

MPVolumeView

iPhone 本体の音量を変更する その2

koze.hatenablog.jp 前回は結局 Private API を使うとできるという話になってしまったので今回は正攻法で。 MPVolumeView を使う。 UIが提供されるのみで programmatically に設定はできない。 UIはこんな感じ。 分かりやすく以下のコードで border を描画し…

iPhone 本体の音量を変更する

iPhone 本体の音量を変更するには MPVolumeView と MPMusicPlayerController クラスを使う。 MPMusicPlayerController には アプリ内の音楽再生周りを制御するインスタンスを呼び出す + (MPMusicPlayerController *)applicationMusicPlayer; システムの音楽…