Latest 0.1.0
Homepage https://github.com/yuriiik/Metronome
License MIT
Platforms ios 9.0
Authors

CI Status
Version
License
Platform

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 (https://developer.apple.com/library/content/samplecode/HelloMetronome/Introduction/Intro.html).

Metronome screenshot

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. To install
it, simply add the following line to your Podfile:

pod 'Metronome'

Usage

Simply create an instance of MTRMetronomeViewController and add its view to your view hierarchy.

@property (strong, nonatomic) MTRMetronomeViewController *metronome;

Add to arbitrary UIVIew.

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.

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

[email protected]

License

Metronome is available under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "Metronome",
    "version": "0.1.0",
    "summary": "A simple metronome.",
    "description": "Metronome view controller that can be embedded into your app and used right away. Metronome implementation itself is based on Appleu2019s example (https://developer.apple.com/library/content/samplecode/HelloMetronome/Introduction/Intro.html).n",
    "homepage": "https://github.com/yuriiik/Metronome",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Yurii Kupratsevych": "[email protected]"
    },
    "source": {
        "git": "https://github.com/yuriiik/Metronome.git",
        "tag": "0.1.0"
    },
    "platforms": {
        "ios": "9.0"
    },
    "source_files": "Metronome/Classes/**/*.{h,m}",
    "resource_bundles": {
        "Metronome": [
            "Metronome/Assets/*.mp3",
            "Metronome/Classes/*.xib"
        ]
    }
}

Pin It on Pinterest

Share This