https://github.com/yuriiik/metronome
A simple metronome.
https://github.com/yuriiik/metronome
avaudioengine ios metronome objective-c
Last synced: 30 days ago
JSON representation
A simple metronome.
- Host: GitHub
- URL: https://github.com/yuriiik/metronome
- Owner: yuriiik
- License: mit
- Created: 2017-10-24T12:25:13.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-11-07T11:58:45.000Z (over 8 years ago)
- Last Synced: 2025-03-20T15:16:28.293Z (about 1 year ago)
- Topics: avaudioengine, ios, metronome, objective-c
- Language: Objective-C
- Homepage:
- Size: 82 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Metronome
[](https://travis-ci.org/kupratsevich@gmail.com/Metronome)
[](http://cocoapods.org/pods/Metronome)
[](http://cocoapods.org/pods/Metronome)
[](http://cocoapods.org/pods/Metronome)
A simple metronome.
## Overview
Metronome view controller that can be embedded into your app and used right away. Metronome implementation itself is based on Apple’s example ().

## Example
To run the example project, clone the repo, and run `pod install` from the Example directory first.
## Requirements
* iOS 9.0+
## Installation
Metronome is available through [CocoaPods](http://cocoapods.org). To install
it, simply add the following line to your Podfile:
```ruby
pod 'Metronome'
```
## Usage
Simply create an instance of MTRMetronomeViewController and add its view to your view hierarchy.
```objc
@property (strong, nonatomic) MTRMetronomeViewController *metronome;
```
Add to arbitrary UIVIew.
```objc
self.metronome = [[MTRMetronomeViewController alloc] initWithMinBPM:10 maxBPM:100 currentBPM:50];
[self.view addSubview:self.metronome.view];
self.metronome.view.frame = self.view.bounds;
```
Add to UITableViewCell's contentView.
```objc
self.metronomeViewController = [[MTMetronomeViewController alloc] initWithMinBPM:10 maxBPM:100 currentBPM:50];
self.metronomeViewController.view.translatesAutoresizingMaskIntoConstraints = NO;
[self.contentView addSubview:self.metronomeViewController.view];
UILayoutGuide *margin = self.contentView.layoutMarginsGuide;
[self.metronomeViewController.view.topAnchor constraintEqualToAnchor:margin.topAnchor].active = YES;
[self.metronomeViewController.view.bottomAnchor constraintEqualToAnchor:margin.bottomAnchor].active = YES;
[self.metronomeViewController.view.leadingAnchor constraintEqualToAnchor:margin.leadingAnchor].active = YES;
[self.metronomeViewController.view.trailingAnchor constraintEqualToAnchor:margin.trailingAnchor].active = YES;
```
## Author
Yurii Kupratsevych
kupratsevich@gmail.com
## License
Metronome is available under the MIT license. See the LICENSE file for more info.