Jump to content

Changing UISwitch Colours in Preference Bundles


Joka

18 posts in this topic

Recommended Posts

Updated

I know Preference Bundles are pretty dead to use in 2019 but they're useful for tweak developers or those that prefer them over mod menu's

I only just learnt how to do this, but in order to change a UISwitch color (when enabled - default is green), you need to edit 2 files within your Preference Bundle.

The first file to edit is the tweak.mm. This file is located at /private/var/mobile/tweakproject/tweakproject/.

Open the file and paste this at the top of it:

@interface PSSwitchTableCell : PSControlTableCell
- (id)initWithStyle:(int)style reuseIdentifier:(id)identifier specifier:(id)specifier;
@end
 
@interface SRSwitchTableCell : PSSwitchTableCell
@end
 
@implementation SRSwitchTableCell
 
-(id)initWithStyle:(int)style reuseIdentifier:(id)identifier specifier:(id)specifier {
 
    self = [super initWithStyle:style reuseIdentifier:identifier specifier:specifier];
   
if (self) {
        [((UISwitch *)[self control]) setOnTintColor:[UIColor blackColor]]; // Change the colour of the ON state UISwitch here
 
    }
    return self;
}
 
@end

So you should have something like this:

Ev9wVOP.png

Next, open up the tweakproject.xm file which is located at /private/var/mobile/hidephonetabs/hidephonetabs/Resources. (The "tweakproject.xm" file will be called whateveryounamedtheproject.xm basically,  in case you get confused.)

Open it up and you'll see something like this:

uWmwAcz.png

All you need to do is add this code to the top of each PSSwitchCell you have in your .xm file:

<key>cellClass</key> 
<string>SRSwitchTableCell</string>

So it should look something like this:

FoEOGUW.png

Compile the project and go test!

Results:

RaHQP4O.png

 

More information:

If you would like to use custom hex colours instead, go to https://www.uicolor.xyz/, type in the hex colour you'd like to use and then copy and paste the Objective-C code in the UIColor box.

You can also customise the actual button of the UISwitch and the border of the switch itself by adding either of these below the [((UISwitch *)[self control]):

[((UISwitch *)[self control]) setThumbTintColor:[UIColor colorWithRed:0.11 green:0.22 blue:0.20 alpha:1.0]]; // Change the colour of the circle UISwitch button 
[((UISwitch *)[self control]) setTintColor:[UIColor colorWithRed:0.56 green:0.00 blue:0.00 alpha:1.0]]; // Change the colour of the border of the UISwitch

 

Posted
Just now, Joey said:

can’t you just use the existing framework for this

UIKit?

Posted
Just now, Joey said:

no there’s some framework for creating colorized patcher

Ah no idea. If you find it, PM me.

Posted

Added information on how to add custom hex colours to a UISwitch.

More information added on how to change the colour of the UISwitch button and the UISwitch border.

Posted
On 3/29/2019 at 12:27 AM, Joka said:

Added information on how to add custom hex colours to a UISwitch.

More information added on how to change the colour of the UISwitch button and the UISwitch border.

Thanks dad!  :)

Archived

