This repository has been archived by the owner on Nov 29, 2022. It is now read-only.
-
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
60 changed files
with
535 additions
and
147 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,18 +9,18 @@ | |
Pod::Spec.new do |s| | ||
|
||
s.name = "CerebellumWidget" | ||
s.version = "1.1.5" | ||
s.version = "2.0.0" | ||
s.summary = "Cerebellum widget SDK for iOS." | ||
s.description = "The library includes all the stuff required to embed Cerebellum widget to your iOS application." | ||
s.homepage = "http://cere.io" | ||
|
||
s.license = "MIT" | ||
|
||
s.author = { "Cerebellum Network Inc." => "widget@cere.io" } | ||
s.author = { "Cerebellum Network, Inc." => "info@cere.io" } | ||
|
||
s.platform = :ios, "9.0" | ||
|
||
s.source = { :git => "[email protected]:funler/widget-ios.git", :tag => s.version } | ||
s.source = { :git => "[email protected]:cere-io/widget-ios.git", :tag => s.version } | ||
|
||
s.source_files = "CerebellumWidget/**/*.swift" | ||
|
||
|
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
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,26 @@ | ||
// | ||
// UIApplication.swift | ||
// CerebellumWidget | ||
// | ||
// Created by Konstantin on 4/19/19. | ||
// Copyright © 2019 Cerebellum Network, Inc. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
|
||
extension UIApplication { | ||
class func getTopMostViewController(base: UIViewController? = UIApplication.shared.keyWindow?.rootViewController) -> UIViewController? { | ||
if let nav = base as? UINavigationController { | ||
return getTopMostViewController(base: nav.visibleViewController) | ||
} | ||
if let tab = base as? UITabBarController { | ||
if let selected = tab.selectedViewController { | ||
return getTopMostViewController(base: selected) | ||
} | ||
} | ||
if let presented = base?.presentedViewController { | ||
return getTopMostViewController(base: presented) | ||
} | ||
return base | ||
} | ||
} |
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,27 @@ | ||
// | ||
// WKWebView.swift | ||
// CerebellumWidget | ||
// | ||
// Created by Konstantin on 4/19/19. | ||
// Copyright © 2019 Cerebellum Network, Inc. All rights reserved. | ||
// | ||
|
||
import WebKit | ||
|
||
extension WKWebView { | ||
func evaluate(script: String) -> String? { | ||
var finished = false; | ||
var result: String?; | ||
|
||
evaluateJavaScript("var ____r____ = \(script); JSON.stringify(____r____);") { (r, e) in | ||
result = r as! String?; | ||
finished = true; | ||
} | ||
|
||
while !finished { | ||
RunLoop.current.run(mode: .default, before: Date.distantFuture); | ||
} | ||
|
||
return result; | ||
} | ||
} |
Oops, something went wrong.