-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
240 additions
and
52 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"idiom" : "universal", | ||
"filename" : "[email protected]", | ||
"scale" : "1x" | ||
}, | ||
{ | ||
"idiom" : "universal", | ||
"filename" : "[email protected]", | ||
"scale" : "2x" | ||
}, | ||
{ | ||
"idiom" : "universal", | ||
"filename" : "[email protected]", | ||
"scale" : "3x" | ||
} | ||
], | ||
"info" : { | ||
"version" : 1, | ||
"author" : "xcode" | ||
} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
// | ||
// TwentyfourthViewController.swift | ||
// blista | ||
// | ||
// Created by Falk Rismansanj on 27.06.19. | ||
// Copyright © 2019 Falk Rismansanj. All rights reserved. | ||
// | ||
|
||
import UIKit | ||
import Crashlytics | ||
|
||
class TwentyfourthViewController: UIViewController, UIWebViewDelegate { | ||
|
||
@IBOutlet weak var webView24: UIWebView! | ||
@IBOutlet weak var activity: UIActivityIndicatorView! | ||
|
||
override func viewDidLoad() { | ||
super.viewDidLoad() | ||
|
||
// Do any additional setup after loading the view, typically from a nib. | ||
|
||
let reachability = Reachability()! | ||
|
||
switch reachability.connection { | ||
case .wifi: | ||
|
||
Answers.logContentView(withName: "Stundenplan", | ||
contentType: "Stundenplan", | ||
contentId: "stundenplan", | ||
customAttributes: [:]) | ||
|
||
webView24.loadRequest(URLRequest(url: URL(string: "https://zitrotec.de/stundenplan/display.php")!)) | ||
case .cellular: | ||
|
||
Answers.logContentView(withName: "Stundenplan", | ||
contentType: "Stundenplan", | ||
contentId: "stundenplan", | ||
customAttributes: [:]) | ||
|
||
webView24.loadRequest(URLRequest(url: URL(string: "https://zitrotec.de/stundenplan/display.php")!)) | ||
case .none: | ||
UIApplication.shared.isNetworkActivityIndicatorVisible = false | ||
activity.stopAnimating() | ||
navigationController?.popViewController(animated: true) | ||
dismiss(animated: true, completion: nil) | ||
let alert = UIAlertView() | ||
alert.title = "Du bist Offline" | ||
alert.message = "Bitte stell eine Internetverbindung her, um diesen Inhalt anzuzeigen." | ||
alert.addButton(withTitle: "OK") | ||
alert.show() | ||
} | ||
} | ||
|
||
override func viewDidAppear(_ animated: Bool) { | ||
super.viewDidAppear(animated) | ||
|
||
let reachability = Reachability()! | ||
|
||
switch reachability.connection { | ||
case .wifi: | ||
|
||
Answers.logContentView(withName: "Stundenplan", | ||
contentType: "Stundenplan", | ||
contentId: "stundenplan", | ||
customAttributes: [:]) | ||
|
||
webView24.loadRequest(URLRequest(url: URL(string: "https://zitrotec.de/stundenplan/display.php")!)) | ||
case .cellular: | ||
|
||
Answers.logContentView(withName: "Stundenplan", | ||
contentType: "Stundenplan", | ||
contentId: "stundenplan", | ||
customAttributes: [:]) | ||
|
||
webView24.loadRequest(URLRequest(url: URL(string: "https://zitrotec.de/stundenplan/display.php")!)) | ||
case .none: | ||
UIApplication.shared.isNetworkActivityIndicatorVisible = false | ||
activity.stopAnimating() | ||
navigationController?.popViewController(animated: true) | ||
dismiss(animated: true, completion: nil) | ||
let alert = UIAlertView() | ||
alert.title = "Du bist Offline" | ||
alert.message = "Bitte stell eine Internetverbindung her, um diesen Inhalt anzuzeigen." | ||
alert.addButton(withTitle: "OK") | ||
alert.show() | ||
} | ||
} | ||
|
||
func webViewDidStartLoad(_ webView: UIWebView) | ||
{ | ||
UIApplication.shared.isNetworkActivityIndicatorVisible = true | ||
activity.startAnimating() | ||
} | ||
func webViewDidFinishLoad(_ webView: UIWebView) | ||
{ | ||
UIApplication.shared.isNetworkActivityIndicatorVisible = false | ||
activity.stopAnimating() | ||
} | ||
|
||
func webView(_ webView: UIWebView, didFailLoadWithError error: Error) { | ||
UIApplication.shared.isNetworkActivityIndicatorVisible = false | ||
activity.stopAnimating() | ||
} | ||
|
||
override func didReceiveMemoryWarning() { | ||
super.didReceiveMemoryWarning() | ||
// Dispose of any resources that can be recreated. | ||
} | ||
|
||
|
||
} |