Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6851859
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T01:17:57+00:00 2026-05-27T01:17:57+00:00

I’ve been using the UIPageController template in Xcode to create an interactive book. In

  • 0

I’ve been using the UIPageController template in Xcode to create an interactive book.

In this app, every page plays a different audio file as soon as the page loads.

It works great when I tap one of the corners of the page (the audio from the first page stops and the audio from the second page starts, no observable overlap).

The problem occurs when I swipe my finger, dragging the page. Just like on iBooks, I can hold the page in the middle of the transition, seeing both pages, but that causes the audio from both pages to overlap.

Optimally, I would like for the audio from the first page to stop as soon as the transition begins and the audio from the second page to start as soon as the transition finishes (page curls reaches the end of the screen), but either one of these alone would give me a good result.

The thing is I can’t find the place to add the [audioFromPage stop] nor the [audioFromPage play] so that there’s no overlap.

I’ve tried to add these lines to setViewControllers:direction:animated:completion: method as well as to the viewControllerAfterViewController and viewControllerBeforeViewController methods, but none of them have worked.

Do you guys have any idea on how to solve this problem?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T01:17:58+00:00Added an answer on May 27, 2026 at 1:17 am

    I have had a similar situation in one of my apps.

    To start the audio only after a successful page turn (either direction) there is an optional method that can be added to whichever class is your the UIPageViewControllerDelegate:

    - (void)pageViewController:(UIPageViewController *)pageViewController didFinishAnimating:(BOOL)finished previousViewControllers:(NSArray *)previousViewControllers transitionCompleted:(BOOL)completed;

    Anytime this method is called, you could send the current [pageViewController.viewControllers objectAtIndex:0] a message to start playing it’s sound (it very much appears to me that you are presenting a single page at a time, so the NSArray viewControllers will always have a single element)

    Likewise, you could also send a similar message to the [previousViewcontrollers objectAtIndex:0] a message to stop playing its sound.

    This will switch the sound from one page to the next at the completion of a page turn, rather than the beginning, as you requested, but there is no analogous method for pageViewcontroller didBeginAnimating:

    the safest way to do this would be to define a protocol that includes your audioFromPage stop and start methods, and then make every viewController (the “pages” of your book) implement this protocol. That way the compiler will prevent you from accidentally creating a page that does not implement those method, and avoid a runtime crash.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

That's pretty much it. I'm using Nokogiri to scrape a web page what has
Basically, what I'm trying to create is a page of div tags, each has
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I am reading a book about Javascript and jQuery and using one of the
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build
I am using Paperclip to handle profile photo uploads in my app. They upload
I'm making a simple page using Google Maps API 3. My first. One marker
I have a jquery bug and I've been looking for hours now, I can't
link Im having trouble converting the html entites into html characters, (&# 8217;) i

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.