This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class CardView: UIView { | |
@IBOutlet weak var title: UILabel! | |
@IBOutlet weak var image: UIImageView! | |
@IBOutlet weak var collectionView: UICollectionView! | |
func setupCardView() { | |
..... | |
} | |
override func layoutSubviews() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fileprivate let people: BehaviorRelay<[Person]> = BehaviorRelay(value: [ | |
Person(name: "Spiderman", title: "Marvel"), | |
Person(name: "Batman", title: "DC"), | |
Person(name: "Mickey", title: "Disney") | |
]) | |
let disposeBag = DisposeBag() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Incident Identifier: C28260B4-DECA-419E-BC49-770D7701708C | |
CrashReporter Key: 05b2264055702abdd411424db738dcfc3b5b983b | |
Hardware Model: iPhone8,2 | |
Process: MyApplicationName [412] | |
Path: /private/var/containers/Bundle/Application/772F232F-AC65-4467-AFEA-A989A812D406/MyApplicationName.app/MyApplicationName |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@protocol BaseDelegate <NSObject> | |
@required | |
- (void)didSelectActionSheetIndex:(NSString *)actionTitle actionSheetIndex:(NSInteger )index; | |
@end | |
@interface CustomAction : NSObject <UIActionSheetDelegate> | |
@property (nonatomic, assign) id<BaseDelegate> delegate; // Assign property |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. FirstViewController will show one ActionSheet and its action perform here by UIActionSheetDelegate. Before, presenting this action sheet i am setting the delegate to my CustomAction class | |
- (void)cellMenuClicked:(id)sender { | |
CustomAction *obj = [[CustomAction alloc] init]; | |
obj.delegate = self; | |
thumbActionSheet = [[UIActionSheet alloc] initWithTitle:nil delegate:obj cancelButtonTitle:@"Cancel" destructiveButtonTitle:nil otherButtonTitles:@"Add to Watchlist", @"Share", nil]; | |
[thumbActionSheet showInView:[self.view window]]; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CustomAction.h | |
-------------- | |
#import <Foundation/Foundation.h> | |
#import <UIKit/UIKit.h> | |
@protocol BaseDelegate <NSObject> | |
@required | |
- (void)didSelectActionSheetIndex:(NSString *)actionTitle actionSheetIndex:(NSInteger )index; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// FirstViewController.m | |
// | |
// Created by Work on 19/09/14. | |
// Copyright (c) 2014 App. All rights reserved. | |
// | |
#import "FirstViewController.h" | |
@interface FirstViewController () <BaseDelegate> // Delegate |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import <UIKit/UIKit.h> | |
#import "BaseViewController.h" | |
@interface FirstViewController : BaseViewController <UICollectionViewDataSource, UICollectionViewDelegate, UICollectionViewDelegateFlowLayout, UIScrollViewDelegate, UIActionSheetDelegate> | |
... | |
@end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// BaseViewController.m | |
// | |
// Created by Work on 22/09/14. | |
// Copyright (c) 2014 E. All rights reserved. | |
// | |
#import "BaseViewController.h" | |
#import "GlobalInstance.h" | |
#import "CDRTranslucentSideBar.h" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import <UIKit/UIKit.h> | |
#import "GlobalInstance.h" | |
@protocol BaseDelegate <NSObject> | |
@required | |
- (void)didSelectActionSheetIndex:(NSString *)actionTitle actionSheetIndex:(NSInteger )index; | |
@end |
NewerOlder