Need help with ZCSlotMachine?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

iamzcc
127 Stars 38 Forks 9 Commits 3 Opened issues

Description

Simulate experience of a slot machine.

Services available

!
?

Need anything else?

Contributors list

No Data

Video & Screen Shot


Watch video on Youtube

Begin Sliding End

Requirements


  • iOS 5 or later
  • QuartzCore.framework
  • ARC

How To Use


ZCSlotMachine is a subclass of UIView. The demo application shows how it is used.

_slotMachine = [[ZCSlotMachine alloc] initWithFrame:CGRectMake(0, 0, 291, 193)];
_slotMachine.center = CGPointMake(self.view.frame.size.width / 2, 120);
_slotMachine.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin;
_slotMachine.contentInset = UIEdgeInsetsMake(5, 8, 5, 8);
_slotMachine.backgroundImage = [UIImage imageNamed:@"SlotMachineBackground"];
_slotMachine.coverImage = [UIImage imageNamed:@"SlotMachineCover"];

_slotMachine.delegate = self; _slotMachine.dataSource = self;

[self.view addSubview:_slotMachine];

And implement the ZCSlotMachineDataSource protocol.

- (NSArray *)iconsForSlotsInSlotMachine:(ZCSlotMachine *)slotMachine {
    return _slotIcons;
}

  • (NSUInteger)numberOfSlotsInSlotMachine:(ZCSlotMachine *)slotMachine { return 4; }

  • (CGFloat)slotWidthInSlotMachine:(ZCSlotMachine *)slotMachine { return 65.0f; }

  • (CGFloat)slotSpacingInSlotMachine:(ZCSlotMachine *)slotMachine { return 5.0f; }

And finally get the slot machine started.

[_slotMachine startSliding];

Credits


The avatar icons used in the demo app was designed by 风尾竹. You should ask for authorization if you want to use it in your project.

License


The MIT License

Copyright © 2013 ZCCStudio

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.