This file contains 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
public class AktuellesDetail extends AppCompatActivity { | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.activity_aktuelles_detail); | |
android.support.v7.app.ActionBar actionBar = getSupportActionBar(); | |
actionBar.setHomeButtonEnabled(true); | |
actionBar.setDisplayHomeAsUpEnabled(true); |
This file contains 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
private void addClickListener(RecyclerView recyclerView) { | |
recyclerView.addOnItemTouchListener(new RecycleViewItemListener(getApplicationContext(), recyclerView, | |
new RecyclerItemListener.RecyclerTouchListener() { | |
public void onClickItem(View v, int position) { | |
System.out.println("On Click Item interface"); | |
} | |
public void onLongClickItem(View v, int position) { | |
System.out.println("On Long Click Item interface"); | |
} |
This file contains 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 "ViewController.h" | |
@import CoreBluetooth; | |
@interface ViewController () <CBCentralManagerDelegate> | |
@property(nonatomic, strong) CBCentralManager *cbManager; | |
@end | |
@implementation ViewController |
This file contains 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; | |
@interface NSBundle (Framework) | |
+ (NSBundle*)bundleForFramework; | |
@end | |
#import "NSBundle+Framework.h" |
This file contains 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
- (NSString *)versionText | |
{ | |
NSString *bundleVersion = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleShortVersionString"]; | |
NSString *buildNumber = [[NSBundle mainBundle] objectForInfoDictionaryKey:(NSString *)kCFBundleVersionKey]; | |
NSString *versionText; | |
if (bundleVersion) { | |
if (buildNumber) { |
This file contains 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
# http://stackoverflow.com/questions/1549578/git-and-pbxproj | |
# http://stackoverflow.com/a/18275082/470964 | |
*.pbxproj -crlf -diff -merge |
This file contains 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 "UIScrollView+Images.h" | |
@implementation UIScrollView (Images) | |
- (void)addImages:(NSArray *)images | |
{ | |
NSMutableDictionary *viewsDictionary = [NSMutableDictionary dictionary]; | |
NSMutableString *visualFormatString = [NSMutableString stringWithString:@"|"]; | |
NSUInteger index = 0; | |
for (UIImage *anImage in images) { |
This file contains 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
//add: | |
UIViewController *childVC = ...; | |
[childVC willMoveToParentViewController:self]; | |
[self addChildViewController:childVC]; | |
[self.view addSubview:childVC.view]; | |
//set frame or constraints of childVC.view | |
[childVC didMoveToParentViewController:self]; | |
//remove: |
This file contains 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
//_constraintHeight and _constraintWidht are IBOutlet NSLayoutConstraints (from _theView), defined in xib | |
_constraintHeight.constant = NEW_HEIGHT; | |
_constraintWidth.constant = NEW_WIDTH; | |
[_theView setNeedsUpdateConstraints]; | |
[UIView animateWithDuration:((animated) ? ANIMATION_DURATION : 0.0) animations:^{ | |
[_theView layoutIfNeeded]; | |
}]; |
This file contains 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
@interface NSDate (Additions) | |
-(int)numDaysInMonth; | |
-(int)firstWeekDayInMonth; | |
-(NSArray *)weeksOfMonth; | |
-(NSDate*)offsetDay:(int)days; |
NewerOlder