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

  • Home
  • SEARCH
  • 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 7993785
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T13:57:21+00:00 2026-06-04T13:57:21+00:00

I’m using plain English here. I’ve got this great app with multiple tabs and

  • 0

I’m using plain English here. I’ve got this great app with multiple tabs and each tab (subclasses of UIViewController) has stuff on it. One of the tabs has a button inside (among other things) and has a lot of functionality.
The button is pretty (subclass of UIGlossyButton I found on the net) and shows a microphone
If you press the button it (the tab) records your voice and stops automatically (by detecting volume levels/a timeout)

  • While recording, the tab controller shows a LED meter on top of the button
  • After recording, the button is swapped out with anthor button showing a speaker
  • Tapping the speaker plays back your voice
  • Swiping across the speaker lets you “delete” which resets back to the microphone

This “widget” is great and I love it. Now I want to put this thing inside other tabs and whatnot across the app. This looks like a candidate for abstraction rather than copy/paste.

What’s killing me is: should I package all this functionality (logic to show/hide/swap buttons, record sound, analyze sound levels) together into a widget? If so, how many classes should I use and which classes should each subclass? And lastly, in Interface Builder which object should I drag onto my storyboard inside the tab and which of my classes should I type into the “Custom Class” box.

  • 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-06-04T13:57:23+00:00Added an answer on June 4, 2026 at 1:57 pm

    Sounds like a lot for a single UIView subclass to do. I would absolutely split this up over a series of classes, or at least between the an extended UIGlossyButton and an associated UIViewController.

    The button’s responsibility should be: able to draw itself, know when it’s pressed and do minimal logic about what to do when action is taken on it (like send a message to a UIViewController).

    Think of the button itself as the View of MVC. The Controller will then actually know what to do for all the smarts behind actually the action of the UI. Then things like the sound meter, or the voice file, optionally should be represented as model objects/classes. Sometimes I find it in iOS that creating explicit Model classes is overkill so I just use normal Cocoa classes like NSDictionary with polymorphism to handle the model stuff from the controller.

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

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
We're building an app, our first using Rails 3, and we're having to build
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I am using Paperclip to handle profile photo uploads in my app. They upload
I am writing an app with both english and french support. The app requests
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
That's pretty much it. I'm using Nokogiri to scrape a web page what has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
I am reading a book about Javascript and jQuery and using one of the

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.