├── Swubtitles ├── Swubtitles.xcodeproj │ ├── project.xcworkspace │ │ └── contents.xcworkspacedata │ └── project.pbxproj ├── Swubtitles │ ├── Swubtitles.h │ ├── Title.swift │ ├── Info.plist │ ├── OpenSubtitlesHash.swift │ └── Subtitles.swift └── SwubtitlesTests │ ├── Subtitle files │ ├── 10-subs.srt │ ├── 10-subs-format-mistakes.srt │ └── 10-subs-some-double.srt │ ├── Info.plist │ └── SwubtitlesTests.swift ├── SwubtitlesExample ├── SwubtitlesExample.xcodeproj │ ├── project.xcworkspace │ │ └── contents.xcworkspacedata │ └── project.pbxproj └── SwubtitlesExample │ ├── Assets.xcassets │ └── AppIcon.appiconset │ │ └── Contents.json │ ├── ViewController.swift │ ├── Info.plist │ ├── Base.lproj │ ├── Main.storyboard │ └── LaunchScreen.storyboard │ └── AppDelegate.swift ├── README.md ├── LICENSE └── .gitignore /Swubtitles/Swubtitles.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /SwubtitlesExample/SwubtitlesExample.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Swubtitles/Swubtitles/Swubtitles.h: -------------------------------------------------------------------------------- 1 | // 2 | // Swubtitles.h 3 | // Swubtitles 4 | // 5 | // Created by Niklas Berglund on 2016-12-30. 6 | // Copyright © 2016 Klurig. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | //! Project version number for Swubtitles. 12 | FOUNDATION_EXPORT double SwubtitlesVersionNumber; 13 | 14 | //! Project version string for Swubtitles. 15 | FOUNDATION_EXPORT const unsigned char SwubtitlesVersionString[]; 16 | 17 | // In this header, you should import all the public headers of your framework using statements like #import 18 | 19 | 20 | -------------------------------------------------------------------------------- /Swubtitles/SwubtitlesTests/Subtitle files/10-subs.srt: -------------------------------------------------------------------------------- 1 | 1 2 | 00:00:17,940 --> 00:00:23,220 3 | First sub 4 | 5 | 2 6 | 00:00:38,650 --> 00:00:39,910 7 | Second sub 8 | 9 | 3 10 | 00:00:40,750 --> 00:00:44,470 11 | Third sub 12 | 13 | 4 14 | 00:00:45,300 --> 00:00:46,890 15 | Fourth sub 16 | 17 | 5 18 | 00:00:56,150 --> 00:00:57,910 19 | Fifth sub 20 | 21 | 6 22 | 00:00:58,080 --> 00:01:04,320 23 | Sixth sub 24 | 25 | 7 26 | 00:01:16,560 --> 00:01:22,710 27 | Seventh sub 28 | 29 | 8 30 | 00:01:24,040 --> 00:01:26,370 31 | Eight sub 32 | 33 | 9 34 | 00:01:28,980 --> 00:01:30,690 35 | Ninth sub 36 | 37 | 10 38 | 00:01:32,280 --> 00:01:36,230 39 | Tenth sub 40 | -------------------------------------------------------------------------------- /Swubtitles/SwubtitlesTests/Subtitle files/10-subs-format-mistakes.srt: -------------------------------------------------------------------------------- 1 | 1 2 | 0:0:17,940 --> 0:0:23,220 3 | First sub 4 | 5 | 2 6 | 00:00:38,650 --> 00:00:39,910 7 | Second sub 8 | 9 | 3 10 | 00:00:40,750 --> 00:00:44,470 11 | Third sub 12 | 13 | 4 14 | 00:00:45,300-->00:00:46,890 15 | Fourth sub 16 | 17 | 5 18 | 00:00:56,150 --> 00:00:57,910 19 | Fifth sub 20 | 21 | 6 22 | 00:00:58,080 --> 00:01:04,320 23 | Sixth sub 24 | 25 | 7 26 | 00:01:16,560 --> 00:01:22,710 27 | Seventh sub 28 | 29 | 8 30 | 00:01:24,040 --> 00:01:26,370 31 | Eight sub 32 | 33 | 9 34 | 00:01:28,980 -->00:01:30,690 35 | Ninth sub 36 | 37 | 10 38 | 00:01:32,280 --> 00:01:36,230 39 | Tenth sub 40 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # swubtitles 2 | Subtitles parsing and downloading with Swift 3 3 | 4 | ## Installation 5 | ### Installation with CocoaPods 6 | Will be available once the framework is released. 7 | 8 | 9 | ## Usage example 10 | Parse a SRT subtitles file and iterate over the results. 11 | 12 | ```swift 13 | let exampleSubtitlesUrl = Bundle.main.url(forResource: "big_buck_bunny_1080p", withExtension: "srt") 14 | let subtitles = Subtitles(fileUrl: exampleSubtitlesUrl!) 15 | 16 | for title in subtitles.titles! { 17 | print("Do something with title starting at \(title.start) ending at \(title.end):") 18 | print(title.texts!.description + "\n") 19 | } 20 | ``` 21 | 22 | Remember `import Swubtitles` -------------------------------------------------------------------------------- /Swubtitles/Swubtitles/Title.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Title.swift 3 | // Swubtitles 4 | // 5 | // Created by Niklas Berglund on 2016-12-30. 6 | // Copyright © 2016 Klurig. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | public class Title: NSObject { 12 | public var texts: [String]? 13 | public var start: TimeInterval? 14 | public var end: TimeInterval? 15 | public var index: Int? 16 | 17 | 18 | public init(withTexts: [String], start: TimeInterval, end: TimeInterval, index: Int) { 19 | super.init() 20 | 21 | self.texts = withTexts 22 | self.start = start 23 | self.end = end 24 | self.index = index 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Swubtitles/SwubtitlesTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /Swubtitles/SwubtitlesTests/Subtitle files/10-subs-some-double.srt: -------------------------------------------------------------------------------- 1 | 1 2 | 00:00:17,940 --> 00:00:23,220 3 | First sub first line 4 | First sub second line 5 | 6 | 2 7 | 00:00:38,650 --> 00:00:39,910 8 | Second sub 9 | 10 | 3 11 | 00:00:40,750 --> 00:00:44,470 12 | Third sub 13 | 14 | 4 15 | 00:00:45,300 --> 00:00:46,890 16 | Fourth sub first line 17 | Fourth sub second line 18 | 19 | 5 20 | 00:00:56,150 --> 00:00:57,910 21 | Fifth sub 22 | 23 | 6 24 | 00:00:58,080 --> 00:01:04,320 25 | Sixth sub 26 | 27 | 7 28 | 00:01:16,560 --> 00:01:22,710 29 | Seventh sub 30 | 31 | 8 32 | 00:01:24,040 --> 00:01:26,370 33 | Eight sub first line 34 | Eight sub second line 35 | 36 | 9 37 | 00:01:28,980 --> 00:01:30,690 38 | Ninth sub 39 | 40 | 10 41 | 00:01:32,280 --> 00:01:36,230 42 | Tenth sub first line 43 | Tenth sub second line 44 | -------------------------------------------------------------------------------- /SwubtitlesExample/SwubtitlesExample/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | } 33 | ], 34 | "info" : { 35 | "version" : 1, 36 | "author" : "xcode" 37 | } 38 | } -------------------------------------------------------------------------------- /Swubtitles/Swubtitles/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | $(CURRENT_PROJECT_VERSION) 21 | NSPrincipalClass 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /SwubtitlesExample/SwubtitlesExample/ViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.swift 3 | // SwubtitlesExample 4 | // 5 | // Created by Niklas Berglund on 2016-12-30. 6 | // Copyright © 2016 Klurig. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import Swubtitles 11 | 12 | class ViewController: UIViewController { 13 | 14 | override func viewDidLoad() { 15 | super.viewDidLoad() 16 | 17 | let exampleSubtitlesUrl = Bundle.main.url(forResource: "Kung.Fu.Panda.3.2016.1080p-CHT", withExtension: "srt") 18 | let subtitles = Subtitles(fileUrl: exampleSubtitlesUrl!) 19 | 20 | for title in subtitles.titles! { 21 | print("Do something with title starting at \(title.start) ending at \(title.end):") 22 | print(title.texts!.description + "\n") 23 | } 24 | } 25 | 26 | override func didReceiveMemoryWarning() { 27 | super.didReceiveMemoryWarning() 28 | // Dispose of any resources that can be recreated. 29 | } 30 | 31 | 32 | } 33 | 34 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2016 Niklas Berglund 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /SwubtitlesExample/SwubtitlesExample/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | LSRequiresIPhoneOS 22 | 23 | UILaunchStoryboardName 24 | LaunchScreen 25 | UIMainStoryboardFile 26 | Main 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | # 3 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore 4 | 5 | ## Build generated 6 | build/ 7 | DerivedData/ 8 | 9 | ## Various settings 10 | *.pbxuser 11 | !default.pbxuser 12 | *.mode1v3 13 | !default.mode1v3 14 | *.mode2v3 15 | !default.mode2v3 16 | *.perspectivev3 17 | !default.perspectivev3 18 | xcuserdata/ 19 | 20 | ## Other 21 | *.moved-aside 22 | *.xcuserstate 23 | 24 | ## Obj-C/Swift specific 25 | *.hmap 26 | *.ipa 27 | *.dSYM.zip 28 | *.dSYM 29 | 30 | ## Playgrounds 31 | timeline.xctimeline 32 | playground.xcworkspace 33 | 34 | # Swift Package Manager 35 | # 36 | # Add this line if you want to avoid checking in source code from Swift Package Manager dependencies. 37 | # Packages/ 38 | .build/ 39 | 40 | # CocoaPods 41 | # 42 | # We recommend against adding the Pods directory to your .gitignore. However 43 | # you should judge for yourself, the pros and cons are mentioned at: 44 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control 45 | # 46 | # Pods/ 47 | 48 | # Carthage 49 | # 50 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 51 | # Carthage/Checkouts 52 | 53 | Carthage/Build 54 | 55 | # fastlane 56 | # 57 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 58 | # screenshots whenever they are needed. 59 | # For more information about the recommended setup visit: 60 | # https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Gitignore.md 61 | 62 | fastlane/report.xml 63 | fastlane/Preview.html 64 | fastlane/screenshots 65 | fastlane/test_output 66 | -------------------------------------------------------------------------------- /SwubtitlesExample/SwubtitlesExample/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /SwubtitlesExample/SwubtitlesExample/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /SwubtitlesExample/SwubtitlesExample/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // SwubtitlesExample 4 | // 5 | // Created by Niklas Berglund on 2016-12-30. 6 | // Copyright © 2016 Klurig. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | @UIApplicationMain 12 | class AppDelegate: UIResponder, UIApplicationDelegate { 13 | 14 | var window: UIWindow? 15 | 16 | 17 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { 18 | // Override point for customization after application launch. 19 | return true 20 | } 21 | 22 | func applicationWillResignActive(_ application: UIApplication) { 23 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 24 | // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. 25 | } 26 | 27 | func applicationDidEnterBackground(_ application: UIApplication) { 28 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 29 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 30 | } 31 | 32 | func applicationWillEnterForeground(_ application: UIApplication) { 33 | // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. 34 | } 35 | 36 | func applicationDidBecomeActive(_ application: UIApplication) { 37 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 38 | } 39 | 40 | func applicationWillTerminate(_ application: UIApplication) { 41 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 42 | } 43 | 44 | 45 | } 46 | 47 | -------------------------------------------------------------------------------- /Swubtitles/Swubtitles/OpenSubtitlesHash.swift: -------------------------------------------------------------------------------- 1 | // 2 | // OpenSubtitlesHash.swift 3 | // Swubtitles 4 | // 5 | // This Swift 3 version is based on Swift 2 version by eduo: 6 | // https://gist.github.com/eduo/7188bb0029f3bcbf03d4 7 | // 8 | // Created by Niklas Berglund on 2017-01-01. 9 | // Copyright © 2017 Klurig. All rights reserved. 10 | // 11 | 12 | import Foundation 13 | 14 | class OpenSubtitlesHash: NSObject { 15 | static let chunkSize: Int = 65536 16 | 17 | struct VideoHash { 18 | var fileHash: String 19 | var fileSize: UInt64 20 | } 21 | 22 | public class func hashFor(_ url: URL) -> VideoHash { 23 | return self.hashFor(url.path) 24 | } 25 | 26 | public class func hashFor(_ path: String) -> VideoHash { 27 | var fileHash = VideoHash(fileHash: "", fileSize: 0) 28 | let fileHandler = FileHandle(forReadingAtPath: path)! 29 | 30 | let fileDataBegin: NSData = fileHandler.readData(ofLength: chunkSize) as NSData 31 | fileHandler.seekToEndOfFile() 32 | 33 | let fileSize: UInt64 = fileHandler.offsetInFile 34 | if (UInt64(chunkSize) > fileSize) { 35 | return fileHash 36 | } 37 | 38 | fileHandler.seek(toFileOffset: max(0, fileSize - UInt64(chunkSize))) 39 | let fileDataEnd: NSData = fileHandler.readData(ofLength: chunkSize) as NSData 40 | 41 | var hash: UInt64 = fileSize 42 | 43 | var data_bytes = UnsafeBufferPointer( 44 | start: UnsafePointer(fileDataBegin.bytes.assumingMemoryBound(to: UInt64.self)), 45 | count: fileDataBegin.length/MemoryLayout.size 46 | ) 47 | 48 | hash = data_bytes.reduce(hash,&+) 49 | 50 | data_bytes = UnsafeBufferPointer( 51 | start: UnsafePointer(fileDataEnd.bytes.assumingMemoryBound(to: UInt64.self)), 52 | count: fileDataEnd.length/MemoryLayout.size 53 | ) 54 | 55 | hash = data_bytes.reduce(hash,&+) 56 | 57 | fileHash.fileHash = String(format:"%016qx", arguments: [hash]) 58 | fileHash.fileSize = fileSize 59 | 60 | fileHandler.closeFile() 61 | 62 | return fileHash 63 | } 64 | } 65 | 66 | // Usage example: 67 | // let videoUrl = Bundle.main.url(forResource: "someVideoFile", withExtension: "avi") 68 | // let videoHash = OpenSubtitlesHash.hashFor(videoUrl!) 69 | // debugPrint("File hash: \(videoHash.fileHash)\nFile size: \(videoHash.fileSize)") 70 | -------------------------------------------------------------------------------- /Swubtitles/SwubtitlesTests/SwubtitlesTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SwubtitlesTests.swift 3 | // SwubtitlesTests 4 | // 5 | // Created by Niklas Berglund on 2016-12-30. 6 | // Copyright © 2016 Klurig. All rights reserved. 7 | // 8 | 9 | import XCTest 10 | @testable import Swubtitles 11 | 12 | class SwubtitlesTests: XCTestCase { 13 | 14 | let frameworkBundle = Bundle(for: SwubtitlesTests.self) 15 | 16 | 17 | override func setUp() { 18 | super.setUp() 19 | // Put setup code here. This method is called before the invocation of each test method in the class. 20 | } 21 | 22 | override func tearDown() { 23 | // Put teardown code here. This method is called after the invocation of each test method in the class. 24 | super.tearDown() 25 | } 26 | 27 | func testProperlyFormattedSubtitles() { 28 | guard let subtitlesFileUrl = self.frameworkBundle.url(forResource: "10-subs", withExtension:"srt") else { 29 | fatalError("Error loading subtitles") 30 | } 31 | 32 | let subtitles = Subtitles(fileUrl: subtitlesFileUrl) 33 | 34 | XCTAssertNotNil(subtitles.titles) 35 | XCTAssert(subtitles.titles?.count == 10) 36 | } 37 | 38 | func testProperlyFormattedSubtitlesTitleOrder() { 39 | guard let subtitlesFileUrl = self.frameworkBundle.url(forResource: "10-subs", withExtension:"srt") else { 40 | fatalError("Error loading subtitles") 41 | } 42 | 43 | let subtitles = Subtitles(fileUrl: subtitlesFileUrl) 44 | 45 | XCTAssertNotNil(subtitles.titles) 46 | 47 | var lastEnd: TimeInterval = -99 48 | 49 | for title in subtitles.titles! { 50 | if lastEnd != -99 { 51 | XCTAssertGreaterThan(title.start!, lastEnd) 52 | } 53 | 54 | lastEnd = title.end! 55 | } 56 | } 57 | 58 | func testProperlyFormattedDoubleLineSubtitles() { 59 | guard let subtitlesFileUrl = self.frameworkBundle.url(forResource: "10-subs-some-double", withExtension:"srt") else { 60 | fatalError("Error loading subtitles") 61 | } 62 | 63 | let subtitles = Subtitles(fileUrl: subtitlesFileUrl) 64 | 65 | XCTAssertNotNil(subtitles.titles) 66 | XCTAssert(subtitles.titles!.count == 10) 67 | XCTAssertNotNil(subtitles.titles?[0].texts) 68 | XCTAssert(subtitles.titles?[0].texts?.count == 2) 69 | XCTAssert(subtitles.titles?[1].texts?.count == 1) 70 | XCTAssert(subtitles.titles?[2].texts?.count == 1) 71 | XCTAssert(subtitles.titles?[3].texts?.count == 2) 72 | XCTAssert(subtitles.titles?[4].texts?.count == 1) 73 | XCTAssert(subtitles.titles?[5].texts?.count == 1) 74 | XCTAssert(subtitles.titles?[6].texts?.count == 1) 75 | XCTAssert(subtitles.titles?[7].texts?.count == 2) 76 | XCTAssert(subtitles.titles?[8].texts?.count == 1) 77 | XCTAssert(subtitles.titles?[9].texts?.count == 2) 78 | } 79 | 80 | func testPerformanceExample() { 81 | // This is an example of a performance test case. 82 | self.measure { 83 | // Put the code you want to measure the time of here. 84 | } 85 | } 86 | 87 | } 88 | -------------------------------------------------------------------------------- /Swubtitles/Swubtitles/Subtitles.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Subtitles.swift 3 | // Swubtitles 4 | // 5 | // Created by Niklas Berglund on 2016-12-30. 6 | // Copyright © 2016 Klurig. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import Foundation 11 | 12 | public enum ParseSubtitleError: Error { 13 | case Failed 14 | case InvalidFormat 15 | } 16 | 17 | public class Subtitles: NSObject { 18 | public var titles: [Title]? 19 | 20 | public init(fileUrl: URL) { 21 | super.init() 22 | 23 | do { 24 | let fileContent = try String(contentsOf: fileUrl, encoding: String.Encoding.utf8) 25 | do { 26 | titles = try self.parseSRTSub(fileContent) 27 | } 28 | catch { 29 | debugPrint(error) 30 | } 31 | } 32 | catch { 33 | debugPrint(error) 34 | } 35 | } 36 | 37 | func parseSRTSub(_ rawSub: String) throws -> [Title] { 38 | var allTitles = [Title]() 39 | var components = rawSub.components(separatedBy: "\r\n\r\n") 40 | 41 | // Fall back to \n\n separation 42 | if components.count == 1 { 43 | components = rawSub.components(separatedBy: "\n\n") 44 | } 45 | 46 | for component in components { 47 | if component.isEmpty { 48 | continue 49 | } 50 | 51 | let scanner = Scanner(string: component) 52 | 53 | var indexResult: Int = -99 54 | var startResult: NSString? 55 | var endResult: NSString? 56 | var textResult: NSString? 57 | 58 | let indexScanSuccess = scanner.scanInt(&indexResult) 59 | let startTimeScanResult = scanner.scanUpToCharacters(from: CharacterSet.whitespaces, into: &startResult) 60 | let dividerScanSuccess = scanner.scanUpTo("> ", into: nil) 61 | scanner.scanLocation += 2 62 | let endTimeScanResult = scanner.scanUpToCharacters(from: CharacterSet.newlines, into: &endResult) 63 | scanner.scanLocation += 1 64 | 65 | var textLines = [String]() 66 | 67 | // Iterate over text lines 68 | while scanner.isAtEnd == false { 69 | let textLineScanResult = scanner.scanUpToCharacters(from: CharacterSet.newlines, into: &textResult) 70 | 71 | guard textLineScanResult else { 72 | throw ParseSubtitleError.InvalidFormat 73 | } 74 | 75 | textLines.append(textResult as! String) 76 | } 77 | 78 | guard indexScanSuccess && startTimeScanResult && dividerScanSuccess && endTimeScanResult else { 79 | throw ParseSubtitleError.InvalidFormat 80 | } 81 | 82 | let startTimeInterval: TimeInterval = timeIntervalFromString(startResult! as String) 83 | let endTimeInterval: TimeInterval = timeIntervalFromString(endResult! as String) 84 | 85 | let title = Title(withTexts: textLines, start: startTimeInterval, end: endTimeInterval, index: indexResult) 86 | allTitles.append(title) 87 | } 88 | 89 | return allTitles 90 | } 91 | 92 | // TODO: Throw 93 | func timeIntervalFromString(_ timeString: String) -> TimeInterval { 94 | let scanner = Scanner(string: timeString) 95 | 96 | var hoursResult: Int = 0 97 | var minutesResult: Int = 0 98 | var secondsResult: NSString? 99 | var millisecondsResult: NSString? 100 | 101 | // Extract time components from string 102 | scanner.scanInt(&hoursResult) 103 | scanner.scanLocation += 1 104 | scanner.scanInt(&minutesResult) 105 | scanner.scanLocation += 1 106 | scanner.scanUpTo(",", into: &secondsResult) 107 | scanner.scanLocation += 1 108 | scanner.scanUpToCharacters(from: CharacterSet.newlines, into: &millisecondsResult) 109 | 110 | let secondsString = secondsResult! as String 111 | let seconds = Int(secondsString) 112 | 113 | let millisecondsString = millisecondsResult! as String 114 | let milliseconds = Int(millisecondsString) 115 | 116 | let timeInterval: Double = Double(hoursResult) * 3600 + Double(minutesResult) * 60 + Double(seconds!) + Double(Double(milliseconds!)/1000) 117 | 118 | return timeInterval as TimeInterval 119 | } 120 | } 121 | -------------------------------------------------------------------------------- /SwubtitlesExample/SwubtitlesExample.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 854285381E16AFBE007CBE9B /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 854285371E16AFBE007CBE9B /* AppDelegate.swift */; }; 11 | 8542853A1E16AFBE007CBE9B /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 854285391E16AFBE007CBE9B /* ViewController.swift */; }; 12 | 8542853D1E16AFBE007CBE9B /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 8542853B1E16AFBE007CBE9B /* Main.storyboard */; }; 13 | 8542853F1E16AFBE007CBE9B /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 8542853E1E16AFBE007CBE9B /* Assets.xcassets */; }; 14 | 854285421E16AFBE007CBE9B /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 854285401E16AFBE007CBE9B /* LaunchScreen.storyboard */; }; 15 | 854285541E16B06E007CBE9B /* Swubtitles.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 854285511E16B018007CBE9B /* Swubtitles.framework */; }; 16 | 854285551E16B06E007CBE9B /* Swubtitles.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 854285511E16B018007CBE9B /* Swubtitles.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 17 | 8542855D1E16BCE6007CBE9B /* Kung.Fu.Panda.3.2016.1080p-CHT.srt in Resources */ = {isa = PBXBuildFile; fileRef = 8542855C1E16BCE6007CBE9B /* Kung.Fu.Panda.3.2016.1080p-CHT.srt */; }; 18 | /* End PBXBuildFile section */ 19 | 20 | /* Begin PBXContainerItemProxy section */ 21 | 854285501E16B018007CBE9B /* PBXContainerItemProxy */ = { 22 | isa = PBXContainerItemProxy; 23 | containerPortal = 8542854B1E16B017007CBE9B /* Swubtitles.xcodeproj */; 24 | proxyType = 2; 25 | remoteGlobalIDString = 854285111E16AF96007CBE9B; 26 | remoteInfo = Swubtitles; 27 | }; 28 | 854285521E16B018007CBE9B /* PBXContainerItemProxy */ = { 29 | isa = PBXContainerItemProxy; 30 | containerPortal = 8542854B1E16B017007CBE9B /* Swubtitles.xcodeproj */; 31 | proxyType = 2; 32 | remoteGlobalIDString = 8542851A1E16AF96007CBE9B; 33 | remoteInfo = SwubtitlesTests; 34 | }; 35 | 854285561E16B06E007CBE9B /* PBXContainerItemProxy */ = { 36 | isa = PBXContainerItemProxy; 37 | containerPortal = 8542854B1E16B017007CBE9B /* Swubtitles.xcodeproj */; 38 | proxyType = 1; 39 | remoteGlobalIDString = 854285101E16AF96007CBE9B; 40 | remoteInfo = Swubtitles; 41 | }; 42 | /* End PBXContainerItemProxy section */ 43 | 44 | /* Begin PBXCopyFilesBuildPhase section */ 45 | 854285581E16B06E007CBE9B /* Embed Frameworks */ = { 46 | isa = PBXCopyFilesBuildPhase; 47 | buildActionMask = 2147483647; 48 | dstPath = ""; 49 | dstSubfolderSpec = 10; 50 | files = ( 51 | 854285551E16B06E007CBE9B /* Swubtitles.framework in Embed Frameworks */, 52 | ); 53 | name = "Embed Frameworks"; 54 | runOnlyForDeploymentPostprocessing = 0; 55 | }; 56 | /* End PBXCopyFilesBuildPhase section */ 57 | 58 | /* Begin PBXFileReference section */ 59 | 854285341E16AFBE007CBE9B /* SwubtitlesExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SwubtitlesExample.app; sourceTree = BUILT_PRODUCTS_DIR; }; 60 | 854285371E16AFBE007CBE9B /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 61 | 854285391E16AFBE007CBE9B /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; 62 | 8542853C1E16AFBE007CBE9B /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 63 | 8542853E1E16AFBE007CBE9B /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 64 | 854285411E16AFBE007CBE9B /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 65 | 854285431E16AFBE007CBE9B /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 66 | 8542854B1E16B017007CBE9B /* Swubtitles.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = Swubtitles.xcodeproj; path = ../Swubtitles/Swubtitles.xcodeproj; sourceTree = ""; }; 67 | 8542855C1E16BCE6007CBE9B /* Kung.Fu.Panda.3.2016.1080p-CHT.srt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = "Kung.Fu.Panda.3.2016.1080p-CHT.srt"; path = "../../../../../Downloads/Kung.Fu.Panda.3.2016.1080p-CHT.srt"; sourceTree = ""; }; 68 | /* End PBXFileReference section */ 69 | 70 | /* Begin PBXFrameworksBuildPhase section */ 71 | 854285311E16AFBE007CBE9B /* Frameworks */ = { 72 | isa = PBXFrameworksBuildPhase; 73 | buildActionMask = 2147483647; 74 | files = ( 75 | 854285541E16B06E007CBE9B /* Swubtitles.framework in Frameworks */, 76 | ); 77 | runOnlyForDeploymentPostprocessing = 0; 78 | }; 79 | /* End PBXFrameworksBuildPhase section */ 80 | 81 | /* Begin PBXGroup section */ 82 | 8542852B1E16AFBE007CBE9B = { 83 | isa = PBXGroup; 84 | children = ( 85 | 8542854B1E16B017007CBE9B /* Swubtitles.xcodeproj */, 86 | 854285361E16AFBE007CBE9B /* SwubtitlesExample */, 87 | 854285351E16AFBE007CBE9B /* Products */, 88 | ); 89 | sourceTree = ""; 90 | }; 91 | 854285351E16AFBE007CBE9B /* Products */ = { 92 | isa = PBXGroup; 93 | children = ( 94 | 854285341E16AFBE007CBE9B /* SwubtitlesExample.app */, 95 | ); 96 | name = Products; 97 | sourceTree = ""; 98 | }; 99 | 854285361E16AFBE007CBE9B /* SwubtitlesExample */ = { 100 | isa = PBXGroup; 101 | children = ( 102 | 8542855B1E16BCD1007CBE9B /* Subtitle files */, 103 | 854285371E16AFBE007CBE9B /* AppDelegate.swift */, 104 | 854285391E16AFBE007CBE9B /* ViewController.swift */, 105 | 8542853B1E16AFBE007CBE9B /* Main.storyboard */, 106 | 8542853E1E16AFBE007CBE9B /* Assets.xcassets */, 107 | 854285401E16AFBE007CBE9B /* LaunchScreen.storyboard */, 108 | 854285431E16AFBE007CBE9B /* Info.plist */, 109 | ); 110 | path = SwubtitlesExample; 111 | sourceTree = ""; 112 | }; 113 | 8542854C1E16B017007CBE9B /* Products */ = { 114 | isa = PBXGroup; 115 | children = ( 116 | 854285511E16B018007CBE9B /* Swubtitles.framework */, 117 | 854285531E16B018007CBE9B /* SwubtitlesTests.xctest */, 118 | ); 119 | name = Products; 120 | sourceTree = ""; 121 | }; 122 | 8542855B1E16BCD1007CBE9B /* Subtitle files */ = { 123 | isa = PBXGroup; 124 | children = ( 125 | 8542855C1E16BCE6007CBE9B /* Kung.Fu.Panda.3.2016.1080p-CHT.srt */, 126 | ); 127 | name = "Subtitle files"; 128 | sourceTree = ""; 129 | }; 130 | /* End PBXGroup section */ 131 | 132 | /* Begin PBXNativeTarget section */ 133 | 854285331E16AFBE007CBE9B /* SwubtitlesExample */ = { 134 | isa = PBXNativeTarget; 135 | buildConfigurationList = 854285461E16AFBE007CBE9B /* Build configuration list for PBXNativeTarget "SwubtitlesExample" */; 136 | buildPhases = ( 137 | 854285301E16AFBE007CBE9B /* Sources */, 138 | 854285311E16AFBE007CBE9B /* Frameworks */, 139 | 854285321E16AFBE007CBE9B /* Resources */, 140 | 854285581E16B06E007CBE9B /* Embed Frameworks */, 141 | ); 142 | buildRules = ( 143 | ); 144 | dependencies = ( 145 | 854285571E16B06E007CBE9B /* PBXTargetDependency */, 146 | ); 147 | name = SwubtitlesExample; 148 | productName = SwubtitlesExample; 149 | productReference = 854285341E16AFBE007CBE9B /* SwubtitlesExample.app */; 150 | productType = "com.apple.product-type.application"; 151 | }; 152 | /* End PBXNativeTarget section */ 153 | 154 | /* Begin PBXProject section */ 155 | 8542852C1E16AFBE007CBE9B /* Project object */ = { 156 | isa = PBXProject; 157 | attributes = { 158 | LastSwiftUpdateCheck = 0810; 159 | LastUpgradeCheck = 0810; 160 | ORGANIZATIONNAME = Klurig; 161 | TargetAttributes = { 162 | 854285331E16AFBE007CBE9B = { 163 | CreatedOnToolsVersion = 8.1; 164 | DevelopmentTeam = N95Z7TWCA8; 165 | ProvisioningStyle = Automatic; 166 | }; 167 | }; 168 | }; 169 | buildConfigurationList = 8542852F1E16AFBE007CBE9B /* Build configuration list for PBXProject "SwubtitlesExample" */; 170 | compatibilityVersion = "Xcode 3.2"; 171 | developmentRegion = English; 172 | hasScannedForEncodings = 0; 173 | knownRegions = ( 174 | en, 175 | Base, 176 | ); 177 | mainGroup = 8542852B1E16AFBE007CBE9B; 178 | productRefGroup = 854285351E16AFBE007CBE9B /* Products */; 179 | projectDirPath = ""; 180 | projectReferences = ( 181 | { 182 | ProductGroup = 8542854C1E16B017007CBE9B /* Products */; 183 | ProjectRef = 8542854B1E16B017007CBE9B /* Swubtitles.xcodeproj */; 184 | }, 185 | ); 186 | projectRoot = ""; 187 | targets = ( 188 | 854285331E16AFBE007CBE9B /* SwubtitlesExample */, 189 | ); 190 | }; 191 | /* End PBXProject section */ 192 | 193 | /* Begin PBXReferenceProxy section */ 194 | 854285511E16B018007CBE9B /* Swubtitles.framework */ = { 195 | isa = PBXReferenceProxy; 196 | fileType = wrapper.framework; 197 | path = Swubtitles.framework; 198 | remoteRef = 854285501E16B018007CBE9B /* PBXContainerItemProxy */; 199 | sourceTree = BUILT_PRODUCTS_DIR; 200 | }; 201 | 854285531E16B018007CBE9B /* SwubtitlesTests.xctest */ = { 202 | isa = PBXReferenceProxy; 203 | fileType = wrapper.cfbundle; 204 | path = SwubtitlesTests.xctest; 205 | remoteRef = 854285521E16B018007CBE9B /* PBXContainerItemProxy */; 206 | sourceTree = BUILT_PRODUCTS_DIR; 207 | }; 208 | /* End PBXReferenceProxy section */ 209 | 210 | /* Begin PBXResourcesBuildPhase section */ 211 | 854285321E16AFBE007CBE9B /* Resources */ = { 212 | isa = PBXResourcesBuildPhase; 213 | buildActionMask = 2147483647; 214 | files = ( 215 | 8542855D1E16BCE6007CBE9B /* Kung.Fu.Panda.3.2016.1080p-CHT.srt in Resources */, 216 | 854285421E16AFBE007CBE9B /* LaunchScreen.storyboard in Resources */, 217 | 8542853F1E16AFBE007CBE9B /* Assets.xcassets in Resources */, 218 | 8542853D1E16AFBE007CBE9B /* Main.storyboard in Resources */, 219 | ); 220 | runOnlyForDeploymentPostprocessing = 0; 221 | }; 222 | /* End PBXResourcesBuildPhase section */ 223 | 224 | /* Begin PBXSourcesBuildPhase section */ 225 | 854285301E16AFBE007CBE9B /* Sources */ = { 226 | isa = PBXSourcesBuildPhase; 227 | buildActionMask = 2147483647; 228 | files = ( 229 | 8542853A1E16AFBE007CBE9B /* ViewController.swift in Sources */, 230 | 854285381E16AFBE007CBE9B /* AppDelegate.swift in Sources */, 231 | ); 232 | runOnlyForDeploymentPostprocessing = 0; 233 | }; 234 | /* End PBXSourcesBuildPhase section */ 235 | 236 | /* Begin PBXTargetDependency section */ 237 | 854285571E16B06E007CBE9B /* PBXTargetDependency */ = { 238 | isa = PBXTargetDependency; 239 | name = Swubtitles; 240 | targetProxy = 854285561E16B06E007CBE9B /* PBXContainerItemProxy */; 241 | }; 242 | /* End PBXTargetDependency section */ 243 | 244 | /* Begin PBXVariantGroup section */ 245 | 8542853B1E16AFBE007CBE9B /* Main.storyboard */ = { 246 | isa = PBXVariantGroup; 247 | children = ( 248 | 8542853C1E16AFBE007CBE9B /* Base */, 249 | ); 250 | name = Main.storyboard; 251 | sourceTree = ""; 252 | }; 253 | 854285401E16AFBE007CBE9B /* LaunchScreen.storyboard */ = { 254 | isa = PBXVariantGroup; 255 | children = ( 256 | 854285411E16AFBE007CBE9B /* Base */, 257 | ); 258 | name = LaunchScreen.storyboard; 259 | sourceTree = ""; 260 | }; 261 | /* End PBXVariantGroup section */ 262 | 263 | /* Begin XCBuildConfiguration section */ 264 | 854285441E16AFBE007CBE9B /* Debug */ = { 265 | isa = XCBuildConfiguration; 266 | buildSettings = { 267 | ALWAYS_SEARCH_USER_PATHS = NO; 268 | CLANG_ANALYZER_NONNULL = YES; 269 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 270 | CLANG_CXX_LIBRARY = "libc++"; 271 | CLANG_ENABLE_MODULES = YES; 272 | CLANG_ENABLE_OBJC_ARC = YES; 273 | CLANG_WARN_BOOL_CONVERSION = YES; 274 | CLANG_WARN_CONSTANT_CONVERSION = YES; 275 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 276 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 277 | CLANG_WARN_EMPTY_BODY = YES; 278 | CLANG_WARN_ENUM_CONVERSION = YES; 279 | CLANG_WARN_INFINITE_RECURSION = YES; 280 | CLANG_WARN_INT_CONVERSION = YES; 281 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 282 | CLANG_WARN_SUSPICIOUS_MOVES = YES; 283 | CLANG_WARN_UNREACHABLE_CODE = YES; 284 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 285 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 286 | COPY_PHASE_STRIP = NO; 287 | DEBUG_INFORMATION_FORMAT = dwarf; 288 | ENABLE_STRICT_OBJC_MSGSEND = YES; 289 | ENABLE_TESTABILITY = YES; 290 | GCC_C_LANGUAGE_STANDARD = gnu99; 291 | GCC_DYNAMIC_NO_PIC = NO; 292 | GCC_NO_COMMON_BLOCKS = YES; 293 | GCC_OPTIMIZATION_LEVEL = 0; 294 | GCC_PREPROCESSOR_DEFINITIONS = ( 295 | "DEBUG=1", 296 | "$(inherited)", 297 | ); 298 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 299 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 300 | GCC_WARN_UNDECLARED_SELECTOR = YES; 301 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 302 | GCC_WARN_UNUSED_FUNCTION = YES; 303 | GCC_WARN_UNUSED_VARIABLE = YES; 304 | IPHONEOS_DEPLOYMENT_TARGET = 10.1; 305 | MTL_ENABLE_DEBUG_INFO = YES; 306 | ONLY_ACTIVE_ARCH = YES; 307 | SDKROOT = iphoneos; 308 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; 309 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 310 | }; 311 | name = Debug; 312 | }; 313 | 854285451E16AFBE007CBE9B /* Release */ = { 314 | isa = XCBuildConfiguration; 315 | buildSettings = { 316 | ALWAYS_SEARCH_USER_PATHS = NO; 317 | CLANG_ANALYZER_NONNULL = YES; 318 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 319 | CLANG_CXX_LIBRARY = "libc++"; 320 | CLANG_ENABLE_MODULES = YES; 321 | CLANG_ENABLE_OBJC_ARC = YES; 322 | CLANG_WARN_BOOL_CONVERSION = YES; 323 | CLANG_WARN_CONSTANT_CONVERSION = YES; 324 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 325 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 326 | CLANG_WARN_EMPTY_BODY = YES; 327 | CLANG_WARN_ENUM_CONVERSION = YES; 328 | CLANG_WARN_INFINITE_RECURSION = YES; 329 | CLANG_WARN_INT_CONVERSION = YES; 330 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 331 | CLANG_WARN_SUSPICIOUS_MOVES = YES; 332 | CLANG_WARN_UNREACHABLE_CODE = YES; 333 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 334 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 335 | COPY_PHASE_STRIP = NO; 336 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 337 | ENABLE_NS_ASSERTIONS = NO; 338 | ENABLE_STRICT_OBJC_MSGSEND = YES; 339 | GCC_C_LANGUAGE_STANDARD = gnu99; 340 | GCC_NO_COMMON_BLOCKS = YES; 341 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 342 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 343 | GCC_WARN_UNDECLARED_SELECTOR = YES; 344 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 345 | GCC_WARN_UNUSED_FUNCTION = YES; 346 | GCC_WARN_UNUSED_VARIABLE = YES; 347 | IPHONEOS_DEPLOYMENT_TARGET = 10.1; 348 | MTL_ENABLE_DEBUG_INFO = NO; 349 | SDKROOT = iphoneos; 350 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 351 | VALIDATE_PRODUCT = YES; 352 | }; 353 | name = Release; 354 | }; 355 | 854285471E16AFBE007CBE9B /* Debug */ = { 356 | isa = XCBuildConfiguration; 357 | buildSettings = { 358 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; 359 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 360 | DEVELOPMENT_TEAM = N95Z7TWCA8; 361 | INFOPLIST_FILE = SwubtitlesExample/Info.plist; 362 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 363 | PRODUCT_BUNDLE_IDENTIFIER = com.klurig.SwubtitlesExample; 364 | PRODUCT_NAME = "$(TARGET_NAME)"; 365 | SWIFT_VERSION = 3.0; 366 | }; 367 | name = Debug; 368 | }; 369 | 854285481E16AFBE007CBE9B /* Release */ = { 370 | isa = XCBuildConfiguration; 371 | buildSettings = { 372 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; 373 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 374 | DEVELOPMENT_TEAM = N95Z7TWCA8; 375 | INFOPLIST_FILE = SwubtitlesExample/Info.plist; 376 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 377 | PRODUCT_BUNDLE_IDENTIFIER = com.klurig.SwubtitlesExample; 378 | PRODUCT_NAME = "$(TARGET_NAME)"; 379 | SWIFT_VERSION = 3.0; 380 | }; 381 | name = Release; 382 | }; 383 | /* End XCBuildConfiguration section */ 384 | 385 | /* Begin XCConfigurationList section */ 386 | 8542852F1E16AFBE007CBE9B /* Build configuration list for PBXProject "SwubtitlesExample" */ = { 387 | isa = XCConfigurationList; 388 | buildConfigurations = ( 389 | 854285441E16AFBE007CBE9B /* Debug */, 390 | 854285451E16AFBE007CBE9B /* Release */, 391 | ); 392 | defaultConfigurationIsVisible = 0; 393 | defaultConfigurationName = Release; 394 | }; 395 | 854285461E16AFBE007CBE9B /* Build configuration list for PBXNativeTarget "SwubtitlesExample" */ = { 396 | isa = XCConfigurationList; 397 | buildConfigurations = ( 398 | 854285471E16AFBE007CBE9B /* Debug */, 399 | 854285481E16AFBE007CBE9B /* Release */, 400 | ); 401 | defaultConfigurationIsVisible = 0; 402 | defaultConfigurationName = Release; 403 | }; 404 | /* End XCConfigurationList section */ 405 | }; 406 | rootObject = 8542852C1E16AFBE007CBE9B /* Project object */; 407 | } 408 | -------------------------------------------------------------------------------- /Swubtitles/Swubtitles.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 8542851B1E16AF96007CBE9B /* Swubtitles.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 854285111E16AF96007CBE9B /* Swubtitles.framework */; }; 11 | 854285201E16AF96007CBE9B /* SwubtitlesTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8542851F1E16AF96007CBE9B /* SwubtitlesTests.swift */; }; 12 | 854285221E16AF96007CBE9B /* Swubtitles.h in Headers */ = {isa = PBXBuildFile; fileRef = 854285141E16AF96007CBE9B /* Swubtitles.h */; settings = {ATTRIBUTES = (Public, ); }; }; 13 | 8542854A1E16AFDF007CBE9B /* Subtitles.swift in Sources */ = {isa = PBXBuildFile; fileRef = 854285491E16AFDF007CBE9B /* Subtitles.swift */; }; 14 | 8542855A1E16B16F007CBE9B /* Title.swift in Sources */ = {isa = PBXBuildFile; fileRef = 854285591E16B16F007CBE9B /* Title.swift */; }; 15 | 859F85DF1E193934009014FA /* OpenSubtitlesHash.swift in Sources */ = {isa = PBXBuildFile; fileRef = 859F85DE1E193934009014FA /* OpenSubtitlesHash.swift */; }; 16 | 859F85E41E1A21A8009014FA /* 10-subs-format-mistakes.srt in Resources */ = {isa = PBXBuildFile; fileRef = 859F85E11E1A21A8009014FA /* 10-subs-format-mistakes.srt */; }; 17 | 859F85E51E1A21A8009014FA /* 10-subs-some-double.srt in Resources */ = {isa = PBXBuildFile; fileRef = 859F85E21E1A21A8009014FA /* 10-subs-some-double.srt */; }; 18 | 859F85E61E1A21A8009014FA /* 10-subs.srt in Resources */ = {isa = PBXBuildFile; fileRef = 859F85E31E1A21A8009014FA /* 10-subs.srt */; }; 19 | /* End PBXBuildFile section */ 20 | 21 | /* Begin PBXContainerItemProxy section */ 22 | 8542851C1E16AF96007CBE9B /* PBXContainerItemProxy */ = { 23 | isa = PBXContainerItemProxy; 24 | containerPortal = 854285081E16AF96007CBE9B /* Project object */; 25 | proxyType = 1; 26 | remoteGlobalIDString = 854285101E16AF96007CBE9B; 27 | remoteInfo = Swubtitles; 28 | }; 29 | /* End PBXContainerItemProxy section */ 30 | 31 | /* Begin PBXFileReference section */ 32 | 854285111E16AF96007CBE9B /* Swubtitles.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Swubtitles.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 33 | 854285141E16AF96007CBE9B /* Swubtitles.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Swubtitles.h; sourceTree = ""; }; 34 | 854285151E16AF96007CBE9B /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 35 | 8542851A1E16AF96007CBE9B /* SwubtitlesTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = SwubtitlesTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 36 | 8542851F1E16AF96007CBE9B /* SwubtitlesTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SwubtitlesTests.swift; sourceTree = ""; }; 37 | 854285211E16AF96007CBE9B /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 38 | 854285491E16AFDF007CBE9B /* Subtitles.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Subtitles.swift; sourceTree = ""; }; 39 | 854285591E16B16F007CBE9B /* Title.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Title.swift; sourceTree = ""; }; 40 | 859F85DE1E193934009014FA /* OpenSubtitlesHash.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OpenSubtitlesHash.swift; sourceTree = ""; }; 41 | 859F85E11E1A21A8009014FA /* 10-subs-format-mistakes.srt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = "10-subs-format-mistakes.srt"; path = "Subtitle files/10-subs-format-mistakes.srt"; sourceTree = ""; }; 42 | 859F85E21E1A21A8009014FA /* 10-subs-some-double.srt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = "10-subs-some-double.srt"; path = "Subtitle files/10-subs-some-double.srt"; sourceTree = ""; }; 43 | 859F85E31E1A21A8009014FA /* 10-subs.srt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = "10-subs.srt"; path = "Subtitle files/10-subs.srt"; sourceTree = ""; }; 44 | /* End PBXFileReference section */ 45 | 46 | /* Begin PBXFrameworksBuildPhase section */ 47 | 8542850D1E16AF96007CBE9B /* Frameworks */ = { 48 | isa = PBXFrameworksBuildPhase; 49 | buildActionMask = 2147483647; 50 | files = ( 51 | ); 52 | runOnlyForDeploymentPostprocessing = 0; 53 | }; 54 | 854285171E16AF96007CBE9B /* Frameworks */ = { 55 | isa = PBXFrameworksBuildPhase; 56 | buildActionMask = 2147483647; 57 | files = ( 58 | 8542851B1E16AF96007CBE9B /* Swubtitles.framework in Frameworks */, 59 | ); 60 | runOnlyForDeploymentPostprocessing = 0; 61 | }; 62 | /* End PBXFrameworksBuildPhase section */ 63 | 64 | /* Begin PBXGroup section */ 65 | 854285071E16AF96007CBE9B = { 66 | isa = PBXGroup; 67 | children = ( 68 | 854285131E16AF96007CBE9B /* Swubtitles */, 69 | 8542851E1E16AF96007CBE9B /* SwubtitlesTests */, 70 | 854285121E16AF96007CBE9B /* Products */, 71 | ); 72 | sourceTree = ""; 73 | }; 74 | 854285121E16AF96007CBE9B /* Products */ = { 75 | isa = PBXGroup; 76 | children = ( 77 | 854285111E16AF96007CBE9B /* Swubtitles.framework */, 78 | 8542851A1E16AF96007CBE9B /* SwubtitlesTests.xctest */, 79 | ); 80 | name = Products; 81 | sourceTree = ""; 82 | }; 83 | 854285131E16AF96007CBE9B /* Swubtitles */ = { 84 | isa = PBXGroup; 85 | children = ( 86 | 854285141E16AF96007CBE9B /* Swubtitles.h */, 87 | 854285151E16AF96007CBE9B /* Info.plist */, 88 | 854285491E16AFDF007CBE9B /* Subtitles.swift */, 89 | 854285591E16B16F007CBE9B /* Title.swift */, 90 | 859F85DE1E193934009014FA /* OpenSubtitlesHash.swift */, 91 | ); 92 | path = Swubtitles; 93 | sourceTree = ""; 94 | }; 95 | 8542851E1E16AF96007CBE9B /* SwubtitlesTests */ = { 96 | isa = PBXGroup; 97 | children = ( 98 | 859F85E01E1A2196009014FA /* Subtitles */, 99 | 8542851F1E16AF96007CBE9B /* SwubtitlesTests.swift */, 100 | 854285211E16AF96007CBE9B /* Info.plist */, 101 | ); 102 | path = SwubtitlesTests; 103 | sourceTree = ""; 104 | }; 105 | 859F85E01E1A2196009014FA /* Subtitles */ = { 106 | isa = PBXGroup; 107 | children = ( 108 | 859F85E11E1A21A8009014FA /* 10-subs-format-mistakes.srt */, 109 | 859F85E21E1A21A8009014FA /* 10-subs-some-double.srt */, 110 | 859F85E31E1A21A8009014FA /* 10-subs.srt */, 111 | ); 112 | name = Subtitles; 113 | sourceTree = ""; 114 | }; 115 | /* End PBXGroup section */ 116 | 117 | /* Begin PBXHeadersBuildPhase section */ 118 | 8542850E1E16AF96007CBE9B /* Headers */ = { 119 | isa = PBXHeadersBuildPhase; 120 | buildActionMask = 2147483647; 121 | files = ( 122 | 854285221E16AF96007CBE9B /* Swubtitles.h in Headers */, 123 | ); 124 | runOnlyForDeploymentPostprocessing = 0; 125 | }; 126 | /* End PBXHeadersBuildPhase section */ 127 | 128 | /* Begin PBXNativeTarget section */ 129 | 854285101E16AF96007CBE9B /* Swubtitles */ = { 130 | isa = PBXNativeTarget; 131 | buildConfigurationList = 854285251E16AF96007CBE9B /* Build configuration list for PBXNativeTarget "Swubtitles" */; 132 | buildPhases = ( 133 | 8542850C1E16AF96007CBE9B /* Sources */, 134 | 8542850D1E16AF96007CBE9B /* Frameworks */, 135 | 8542850E1E16AF96007CBE9B /* Headers */, 136 | 8542850F1E16AF96007CBE9B /* Resources */, 137 | ); 138 | buildRules = ( 139 | ); 140 | dependencies = ( 141 | ); 142 | name = Swubtitles; 143 | productName = Swubtitles; 144 | productReference = 854285111E16AF96007CBE9B /* Swubtitles.framework */; 145 | productType = "com.apple.product-type.framework"; 146 | }; 147 | 854285191E16AF96007CBE9B /* SwubtitlesTests */ = { 148 | isa = PBXNativeTarget; 149 | buildConfigurationList = 854285281E16AF96007CBE9B /* Build configuration list for PBXNativeTarget "SwubtitlesTests" */; 150 | buildPhases = ( 151 | 854285161E16AF96007CBE9B /* Sources */, 152 | 854285171E16AF96007CBE9B /* Frameworks */, 153 | 854285181E16AF96007CBE9B /* Resources */, 154 | ); 155 | buildRules = ( 156 | ); 157 | dependencies = ( 158 | 8542851D1E16AF96007CBE9B /* PBXTargetDependency */, 159 | ); 160 | name = SwubtitlesTests; 161 | productName = SwubtitlesTests; 162 | productReference = 8542851A1E16AF96007CBE9B /* SwubtitlesTests.xctest */; 163 | productType = "com.apple.product-type.bundle.unit-test"; 164 | }; 165 | /* End PBXNativeTarget section */ 166 | 167 | /* Begin PBXProject section */ 168 | 854285081E16AF96007CBE9B /* Project object */ = { 169 | isa = PBXProject; 170 | attributes = { 171 | LastSwiftUpdateCheck = 0810; 172 | LastUpgradeCheck = 0810; 173 | ORGANIZATIONNAME = Klurig; 174 | TargetAttributes = { 175 | 854285101E16AF96007CBE9B = { 176 | CreatedOnToolsVersion = 8.1; 177 | DevelopmentTeam = N95Z7TWCA8; 178 | LastSwiftMigration = 0810; 179 | ProvisioningStyle = Automatic; 180 | }; 181 | 854285191E16AF96007CBE9B = { 182 | CreatedOnToolsVersion = 8.1; 183 | DevelopmentTeam = N95Z7TWCA8; 184 | ProvisioningStyle = Automatic; 185 | }; 186 | }; 187 | }; 188 | buildConfigurationList = 8542850B1E16AF96007CBE9B /* Build configuration list for PBXProject "Swubtitles" */; 189 | compatibilityVersion = "Xcode 3.2"; 190 | developmentRegion = English; 191 | hasScannedForEncodings = 0; 192 | knownRegions = ( 193 | en, 194 | ); 195 | mainGroup = 854285071E16AF96007CBE9B; 196 | productRefGroup = 854285121E16AF96007CBE9B /* Products */; 197 | projectDirPath = ""; 198 | projectRoot = ""; 199 | targets = ( 200 | 854285101E16AF96007CBE9B /* Swubtitles */, 201 | 854285191E16AF96007CBE9B /* SwubtitlesTests */, 202 | ); 203 | }; 204 | /* End PBXProject section */ 205 | 206 | /* Begin PBXResourcesBuildPhase section */ 207 | 8542850F1E16AF96007CBE9B /* Resources */ = { 208 | isa = PBXResourcesBuildPhase; 209 | buildActionMask = 2147483647; 210 | files = ( 211 | ); 212 | runOnlyForDeploymentPostprocessing = 0; 213 | }; 214 | 854285181E16AF96007CBE9B /* Resources */ = { 215 | isa = PBXResourcesBuildPhase; 216 | buildActionMask = 2147483647; 217 | files = ( 218 | 859F85E51E1A21A8009014FA /* 10-subs-some-double.srt in Resources */, 219 | 859F85E41E1A21A8009014FA /* 10-subs-format-mistakes.srt in Resources */, 220 | 859F85E61E1A21A8009014FA /* 10-subs.srt in Resources */, 221 | ); 222 | runOnlyForDeploymentPostprocessing = 0; 223 | }; 224 | /* End PBXResourcesBuildPhase section */ 225 | 226 | /* Begin PBXSourcesBuildPhase section */ 227 | 8542850C1E16AF96007CBE9B /* Sources */ = { 228 | isa = PBXSourcesBuildPhase; 229 | buildActionMask = 2147483647; 230 | files = ( 231 | 8542855A1E16B16F007CBE9B /* Title.swift in Sources */, 232 | 8542854A1E16AFDF007CBE9B /* Subtitles.swift in Sources */, 233 | 859F85DF1E193934009014FA /* OpenSubtitlesHash.swift in Sources */, 234 | ); 235 | runOnlyForDeploymentPostprocessing = 0; 236 | }; 237 | 854285161E16AF96007CBE9B /* Sources */ = { 238 | isa = PBXSourcesBuildPhase; 239 | buildActionMask = 2147483647; 240 | files = ( 241 | 854285201E16AF96007CBE9B /* SwubtitlesTests.swift in Sources */, 242 | ); 243 | runOnlyForDeploymentPostprocessing = 0; 244 | }; 245 | /* End PBXSourcesBuildPhase section */ 246 | 247 | /* Begin PBXTargetDependency section */ 248 | 8542851D1E16AF96007CBE9B /* PBXTargetDependency */ = { 249 | isa = PBXTargetDependency; 250 | target = 854285101E16AF96007CBE9B /* Swubtitles */; 251 | targetProxy = 8542851C1E16AF96007CBE9B /* PBXContainerItemProxy */; 252 | }; 253 | /* End PBXTargetDependency section */ 254 | 255 | /* Begin XCBuildConfiguration section */ 256 | 854285231E16AF96007CBE9B /* Debug */ = { 257 | isa = XCBuildConfiguration; 258 | buildSettings = { 259 | ALWAYS_SEARCH_USER_PATHS = NO; 260 | CLANG_ANALYZER_NONNULL = YES; 261 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 262 | CLANG_CXX_LIBRARY = "libc++"; 263 | CLANG_ENABLE_MODULES = YES; 264 | CLANG_ENABLE_OBJC_ARC = YES; 265 | CLANG_WARN_BOOL_CONVERSION = YES; 266 | CLANG_WARN_CONSTANT_CONVERSION = YES; 267 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 268 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 269 | CLANG_WARN_EMPTY_BODY = YES; 270 | CLANG_WARN_ENUM_CONVERSION = YES; 271 | CLANG_WARN_INFINITE_RECURSION = YES; 272 | CLANG_WARN_INT_CONVERSION = YES; 273 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 274 | CLANG_WARN_SUSPICIOUS_MOVES = YES; 275 | CLANG_WARN_UNREACHABLE_CODE = YES; 276 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 277 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 278 | COPY_PHASE_STRIP = NO; 279 | CURRENT_PROJECT_VERSION = 1; 280 | DEBUG_INFORMATION_FORMAT = dwarf; 281 | ENABLE_STRICT_OBJC_MSGSEND = YES; 282 | ENABLE_TESTABILITY = YES; 283 | GCC_C_LANGUAGE_STANDARD = gnu99; 284 | GCC_DYNAMIC_NO_PIC = NO; 285 | GCC_NO_COMMON_BLOCKS = YES; 286 | GCC_OPTIMIZATION_LEVEL = 0; 287 | GCC_PREPROCESSOR_DEFINITIONS = ( 288 | "DEBUG=1", 289 | "$(inherited)", 290 | ); 291 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 292 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 293 | GCC_WARN_UNDECLARED_SELECTOR = YES; 294 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 295 | GCC_WARN_UNUSED_FUNCTION = YES; 296 | GCC_WARN_UNUSED_VARIABLE = YES; 297 | IPHONEOS_DEPLOYMENT_TARGET = 10.1; 298 | MTL_ENABLE_DEBUG_INFO = YES; 299 | ONLY_ACTIVE_ARCH = YES; 300 | SDKROOT = iphoneos; 301 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; 302 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 303 | TARGETED_DEVICE_FAMILY = "1,2"; 304 | VERSIONING_SYSTEM = "apple-generic"; 305 | VERSION_INFO_PREFIX = ""; 306 | }; 307 | name = Debug; 308 | }; 309 | 854285241E16AF96007CBE9B /* Release */ = { 310 | isa = XCBuildConfiguration; 311 | buildSettings = { 312 | ALWAYS_SEARCH_USER_PATHS = NO; 313 | CLANG_ANALYZER_NONNULL = YES; 314 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 315 | CLANG_CXX_LIBRARY = "libc++"; 316 | CLANG_ENABLE_MODULES = YES; 317 | CLANG_ENABLE_OBJC_ARC = YES; 318 | CLANG_WARN_BOOL_CONVERSION = YES; 319 | CLANG_WARN_CONSTANT_CONVERSION = YES; 320 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 321 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 322 | CLANG_WARN_EMPTY_BODY = YES; 323 | CLANG_WARN_ENUM_CONVERSION = YES; 324 | CLANG_WARN_INFINITE_RECURSION = YES; 325 | CLANG_WARN_INT_CONVERSION = YES; 326 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 327 | CLANG_WARN_SUSPICIOUS_MOVES = YES; 328 | CLANG_WARN_UNREACHABLE_CODE = YES; 329 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 330 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 331 | COPY_PHASE_STRIP = NO; 332 | CURRENT_PROJECT_VERSION = 1; 333 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 334 | ENABLE_NS_ASSERTIONS = NO; 335 | ENABLE_STRICT_OBJC_MSGSEND = YES; 336 | GCC_C_LANGUAGE_STANDARD = gnu99; 337 | GCC_NO_COMMON_BLOCKS = YES; 338 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 339 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 340 | GCC_WARN_UNDECLARED_SELECTOR = YES; 341 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 342 | GCC_WARN_UNUSED_FUNCTION = YES; 343 | GCC_WARN_UNUSED_VARIABLE = YES; 344 | IPHONEOS_DEPLOYMENT_TARGET = 10.1; 345 | MTL_ENABLE_DEBUG_INFO = NO; 346 | SDKROOT = iphoneos; 347 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 348 | TARGETED_DEVICE_FAMILY = "1,2"; 349 | VALIDATE_PRODUCT = YES; 350 | VERSIONING_SYSTEM = "apple-generic"; 351 | VERSION_INFO_PREFIX = ""; 352 | }; 353 | name = Release; 354 | }; 355 | 854285261E16AF96007CBE9B /* Debug */ = { 356 | isa = XCBuildConfiguration; 357 | buildSettings = { 358 | CLANG_ENABLE_MODULES = YES; 359 | CODE_SIGN_IDENTITY = ""; 360 | DEFINES_MODULE = YES; 361 | DEVELOPMENT_TEAM = N95Z7TWCA8; 362 | DYLIB_COMPATIBILITY_VERSION = 1; 363 | DYLIB_CURRENT_VERSION = 1; 364 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 365 | INFOPLIST_FILE = Swubtitles/Info.plist; 366 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 367 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 368 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 369 | PRODUCT_BUNDLE_IDENTIFIER = com.klurig.Swubtitles; 370 | PRODUCT_NAME = "$(TARGET_NAME)"; 371 | SKIP_INSTALL = YES; 372 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 373 | SWIFT_VERSION = 3.0; 374 | }; 375 | name = Debug; 376 | }; 377 | 854285271E16AF96007CBE9B /* Release */ = { 378 | isa = XCBuildConfiguration; 379 | buildSettings = { 380 | CLANG_ENABLE_MODULES = YES; 381 | CODE_SIGN_IDENTITY = ""; 382 | DEFINES_MODULE = YES; 383 | DEVELOPMENT_TEAM = N95Z7TWCA8; 384 | DYLIB_COMPATIBILITY_VERSION = 1; 385 | DYLIB_CURRENT_VERSION = 1; 386 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 387 | INFOPLIST_FILE = Swubtitles/Info.plist; 388 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 389 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 390 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 391 | PRODUCT_BUNDLE_IDENTIFIER = com.klurig.Swubtitles; 392 | PRODUCT_NAME = "$(TARGET_NAME)"; 393 | SKIP_INSTALL = YES; 394 | SWIFT_VERSION = 3.0; 395 | }; 396 | name = Release; 397 | }; 398 | 854285291E16AF96007CBE9B /* Debug */ = { 399 | isa = XCBuildConfiguration; 400 | buildSettings = { 401 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; 402 | DEVELOPMENT_TEAM = N95Z7TWCA8; 403 | INFOPLIST_FILE = SwubtitlesTests/Info.plist; 404 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 405 | PRODUCT_BUNDLE_IDENTIFIER = com.klurig.SwubtitlesTests; 406 | PRODUCT_NAME = "$(TARGET_NAME)"; 407 | SWIFT_VERSION = 3.0; 408 | }; 409 | name = Debug; 410 | }; 411 | 8542852A1E16AF96007CBE9B /* Release */ = { 412 | isa = XCBuildConfiguration; 413 | buildSettings = { 414 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; 415 | DEVELOPMENT_TEAM = N95Z7TWCA8; 416 | INFOPLIST_FILE = SwubtitlesTests/Info.plist; 417 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 418 | PRODUCT_BUNDLE_IDENTIFIER = com.klurig.SwubtitlesTests; 419 | PRODUCT_NAME = "$(TARGET_NAME)"; 420 | SWIFT_VERSION = 3.0; 421 | }; 422 | name = Release; 423 | }; 424 | /* End XCBuildConfiguration section */ 425 | 426 | /* Begin XCConfigurationList section */ 427 | 8542850B1E16AF96007CBE9B /* Build configuration list for PBXProject "Swubtitles" */ = { 428 | isa = XCConfigurationList; 429 | buildConfigurations = ( 430 | 854285231E16AF96007CBE9B /* Debug */, 431 | 854285241E16AF96007CBE9B /* Release */, 432 | ); 433 | defaultConfigurationIsVisible = 0; 434 | defaultConfigurationName = Release; 435 | }; 436 | 854285251E16AF96007CBE9B /* Build configuration list for PBXNativeTarget "Swubtitles" */ = { 437 | isa = XCConfigurationList; 438 | buildConfigurations = ( 439 | 854285261E16AF96007CBE9B /* Debug */, 440 | 854285271E16AF96007CBE9B /* Release */, 441 | ); 442 | defaultConfigurationIsVisible = 0; 443 | defaultConfigurationName = Release; 444 | }; 445 | 854285281E16AF96007CBE9B /* Build configuration list for PBXNativeTarget "SwubtitlesTests" */ = { 446 | isa = XCConfigurationList; 447 | buildConfigurations = ( 448 | 854285291E16AF96007CBE9B /* Debug */, 449 | 8542852A1E16AF96007CBE9B /* Release */, 450 | ); 451 | defaultConfigurationIsVisible = 0; 452 | defaultConfigurationName = Release; 453 | }; 454 | /* End XCConfigurationList section */ 455 | }; 456 | rootObject = 854285081E16AF96007CBE9B /* Project object */; 457 | } 458 | --------------------------------------------------------------------------------