BlockActionSheet.m revision 7c38b8c81c1006c82e3bd77460ce15d32de4a27b
0N/A//
0N/A// FreeOTP
0N/A//
0N/A// Authors: Nathaniel McCallum <npmccallum@redhat.com>
0N/A//
0N/A// Copyright (C) 2014 Nathaniel McCallum, Red Hat
0N/A//
0N/A// Licensed under the Apache License, Version 2.0 (the "License");
0N/A// you may not use this file except in compliance with the License.
0N/A// You may obtain a copy of the License at
0N/A//
0N/A// http://www.apache.org/licenses/LICENSE-2.0
0N/A//
0N/A// Unless required by applicable law or agreed to in writing, software
0N/A// distributed under the License is distributed on an "AS IS" BASIS,
0N/A// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
0N/A// See the License for the specific language governing permissions and
0N/A// limitations under the License.
0N/A//
0N/A
0N/A#import "BlockActionSheet.h"
0N/A
0N/A@interface BlockActionSheet () <UIActionSheetDelegate>
0N/A
756N/A@end
0N/A
0N/A@implementation BlockActionSheet
0N/A- (void)setCallback:(void (^)(NSInteger))callback
0N/A{
0N/A _callback = callback;
0N/A if (self.delegate == nil)
0N/A self.delegate = self;
0N/A}
756N/A
655N/A- (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex
0N/A{
0N/A self.callback(self.numberOfButtons - 1 - buttonIndex);
0N/A}
0N/A@end
0N/A