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
for (NSString *family in [UIFont familyNames]) { | |
NSLog(@"---------- %@ ----------", family.uppercaseString); | |
NSArray *names = [UIFont fontNamesForFamilyName:family]; | |
for (NSString *font in names) NSLog(@"%@", font); | |
} |
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/UIKit.h> | |
#import <AVFoundation/AVFoundation.h> | |
#import <AssetsLibrary/AssetsLibrary.h> | |
@interface FilmCameraViewController : UIViewController <AVCaptureFileOutputRecordingDelegate> { | |
AVCaptureSession *session; | |
AVCaptureMovieFileOutput *filmOutput; | |
BOOL isInOpname; | |
} |
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
CGSize maximumLabelSize = CGSizeMake(CGRectGetWidth(self.view.frame), CGFLOAT_MAX); | |
NSString *text = dezeStoring.titel; | |
CGFloat fontSizeTitel = 15.0; | |
UIFont *font = [UIFont fontWithName:@"FontNaamRegular" size:fontSizeTitel]; | |
//Deze attributedstring is uit te breiden met nog verschillende attributes/opties | |
//Lijst te vinden op: https://developer.apple.com/library/ios/documentation/uikit/reference/NSAttributedString_UIKit_Additions/Reference/Reference.html#//apple_ref/doc/uid/TP40011688-CH1-SW16 (zowel onder als boven die paragraaf) | |
NSAttributedString *attributedText = [[NSAttributedString alloc] initWithString:text attributes:@{NSFontAttributeName:font}]; | |
CGRect calculatedRect = [attributedText boundingRectWithSize:maximumLabelSize options:NSStringDrawingUsesLineFragmentOrigin context:nil]; |
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
//Instellingen van het project > Target (app) | |
// Build Phases openen | |
// Voeg 'Run Script' toe via Editor > Add Build Phase > Add Build Phase Run Script | |
// Zet de nieuwe Phase als voorlaatste (voor Copy Bundle Resources) | |
//Settings | |
//Shell: /bin/sh | |
#!/bin/bash | |
buildNumber=$(/usr/libexec/PlistBuddy -c "Print CFBundleVersion" "$INFOPLIST_FILE") |
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
#define UIColorFromRGB(rgbValue) [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 green:((float)((rgbValue & 0xFF00) >> 8))/255.0 blue:((float)(rgbValue & 0xFF))/255.0 alpha:1.0] | |
//gebruik voor random kleur #A3CC98 | |
//[... setColor:UIColorFromRGB(0xA3CC98)]; |
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
// BELANGRIJK: DIT IS GEDAAN MET EEN TEXTVIEW VOOR DE MULTILINE EIGENSCHAP. | |
// DIT KAN OOK MET EEN GEWOON INPUTVELD | |
//UITextViewDelegate implementeren in de .h !!!!!!!! | |
//textview's delegate op self zetten in viewDidLoad, naam kan wijzigen | |
textView.delegate = self | |
//Dit volledig overnemen. 140 is maxlengte, anders niks wijzigen | |
- (BOOL)textView:(UITextView *)textView shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)text { |
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
- (void)touchesEnded: (NSSet *)touches withEvent: (UIEvent *)event { | |
for (UIView* view in self.view.subviews) { | |
if ([view isKindOfClass:[UITextField class]]) | |
[view resignFirstResponder]; | |
} | |
} |
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
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingImage:(UIImage *)image editingInfo:(NSDictionary *)editingInfo { | |
[self dismissModalViewControllerAnimated:YES]; | |
//Maak een nieuwe thread aan zodat de app vlotjes verderwerkt zonder alles te blokkeren | |
//@selector verwijst naar de functie die we aanroepen, withObject:image is de afbeelding die we doorgeven als argument | |
[NSThread detachNewThreadSelector:@selector(uploadImage:) toTarget:self withObject:image]; | |
} | |
- (void)uploadImage:(UIImage*)image { | |
//Zet de ativityindicator in de topbar aan zodat de gebruiker ziet dat we met het netwerk bezig zijn | |
[UIApplication sharedApplication].networkActivityIndicatorVisible = YES; |