Integrating the plugin with AVPlayer is done by linking SenseKit framework to your player. Here we describe how to integrate your player with SenseKit.
- A valid Sense CID
public func solution(N : Int) -> Int { | |
let bytes = String(N, radix: 2) | |
var max = 0 | |
var current = 0 | |
for n in bytes.characters { | |
if n == "0" { | |
current += 1 | |
} else { | |
if current > max { |
public typealias Byte = UInt8 | |
public struct Data { | |
public var bytes: [Byte] | |
public init(_ bytes: [Byte]) { | |
self.bytes = bytes | |
} | |
} |
import PackageDescription | |
let package = Package( | |
name: "S4", | |
dependencies: [ | |
.Package(url: "https://github.com/swiftx/http.git", majorVersion: 0, minor: 1, alias: "SwiftXHTTP"), | |
.Package(url: "https://github.com/Zewo/HTTP.git", majorVersion: 0, minor: 1, alias: "ZewoHTTP") | |
] | |
) |
import Dispatch | |
import XCPlayground | |
XCPlaygroundPage.currentPage.needsIndefiniteExecution = true | |
func delay(duration: Double, closure: Void -> Void) { | |
let delayTime = dispatch_time(DISPATCH_TIME_NOW, Int64(duration * Double(NSEC_PER_SEC))) | |
dispatch_after(delayTime, dispatch_get_main_queue(), closure) | |
} |
let todoResources = Resource(middleware: recovery, contentNegotiaton) { todo in | |
todo.index { _ in | |
let todos = try app.getAllTodos() | |
return Response(content: ["todos": todos.content]) | |
} | |
todo.create(mappingTo: Todo.self) { request, todo in | |
let todo = try app.createTodo(todo) | |
return Response(content: todo) | |
} |
<FrameLayout | |
xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:app="http://schemas.android.com/apk/res-auto" | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content"> | |
<ImageView | |
android:id="@+id/backgroundImageView" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" |
<FrameLayout | |
xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:app="http://schemas.android.com/apk/res-auto" | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content"> | |
<ImageView | |
android:id="@+id/backgroundImageView" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" |