X-Git-Url: https://git.mdrn.pl/wl-app.git/blobdiff_plain/53b27422d140022594fc241cca91c3183be57bca..48b2fe9f7c2dc3d9aeaaa6dbfb27c7da4f3235ff:/iOS/Pods/FolioReaderKit/Source/EPUBCore/FRSpine.swift diff --git a/iOS/Pods/FolioReaderKit/Source/EPUBCore/FRSpine.swift b/iOS/Pods/FolioReaderKit/Source/EPUBCore/FRSpine.swift new file mode 100755 index 0000000..958774b --- /dev/null +++ b/iOS/Pods/FolioReaderKit/Source/EPUBCore/FRSpine.swift @@ -0,0 +1,46 @@ +// +// FRSpine.swift +// FolioReaderKit +// +// Created by Heberti Almeida on 06/05/15. +// Copyright (c) 2015 Folio Reader. All rights reserved. +// + +import UIKit + +struct Spine { + var linear: Bool + var resource: FRResource + + init(resource: FRResource, linear: Bool = true) { + self.resource = resource + self.linear = linear + } +} + +class FRSpine: NSObject { + var pageProgressionDirection: String? + var spineReferences = [Spine]() + + var isRtl: Bool { + if let pageProgressionDirection = pageProgressionDirection , pageProgressionDirection == "rtl" { + return true + } + return false + } + + func nextChapter(_ href: String) -> FRResource? { + var found = false; + + for item in spineReferences { + if(found){ + return item.resource + } + + if(item.resource.href == href) { + found = true + } + } + return nil + } +}