This topic is now archived and is closed to further replies.

  • Our picks

    • NFL Rivals 26 Mobile Football v3.3.0 [ +3 Cheats ] AI Stupid
      Modded/Hacked App: NFL Rivals - Football Game By Mythical, Inc.
      Bundle ID: com.mythical.superteam
      iTunes Store Link: https://apps.apple.com/us/app/nfl-rivals-football-game/id1640028998?uo=4


      Hack Features:
      - AI ON Your Team 
      - Tackle 
      - No Interceptions
        • Thanks
      • 68 replies
    • NFL Rivals 26 Mobile Football v3.3.0 [ +3 Jailed ] AI Stupid
      Modded/Hacked App: NFL Rivals - Football Game By Mythical, Inc.
      Bundle ID: com.mythical.superteam
      iTunes Store Link: https://apps.apple.com/us/app/nfl-rivals-football-game/id1640028998?uo=4


      Hack Features:

      - AI ON Your Team 
      - Tackle No
      - No Interceptions
      • 88 replies
    • Merge Cruise: Mystery Puzzle v0.37.110 [ +2 Cheats ] Currency Max
      Modded/Hacked App: Merge Cruise: Mystery Puzzle By STUDIO PEERPLAY GAMES LTD
      Bundle ID: com.peerplay.megamerge
      iTunes Store Link: https://apps.apple.com/us/app/merge-cruise-mystery-puzzle/id6459056553?uo=4
       

      🤩 Hack Features

      - Cash
      - Energy

      • 35 replies
    • Merge Cruise: Mystery Puzzle v0.37.110 [ +2 Jailed ] Currency Max
      Modded/Hacked App: Merge Cruise: Mystery Puzzle By STUDIO PEERPLAY GAMES LTD
      Bundle ID: com.peerplay.megamerge
      iTunes Store Link: https://apps.apple.com/us/app/merge-cruise-mystery-puzzle/id6459056553?uo=4
       

      🤩 Hack Features

      - Cash
      - Energy

      • 37 replies
    • Disney Solitaire v1.8.0 [ +7 Cheats ] Auto Win
      Modded/Hacked App: Disney Solitaire By SuperPlay LTD
      Bundle ID: com.superplaystudios.disneysolitairedreams
      iTunes Store Link: https://apps.apple.com/ph/app/disney-solitaire/id6475757306?uo=4
       

      🤩 Hack Features

      - Coins [ Win Match ]

      - Task [ No Need Star ]

      - Stars

      - Undo

      - Wild Card

      - Free Ticket

      - Auto Win
      • 36 replies
    • Disney Solitaire v1.8.0 [ +7 Jailed ] Auto Win
      Modded/Hacked App: Disney Solitaire By SuperPlay LTD
      Bundle ID: com.superplaystudios.disneysolitairedreams
      iTunes Store Link: https://apps.apple.com/ph/app/disney-solitaire/id6475757306?uo=4


      🤩 Hack Features

      - Coins [ Win Match ]

      - Task [ No Need Star ]

      - Stars

      - Undo

      - Wild Card

      - Free Ticket

      - Auto Win
        • Agree
      • 45 replies
    • Royal Adventure : Big World v1.0.054 [ +5 Cheats ] Auto Win
      Modded/Hacked App: Royal Adventure : Big World By KOOFEI LIMITED
      Bundle ID: com.koofei.matchmansion
      iTunes Store Link: https://apps.apple.com/us/app/royal-adventure-big-world/id6504521957?uo=4


      🤩 Hack Features

      - Coins

      - Stars

      - Booster

      - Lives

      - Auto Win


      🍏 For Non-Jailbroken & No Jailbreak required hacks: https://iosgods.com/forum/79-no-jailbreak-section/
      🤖 Modded Android APKs: https://iosgods.com/forum/68-android-section/
      • 23 replies
    • Royal Adventure : Big World v1.0.054 [ +5 Jailed ] Auto Win
      Modded/Hacked App: Royal Adventure : Big World By KOOFEI LIMITED
      Bundle ID: com.koofei.matchmansion
      iTunes Store Link: https://apps.apple.com/us/app/royal-adventure-big-world/id6504521957?uo=4

       

      🤩 Hack Features

      - Coins

      - Stars

      - Booster

      - Lives

      - Auto Win


      🍏 Jailbreak iOS hacks: https://iosgods.com/forum/5-game-cheats-hack-requests/
      🤖 Modded Android APKs: https://iosgods.com/forum/68-android-section/
      • 30 replies
    • Merge Sports: City Builder v1.3.1 [ +5 Cheats ] Currency Max
      Modded/Hacked App: Merge Sports: Team Manager By PIXO GAMES LDA
      Bundle ID: com.pixodust.games.merge.sports.puzzle.game
      App Store Link: https://apps.apple.com/us/app/merge-sports-team-manager/id6736916280?uo=4

       

      🤩 Hack Features

      - Gems

      - Coins

      - Energy

      - ViP Active

      - ViP Claim Unlimited
      • 4 replies
    • Merge Sports: City Builder v1.3.1 [ +5 Jailed ] Currency Max
      Modded/Hacked App: Merge Sports: Team Manager By PIXO GAMES LDA
      Bundle ID: com.pixodust.games.merge.sports.puzzle.game
      App Store Link: https://apps.apple.com/us/app/merge-sports-team-manager/id6736916280?uo=4
       

      🤩 Hack Features

      - Gems

      - Coins

      - Energy

      - ViP Active

      - ViP Claim Unlimited
      • 4 replies
    • Mr Autofire v4.3.3 [ +12 Cheats ] Currency Max
      Modded/Hacked App: Mr Autofire By Lightheart Entertainment Oy
      Bundle ID: games.lightheart.mrautofire
      iTunes Store Link: https://apps.apple.com/us/app/mr-autofire/id1483457500?uo=4


      Hack Features:
      - N0 ADS [ Reward Free ]

      - Damage 

      - Health 

      - Pet Damage

      - Rome Clear [ 1 Wave Clear ]

      Level Rearwards 

      [ Gems - Silver - Pet Card - Hero Card - Guns Card ]
      • 57 replies
    • Mr Autofire v4.3.3 [ +12 Jailed ] Currency Max
      Modded/Hacked App: Mr Autofire By Lightheart Entertainment Oy
      Bundle ID: games.lightheart.mrautofire
      iTunes Store Link: https://apps.apple.com/us/app/mr-autofire/id1483457500?uo=4


      Hack Features:

      - N0 ADS [ Reward Free ]

      - Damage 

      - Health 

      - Pet Damage

      - Rome Clear [ 1 Wave Clear ]

      Level Rearwards 

      [ Gems - Silver - Pet Card - Hero Card - Guns Card ]
      • 26 replies
×
  • Create New...

Important Information

We would like to place cookies on your device to help make this website better. The website cannot give you the best user experience without cookies. You can accept or decline our cookies. You may also adjust your cookie settings. Privacy Policy - Guidelines