Das aktivieren des mod_deflate sorgt für Kompression aller Ressourcen. AddOutputFilterByType DEFLATE text/plain AddOutputFilterByType DEFLATE text/html AddOutputFilterByType DEFLATE text/xml AddOutputFilterByType DEFLATE text/css AddOutputFilterByType DEFLATE text/vtt AddOutputFilterByType DEFLATE text/x-component AddOutputFilterByType DEFLATE application/xml AddOutputFilterByType DEFLATE application/xhtml+xml AddOutputFilterByType DEFLATE application/rss+xml AddOutputFilterByType DEFLATE application/js AddOutputFilterByType DEFLATE application/javascript AddOutputFilterByType DEFLATE application/x-javascript AddOutputFilterByType DEFLATE application/x-httpd-php AddOutputFilterByType DEFLATE application/x-httpd-fastphp AddOutputFilterByType DEFLATE application/atom+xml AddOutputFilterByType
Aktivierung des GZIP Komprimierung im .htacces . Durch die komprimierung wird die zu übertragende Datenmenge reduziert. mod_gzip_on Yes mod_gzip_dechunk Yes mod_gzip_item_include file .(html?|txt|css|js|php|pl)$ mod_gzip_item_include handler ^cgi-script$ mod_gzip_item_include mime ^text/.* mod_gzip_item_include mime ^application/x-javascript.* mod_gzip_item_exclude mime ^image/.* mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.*
This objective-c iOS code hiding the statusbar programmatically. – (BOOL)prefersStatusBarHidden{ return YES; }
This objective-c iOS code checking the internet connection. The Url string “https://1.1.1.1” is the fastest ping server for respond data. You can change the Urls string to what you want. NSURL *Urlcheck = [NSURL URLWithString:@”https://1.1.1.1″]; NSData *data = [NSData dataWithContentsOfURL:Urlcheck]; if (data){ //your code } else { // your code if no internet connection }
Automatische Jahres anzeige im Copyright Satz für iOS-Apps in Objective-C. Ein “Label” element in Main.storyboard hinzufügen und mit dem unteren quell-code ViewController.h verknüpfen. In ViewController.h 1. @property (strong, nonatomic) IBOutlet UILabel *year; In den untern quell-code möglichst zum Schluss einfügen. ViewController.m 2. NSDate *currentDate = [NSDate date]; NSDateFormatter *formatter = [NSDateFormatter new]; [formatter setDateFormat:@”yyyy”]; self.year.text
Umleitung bei bestimmter sprachen nach bestimmte Ziele. Folgender code steuert die Umleitung zum Ziel nach Sprache des Gerätes. Wenn iOS Gerät Sprache ist deutsch, bei allen anderen Sprachen… NSString *language = [[NSLocale currentLocale] localeIdentifier]; if ([language isEqualToString:@”de_DE”]){ NSLog(@”Language: %@”, language); // DEIN CODE HIER } else { // DEIN CODE HIER } Wenn iOS Gerät
Um zu prüfen ob Internetverbindung besteht oder nicht verwende diesen code: NSURL *Urlcheck = [NSURL URLWithString:@”https://www.google.com”]; NSData *data = [NSData dataWithContentsOfURL:Urlcheck]; if (data){ NSLog(@”Device is connected to the internet”); //DEIN CODE HIER } else { NSLog(@”Device is not connected to the internet”); //DEIN CODE HIER }
- 1
- 2