├── .gitattributes
├── .gitignore
├── PasteBin
├── Default-568h@2x.png
├── PasteBin.xcodeproj
│ ├── project.pbxproj
│ └── project.xcworkspace
│ │ └── contents.xcworkspacedata
├── PasteBin.xcworkspace
│ ├── contents.xcworkspacedata
│ └── xcshareddata
│ │ └── IDEWorkspaceChecks.plist
├── PasteBin
│ ├── AppDelegate.swift
│ ├── Assets.xcassets
│ │ ├── AppIcon.appiconset
│ │ │ ├── Contents.json
│ │ │ ├── Icon-App-20x20@1x.png
│ │ │ ├── Icon-App-20x20@2x.png
│ │ │ ├── Icon-App-20x20@3x.png
│ │ │ ├── Icon-App-29x29@1x.png
│ │ │ ├── Icon-App-29x29@2x.png
│ │ │ ├── Icon-App-29x29@3x.png
│ │ │ ├── Icon-App-40x40@1x.png
│ │ │ ├── Icon-App-40x40@2x.png
│ │ │ ├── Icon-App-40x40@3x.png
│ │ │ ├── Icon-App-57x57@1x.png
│ │ │ ├── Icon-App-57x57@2x.png
│ │ │ ├── Icon-App-60x60@2x.png
│ │ │ ├── Icon-App-60x60@3x.png
│ │ │ ├── Icon-App-76x76@1x.png
│ │ │ ├── Icon-App-76x76@2x.png
│ │ │ ├── Icon-App-83.5x83.5@2x.png
│ │ │ └── Itunes1024.png
│ │ ├── ButtonCentreDownArrow.imageset
│ │ │ ├── ButtonCentreDownArrow@2x.png
│ │ │ ├── ButtonCentreDownArrow@3x.png
│ │ │ └── Contents.json
│ │ ├── ButtonCentreTicked.imageset
│ │ │ ├── ButtonCentreTicked@2x.png
│ │ │ ├── ButtonCentreTicked@3x.png
│ │ │ └── Contents.json
│ │ ├── Contents.json
│ │ ├── Icon-60.png
│ │ ├── Icon-72.png
│ │ ├── Icon-72@2x.png
│ │ ├── Icon-Small-50.png
│ │ ├── Icon-Small-50@2x.png
│ │ ├── Icon.png
│ │ ├── Icon@2x.png
│ │ ├── IconAbout.imageset
│ │ │ ├── Contents.json
│ │ │ ├── IconAbout@2x.png
│ │ │ └── IconAbout@3x.png
│ │ ├── IconCreatePaste.imageset
│ │ │ ├── Contents.json
│ │ │ ├── IconCreatePaste@2x.png
│ │ │ └── IconCreatePaste@3x.png
│ │ ├── IconEdit.imageset
│ │ │ ├── Contents.json
│ │ │ ├── IconEdit@2x.png
│ │ │ └── IconEdit@3x.png
│ │ ├── IconHelp.imageset
│ │ │ ├── Contents.json
│ │ │ ├── IconHelp@2x.png
│ │ │ └── IconHelp@3x.png
│ │ ├── IconHistory.imageset
│ │ │ ├── Contents.json
│ │ │ ├── IconHistory@2x.png
│ │ │ └── IconHistory@3x.png
│ │ ├── IconOptions.imageset
│ │ │ ├── Contents.json
│ │ │ ├── IconOptions@2x.png
│ │ │ └── IconOptions@3x.png
│ │ ├── IconQuickCreatePaste.imageset
│ │ │ ├── Contents.json
│ │ │ ├── IconQuickCreatePaste@2x.png
│ │ │ └── IconQuickCreatePaste@3x.png
│ │ ├── IconSyntax.imageset
│ │ │ ├── Contents.json
│ │ │ ├── IconSyntax@2x.png
│ │ │ └── IconSyntax@3x.png
│ │ ├── Itunes1024.png
│ │ ├── ItunesArtwork.png
│ │ ├── ItunesArtwork@2x.png
│ │ ├── LogoGrey.imageset
│ │ │ ├── Contents.json
│ │ │ ├── LogoGrey@2x.png
│ │ │ └── LogoGrey@3x.png
│ │ └── LogoWithColour.imageset
│ │ │ ├── Contents.json
│ │ │ ├── LogoWithColour@2x.png
│ │ │ └── LogoWithColour@3x.png
│ ├── Base.lproj
│ │ ├── LaunchScreen.storyboard
│ │ └── Main.storyboard
│ ├── HelpViewController.swift
│ ├── HistoryViewController.swift
│ ├── Info.plist
│ ├── MasterOptionsViewController.swift
│ ├── NewOptionsViewController.swift
│ ├── PasteBin.entitlements
│ ├── PasteView.swift
│ ├── PastebinHelper.swift
│ ├── SyntaxLibraries.swift
│ ├── SyntaxSelectViewController.storyboard
│ ├── SyntaxSelectViewController.swift
│ ├── TextSelectionViewController.swift
│ ├── ViewController.swift
│ └── code.png
├── Podfile
├── Podfile.lock
├── Pods
│ ├── AFNetworking
│ │ ├── AFNetworking
│ │ │ ├── AFHTTPSessionManager.h
│ │ │ ├── AFHTTPSessionManager.m
│ │ │ ├── AFNetworkReachabilityManager.h
│ │ │ ├── AFNetworkReachabilityManager.m
│ │ │ ├── AFNetworking.h
│ │ │ ├── AFSecurityPolicy.h
│ │ │ ├── AFSecurityPolicy.m
│ │ │ ├── AFURLRequestSerialization.h
│ │ │ ├── AFURLRequestSerialization.m
│ │ │ ├── AFURLResponseSerialization.h
│ │ │ ├── AFURLResponseSerialization.m
│ │ │ ├── AFURLSessionManager.h
│ │ │ └── AFURLSessionManager.m
│ │ ├── LICENSE
│ │ ├── README.md
│ │ └── UIKit+AFNetworking
│ │ │ ├── AFAutoPurgingImageCache.h
│ │ │ ├── AFAutoPurgingImageCache.m
│ │ │ ├── AFImageDownloader.h
│ │ │ ├── AFImageDownloader.m
│ │ │ ├── AFNetworkActivityIndicatorManager.h
│ │ │ ├── AFNetworkActivityIndicatorManager.m
│ │ │ ├── UIActivityIndicatorView+AFNetworking.h
│ │ │ ├── UIActivityIndicatorView+AFNetworking.m
│ │ │ ├── UIButton+AFNetworking.h
│ │ │ ├── UIButton+AFNetworking.m
│ │ │ ├── UIImage+AFNetworking.h
│ │ │ ├── UIImageView+AFNetworking.h
│ │ │ ├── UIImageView+AFNetworking.m
│ │ │ ├── UIKit+AFNetworking.h
│ │ │ ├── UIProgressView+AFNetworking.h
│ │ │ ├── UIProgressView+AFNetworking.m
│ │ │ ├── UIRefreshControl+AFNetworking.h
│ │ │ ├── UIRefreshControl+AFNetworking.m
│ │ │ ├── UIWebView+AFNetworking.h
│ │ │ └── UIWebView+AFNetworking.m
│ ├── Manifest.lock
│ ├── Pods.xcodeproj
│ │ └── project.pbxproj
│ └── Target Support Files
│ │ ├── AFNetworking
│ │ ├── AFNetworking-dummy.m
│ │ ├── AFNetworking-prefix.pch
│ │ ├── AFNetworking-umbrella.h
│ │ ├── AFNetworking.modulemap
│ │ └── AFNetworking.xcconfig
│ │ └── Pods-PasteBin
│ │ ├── Pods-PasteBin-acknowledgements.markdown
│ │ ├── Pods-PasteBin-acknowledgements.plist
│ │ ├── Pods-PasteBin-dummy.m
│ │ ├── Pods-PasteBin-frameworks.sh
│ │ ├── Pods-PasteBin-umbrella.h
│ │ ├── Pods-PasteBin.debug.xcconfig
│ │ ├── Pods-PasteBin.modulemap
│ │ └── Pods-PasteBin.release.xcconfig
├── SyntaxSelectViewController~.storyboard
└── pastebin_logo_side_outline.svg
└── README.md
/.gitattributes:
--------------------------------------------------------------------------------
1 | PasteBin/Pods/* linguist-vendored
--------------------------------------------------------------------------------
/.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 | *.xcbkptlist
21 | project.xcworkspace/
22 | xcuserdata/
23 | ## Other
24 | *.moved-aside
25 | *.xcuserstate
26 |
27 | ## Obj-C/Swift specific
28 | *.hmap
29 | *.ipa
30 | *.dSYM.zip
31 | *.dSYM
32 |
33 | ## Playgrounds
34 | timeline.xctimeline
35 | playground.xcworkspace
36 |
37 | # Swift Package Manager
38 | #
39 | # Add this line if you want to avoid checking in source code from Swift Package Manager dependencies.
40 | # Packages/
41 | .build/
42 |
43 | # CocoaPods
44 | #
45 | # We recommend against adding the Pods directory to your .gitignore. However
46 | # you should judge for yourself, the pros and cons are mentioned at:
47 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
48 | #
49 | Pods/
50 |
51 | # Carthage
52 | #
53 | # Add this line if you want to avoid checking in source code from Carthage dependencies.
54 | # Carthage/Checkouts
55 |
56 | Carthage/Build
57 |
58 | # fastlane
59 | #
60 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
61 | # screenshots whenever they are needed.
62 | # For more information about the recommended setup visit:
63 | # https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Gitignore.md
64 |
65 | fastlane/report.xml
66 | fastlane/Preview.html
67 | fastlane/screenshots
68 | fastlane/test_output
69 |
70 | PasteBin/.idea/
--------------------------------------------------------------------------------
/PasteBin/Default-568h@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jonluca/PasteBinApp/2c4132b3cd488848431b4bb786d0acf0c8c41310/PasteBin/Default-568h@2x.png
--------------------------------------------------------------------------------
/PasteBin/PasteBin.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/PasteBin/PasteBin.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/PasteBin/PasteBin.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/PasteBin/PasteBin/AppDelegate.swift:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.swift
3 | // PasteBin
4 | //
5 | // Created by JonLuca De Caro on 12/28/16.
6 | // Copyright © 2016 JonLuca De Caro. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | @UIApplicationMain
12 | class AppDelegate: UIResponder, UIApplicationDelegate {
13 | var window: UIWindow?
14 |
15 | func application(_: UIApplication, didFinishLaunchingWithOptions _: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
16 | // Override point for customization after application launch.
17 | return true
18 | }
19 |
20 | func applicationWillResignActive(_: UIApplication) {
21 | // 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.
22 | // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game.
23 | }
24 |
25 | func applicationDidEnterBackground(_: UIApplication) {
26 | // 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.
27 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
28 | }
29 |
30 | func applicationWillEnterForeground(_: UIApplication) {
31 | // 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.
32 | }
33 |
34 | func applicationDidBecomeActive(_: UIApplication) {
35 | // 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.
36 | }
37 |
38 | func applicationWillTerminate(_: UIApplication) {
39 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
40 | }
41 |
42 | // Set the status bar with white text on dark background.
43 | func application(_ application: UIApplication,
44 | willFinishLaunchingWithOptions _: [UIApplication.LaunchOptionsKey: Any]? = nil) -> Bool {
45 | application.statusBarStyle = .lightContent // .default
46 | return true
47 | }
48 |
49 | // Guide from https://the-nerd.be/2015/09/30/add-3d-touch-quick-actions-tutorial/
50 | func application(_: UIApplication, performActionFor shortcutItem: UIApplicationShortcutItem, completionHandler _: @escaping (Bool) -> Void) {
51 | // 3D touch quick action for quick paste
52 | if shortcutItem.type == "com.jonluca.pastebinapp.quickpaste" {
53 | let mainStoryboard = UIStoryboard(name: "Main", bundle: nil)
54 | let vc: ViewController = mainStoryboard.instantiateViewController(withIdentifier: "mainView") as! ViewController
55 | vc.quickSubmit(self)
56 | let alertController = UIAlertController(title: "Success!", message: "\nSuccesfully copied to clipboard!", preferredStyle: .alert)
57 | let OKAction = UIAlertAction(title: "OK", style: .default) { _ in
58 | // handle response here.
59 | }
60 | alertController.addAction(OKAction)
61 | window?.rootViewController?.present(alertController, animated: true) {}
62 | }
63 | }
64 | }
65 |
--------------------------------------------------------------------------------
/PasteBin/PasteBin/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "size" : "20x20",
5 | "idiom" : "iphone",
6 | "filename" : "Icon-App-20x20@2x.png",
7 | "scale" : "2x"
8 | },
9 | {
10 | "size" : "20x20",
11 | "idiom" : "iphone",
12 | "filename" : "Icon-App-20x20@3x.png",
13 | "scale" : "3x"
14 | },
15 | {
16 | "size" : "29x29",
17 | "idiom" : "iphone",
18 | "filename" : "Icon-App-29x29@1x.png",
19 | "scale" : "1x"
20 | },
21 | {
22 | "size" : "29x29",
23 | "idiom" : "iphone",
24 | "filename" : "Icon-App-29x29@2x.png",
25 | "scale" : "2x"
26 | },
27 | {
28 | "size" : "29x29",
29 | "idiom" : "iphone",
30 | "filename" : "Icon-App-29x29@3x.png",
31 | "scale" : "3x"
32 | },
33 | {
34 | "size" : "40x40",
35 | "idiom" : "iphone",
36 | "filename" : "Icon-App-40x40@2x.png",
37 | "scale" : "2x"
38 | },
39 | {
40 | "size" : "40x40",
41 | "idiom" : "iphone",
42 | "filename" : "Icon-App-40x40@3x.png",
43 | "scale" : "3x"
44 | },
45 | {
46 | "size" : "57x57",
47 | "idiom" : "iphone",
48 | "filename" : "Icon-App-57x57@1x.png",
49 | "scale" : "1x"
50 | },
51 | {
52 | "size" : "57x57",
53 | "idiom" : "iphone",
54 | "filename" : "Icon-App-57x57@2x.png",
55 | "scale" : "2x"
56 | },
57 | {
58 | "size" : "60x60",
59 | "idiom" : "iphone",
60 | "filename" : "Icon-App-60x60@2x.png",
61 | "scale" : "2x"
62 | },
63 | {
64 | "size" : "60x60",
65 | "idiom" : "iphone",
66 | "filename" : "Icon-App-60x60@3x.png",
67 | "scale" : "3x"
68 | },
69 | {
70 | "size" : "20x20",
71 | "idiom" : "ipad",
72 | "filename" : "Icon-App-20x20@1x.png",
73 | "scale" : "1x"
74 | },
75 | {
76 | "size" : "20x20",
77 | "idiom" : "ipad",
78 | "filename" : "Icon-App-20x20@2x.png",
79 | "scale" : "2x"
80 | },
81 | {
82 | "size" : "29x29",
83 | "idiom" : "ipad",
84 | "filename" : "Icon-App-29x29@1x.png",
85 | "scale" : "1x"
86 | },
87 | {
88 | "size" : "29x29",
89 | "idiom" : "ipad",
90 | "filename" : "Icon-App-29x29@2x.png",
91 | "scale" : "2x"
92 | },
93 | {
94 | "size" : "40x40",
95 | "idiom" : "ipad",
96 | "filename" : "Icon-App-40x40@1x.png",
97 | "scale" : "1x"
98 | },
99 | {
100 | "size" : "40x40",
101 | "idiom" : "ipad",
102 | "filename" : "Icon-App-40x40@2x.png",
103 | "scale" : "2x"
104 | },
105 | {
106 | "size" : "76x76",
107 | "idiom" : "ipad",
108 | "filename" : "Icon-App-76x76@1x.png",
109 | "scale" : "1x"
110 | },
111 | {
112 | "size" : "76x76",
113 | "idiom" : "ipad",
114 | "filename" : "Icon-App-76x76@2x.png",
115 | "scale" : "2x"
116 | },
117 | {
118 | "size" : "83.5x83.5",
119 | "idiom" : "ipad",
120 | "filename" : "Icon-App-83.5x83.5@2x.png",
121 | "scale" : "2x"
122 | },
123 | {
124 | "size" : "1024x1024",
125 | "idiom" : "ios-marketing",
126 | "filename" : "Itunes1024.png",
127 | "scale" : "1x"
128 | }
129 | ],
130 | "info" : {
131 | "version" : 1,
132 | "author" : "xcode"
133 | }
134 | }
--------------------------------------------------------------------------------
/PasteBin/PasteBin/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jonluca/PasteBinApp/2c4132b3cd488848431b4bb786d0acf0c8c41310/PasteBin/PasteBin/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png
--------------------------------------------------------------------------------
/PasteBin/PasteBin/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jonluca/PasteBinApp/2c4132b3cd488848431b4bb786d0acf0c8c41310/PasteBin/PasteBin/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png
--------------------------------------------------------------------------------
/PasteBin/PasteBin/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jonluca/PasteBinApp/2c4132b3cd488848431b4bb786d0acf0c8c41310/PasteBin/PasteBin/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png
--------------------------------------------------------------------------------
/PasteBin/PasteBin/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jonluca/PasteBinApp/2c4132b3cd488848431b4bb786d0acf0c8c41310/PasteBin/PasteBin/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png
--------------------------------------------------------------------------------
/PasteBin/PasteBin/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jonluca/PasteBinApp/2c4132b3cd488848431b4bb786d0acf0c8c41310/PasteBin/PasteBin/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png
--------------------------------------------------------------------------------
/PasteBin/PasteBin/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jonluca/PasteBinApp/2c4132b3cd488848431b4bb786d0acf0c8c41310/PasteBin/PasteBin/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png
--------------------------------------------------------------------------------
/PasteBin/PasteBin/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jonluca/PasteBinApp/2c4132b3cd488848431b4bb786d0acf0c8c41310/PasteBin/PasteBin/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png
--------------------------------------------------------------------------------
/PasteBin/PasteBin/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jonluca/PasteBinApp/2c4132b3cd488848431b4bb786d0acf0c8c41310/PasteBin/PasteBin/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png
--------------------------------------------------------------------------------
/PasteBin/PasteBin/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jonluca/PasteBinApp/2c4132b3cd488848431b4bb786d0acf0c8c41310/PasteBin/PasteBin/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png
--------------------------------------------------------------------------------
/PasteBin/PasteBin/Assets.xcassets/AppIcon.appiconset/Icon-App-57x57@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jonluca/PasteBinApp/2c4132b3cd488848431b4bb786d0acf0c8c41310/PasteBin/PasteBin/Assets.xcassets/AppIcon.appiconset/Icon-App-57x57@1x.png
--------------------------------------------------------------------------------
/PasteBin/PasteBin/Assets.xcassets/AppIcon.appiconset/Icon-App-57x57@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jonluca/PasteBinApp/2c4132b3cd488848431b4bb786d0acf0c8c41310/PasteBin/PasteBin/Assets.xcassets/AppIcon.appiconset/Icon-App-57x57@2x.png
--------------------------------------------------------------------------------
/PasteBin/PasteBin/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jonluca/PasteBinApp/2c4132b3cd488848431b4bb786d0acf0c8c41310/PasteBin/PasteBin/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png
--------------------------------------------------------------------------------
/PasteBin/PasteBin/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jonluca/PasteBinApp/2c4132b3cd488848431b4bb786d0acf0c8c41310/PasteBin/PasteBin/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png
--------------------------------------------------------------------------------
/PasteBin/PasteBin/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jonluca/PasteBinApp/2c4132b3cd488848431b4bb786d0acf0c8c41310/PasteBin/PasteBin/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png
--------------------------------------------------------------------------------
/PasteBin/PasteBin/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jonluca/PasteBinApp/2c4132b3cd488848431b4bb786d0acf0c8c41310/PasteBin/PasteBin/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png
--------------------------------------------------------------------------------
/PasteBin/PasteBin/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jonluca/PasteBinApp/2c4132b3cd488848431b4bb786d0acf0c8c41310/PasteBin/PasteBin/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png
--------------------------------------------------------------------------------
/PasteBin/PasteBin/Assets.xcassets/AppIcon.appiconset/Itunes1024.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jonluca/PasteBinApp/2c4132b3cd488848431b4bb786d0acf0c8c41310/PasteBin/PasteBin/Assets.xcassets/AppIcon.appiconset/Itunes1024.png
--------------------------------------------------------------------------------
/PasteBin/PasteBin/Assets.xcassets/ButtonCentreDownArrow.imageset/ButtonCentreDownArrow@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jonluca/PasteBinApp/2c4132b3cd488848431b4bb786d0acf0c8c41310/PasteBin/PasteBin/Assets.xcassets/ButtonCentreDownArrow.imageset/ButtonCentreDownArrow@2x.png
--------------------------------------------------------------------------------
/PasteBin/PasteBin/Assets.xcassets/ButtonCentreDownArrow.imageset/ButtonCentreDownArrow@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jonluca/PasteBinApp/2c4132b3cd488848431b4bb786d0acf0c8c41310/PasteBin/PasteBin/Assets.xcassets/ButtonCentreDownArrow.imageset/ButtonCentreDownArrow@3x.png
--------------------------------------------------------------------------------
/PasteBin/PasteBin/Assets.xcassets/ButtonCentreDownArrow.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "filename" : "ButtonCentreDownArrow@2x.png",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "filename" : "ButtonCentreDownArrow@3x.png",
15 | "scale" : "3x"
16 | }
17 | ],
18 | "info" : {
19 | "version" : 1,
20 | "author" : "xcode"
21 | }
22 | }
--------------------------------------------------------------------------------
/PasteBin/PasteBin/Assets.xcassets/ButtonCentreTicked.imageset/ButtonCentreTicked@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jonluca/PasteBinApp/2c4132b3cd488848431b4bb786d0acf0c8c41310/PasteBin/PasteBin/Assets.xcassets/ButtonCentreTicked.imageset/ButtonCentreTicked@2x.png
--------------------------------------------------------------------------------
/PasteBin/PasteBin/Assets.xcassets/ButtonCentreTicked.imageset/ButtonCentreTicked@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jonluca/PasteBinApp/2c4132b3cd488848431b4bb786d0acf0c8c41310/PasteBin/PasteBin/Assets.xcassets/ButtonCentreTicked.imageset/ButtonCentreTicked@3x.png
--------------------------------------------------------------------------------
/PasteBin/PasteBin/Assets.xcassets/ButtonCentreTicked.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "filename" : "ButtonCentreTicked@2x.png",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "filename" : "ButtonCentreTicked@3x.png",
15 | "scale" : "3x"
16 | }
17 | ],
18 | "info" : {
19 | "version" : 1,
20 | "author" : "xcode"
21 | }
22 | }
--------------------------------------------------------------------------------
/PasteBin/PasteBin/Assets.xcassets/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | }
6 | }
--------------------------------------------------------------------------------
/PasteBin/PasteBin/Assets.xcassets/Icon-60.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jonluca/PasteBinApp/2c4132b3cd488848431b4bb786d0acf0c8c41310/PasteBin/PasteBin/Assets.xcassets/Icon-60.png
--------------------------------------------------------------------------------
/PasteBin/PasteBin/Assets.xcassets/Icon-72.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jonluca/PasteBinApp/2c4132b3cd488848431b4bb786d0acf0c8c41310/PasteBin/PasteBin/Assets.xcassets/Icon-72.png
--------------------------------------------------------------------------------
/PasteBin/PasteBin/Assets.xcassets/Icon-72@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jonluca/PasteBinApp/2c4132b3cd488848431b4bb786d0acf0c8c41310/PasteBin/PasteBin/Assets.xcassets/Icon-72@2x.png
--------------------------------------------------------------------------------
/PasteBin/PasteBin/Assets.xcassets/Icon-Small-50.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jonluca/PasteBinApp/2c4132b3cd488848431b4bb786d0acf0c8c41310/PasteBin/PasteBin/Assets.xcassets/Icon-Small-50.png
--------------------------------------------------------------------------------
/PasteBin/PasteBin/Assets.xcassets/Icon-Small-50@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jonluca/PasteBinApp/2c4132b3cd488848431b4bb786d0acf0c8c41310/PasteBin/PasteBin/Assets.xcassets/Icon-Small-50@2x.png
--------------------------------------------------------------------------------
/PasteBin/PasteBin/Assets.xcassets/Icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jonluca/PasteBinApp/2c4132b3cd488848431b4bb786d0acf0c8c41310/PasteBin/PasteBin/Assets.xcassets/Icon.png
--------------------------------------------------------------------------------
/PasteBin/PasteBin/Assets.xcassets/Icon@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jonluca/PasteBinApp/2c4132b3cd488848431b4bb786d0acf0c8c41310/PasteBin/PasteBin/Assets.xcassets/Icon@2x.png
--------------------------------------------------------------------------------
/PasteBin/PasteBin/Assets.xcassets/IconAbout.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "filename" : "IconAbout@2x.png",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "filename" : "IconAbout@3x.png",
15 | "scale" : "3x"
16 | }
17 | ],
18 | "info" : {
19 | "version" : 1,
20 | "author" : "xcode"
21 | }
22 | }
--------------------------------------------------------------------------------
/PasteBin/PasteBin/Assets.xcassets/IconAbout.imageset/IconAbout@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jonluca/PasteBinApp/2c4132b3cd488848431b4bb786d0acf0c8c41310/PasteBin/PasteBin/Assets.xcassets/IconAbout.imageset/IconAbout@2x.png
--------------------------------------------------------------------------------
/PasteBin/PasteBin/Assets.xcassets/IconAbout.imageset/IconAbout@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jonluca/PasteBinApp/2c4132b3cd488848431b4bb786d0acf0c8c41310/PasteBin/PasteBin/Assets.xcassets/IconAbout.imageset/IconAbout@3x.png
--------------------------------------------------------------------------------
/PasteBin/PasteBin/Assets.xcassets/IconCreatePaste.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "filename" : "IconCreatePaste@2x.png",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "filename" : "IconCreatePaste@3x.png",
15 | "scale" : "3x"
16 | }
17 | ],
18 | "info" : {
19 | "version" : 1,
20 | "author" : "xcode"
21 | }
22 | }
--------------------------------------------------------------------------------
/PasteBin/PasteBin/Assets.xcassets/IconCreatePaste.imageset/IconCreatePaste@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jonluca/PasteBinApp/2c4132b3cd488848431b4bb786d0acf0c8c41310/PasteBin/PasteBin/Assets.xcassets/IconCreatePaste.imageset/IconCreatePaste@2x.png
--------------------------------------------------------------------------------
/PasteBin/PasteBin/Assets.xcassets/IconCreatePaste.imageset/IconCreatePaste@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jonluca/PasteBinApp/2c4132b3cd488848431b4bb786d0acf0c8c41310/PasteBin/PasteBin/Assets.xcassets/IconCreatePaste.imageset/IconCreatePaste@3x.png
--------------------------------------------------------------------------------
/PasteBin/PasteBin/Assets.xcassets/IconEdit.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "filename" : "IconEdit@2x.png",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "filename" : "IconEdit@3x.png",
15 | "scale" : "3x"
16 | }
17 | ],
18 | "info" : {
19 | "version" : 1,
20 | "author" : "xcode"
21 | }
22 | }
--------------------------------------------------------------------------------
/PasteBin/PasteBin/Assets.xcassets/IconEdit.imageset/IconEdit@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jonluca/PasteBinApp/2c4132b3cd488848431b4bb786d0acf0c8c41310/PasteBin/PasteBin/Assets.xcassets/IconEdit.imageset/IconEdit@2x.png
--------------------------------------------------------------------------------
/PasteBin/PasteBin/Assets.xcassets/IconEdit.imageset/IconEdit@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jonluca/PasteBinApp/2c4132b3cd488848431b4bb786d0acf0c8c41310/PasteBin/PasteBin/Assets.xcassets/IconEdit.imageset/IconEdit@3x.png
--------------------------------------------------------------------------------
/PasteBin/PasteBin/Assets.xcassets/IconHelp.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "filename" : "IconHelp@2x.png",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "filename" : "IconHelp@3x.png",
15 | "scale" : "3x"
16 | }
17 | ],
18 | "info" : {
19 | "version" : 1,
20 | "author" : "xcode"
21 | }
22 | }
--------------------------------------------------------------------------------
/PasteBin/PasteBin/Assets.xcassets/IconHelp.imageset/IconHelp@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jonluca/PasteBinApp/2c4132b3cd488848431b4bb786d0acf0c8c41310/PasteBin/PasteBin/Assets.xcassets/IconHelp.imageset/IconHelp@2x.png
--------------------------------------------------------------------------------
/PasteBin/PasteBin/Assets.xcassets/IconHelp.imageset/IconHelp@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jonluca/PasteBinApp/2c4132b3cd488848431b4bb786d0acf0c8c41310/PasteBin/PasteBin/Assets.xcassets/IconHelp.imageset/IconHelp@3x.png
--------------------------------------------------------------------------------
/PasteBin/PasteBin/Assets.xcassets/IconHistory.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "filename" : "IconHistory@2x.png",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "filename" : "IconHistory@3x.png",
15 | "scale" : "3x"
16 | }
17 | ],
18 | "info" : {
19 | "version" : 1,
20 | "author" : "xcode"
21 | }
22 | }
--------------------------------------------------------------------------------
/PasteBin/PasteBin/Assets.xcassets/IconHistory.imageset/IconHistory@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jonluca/PasteBinApp/2c4132b3cd488848431b4bb786d0acf0c8c41310/PasteBin/PasteBin/Assets.xcassets/IconHistory.imageset/IconHistory@2x.png
--------------------------------------------------------------------------------
/PasteBin/PasteBin/Assets.xcassets/IconHistory.imageset/IconHistory@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jonluca/PasteBinApp/2c4132b3cd488848431b4bb786d0acf0c8c41310/PasteBin/PasteBin/Assets.xcassets/IconHistory.imageset/IconHistory@3x.png
--------------------------------------------------------------------------------
/PasteBin/PasteBin/Assets.xcassets/IconOptions.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "filename" : "IconOptions@2x.png",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "filename" : "IconOptions@3x.png",
15 | "scale" : "3x"
16 | }
17 | ],
18 | "info" : {
19 | "version" : 1,
20 | "author" : "xcode"
21 | }
22 | }
--------------------------------------------------------------------------------
/PasteBin/PasteBin/Assets.xcassets/IconOptions.imageset/IconOptions@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jonluca/PasteBinApp/2c4132b3cd488848431b4bb786d0acf0c8c41310/PasteBin/PasteBin/Assets.xcassets/IconOptions.imageset/IconOptions@2x.png
--------------------------------------------------------------------------------
/PasteBin/PasteBin/Assets.xcassets/IconOptions.imageset/IconOptions@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jonluca/PasteBinApp/2c4132b3cd488848431b4bb786d0acf0c8c41310/PasteBin/PasteBin/Assets.xcassets/IconOptions.imageset/IconOptions@3x.png
--------------------------------------------------------------------------------
/PasteBin/PasteBin/Assets.xcassets/IconQuickCreatePaste.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "filename" : "IconQuickCreatePaste@2x.png",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "filename" : "IconQuickCreatePaste@3x.png",
15 | "scale" : "3x"
16 | }
17 | ],
18 | "info" : {
19 | "version" : 1,
20 | "author" : "xcode"
21 | }
22 | }
--------------------------------------------------------------------------------
/PasteBin/PasteBin/Assets.xcassets/IconQuickCreatePaste.imageset/IconQuickCreatePaste@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jonluca/PasteBinApp/2c4132b3cd488848431b4bb786d0acf0c8c41310/PasteBin/PasteBin/Assets.xcassets/IconQuickCreatePaste.imageset/IconQuickCreatePaste@2x.png
--------------------------------------------------------------------------------
/PasteBin/PasteBin/Assets.xcassets/IconQuickCreatePaste.imageset/IconQuickCreatePaste@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jonluca/PasteBinApp/2c4132b3cd488848431b4bb786d0acf0c8c41310/PasteBin/PasteBin/Assets.xcassets/IconQuickCreatePaste.imageset/IconQuickCreatePaste@3x.png
--------------------------------------------------------------------------------
/PasteBin/PasteBin/Assets.xcassets/IconSyntax.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "filename" : "IconSyntax@2x.png",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "filename" : "IconSyntax@3x.png",
15 | "scale" : "3x"
16 | }
17 | ],
18 | "info" : {
19 | "version" : 1,
20 | "author" : "xcode"
21 | }
22 | }
--------------------------------------------------------------------------------
/PasteBin/PasteBin/Assets.xcassets/IconSyntax.imageset/IconSyntax@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jonluca/PasteBinApp/2c4132b3cd488848431b4bb786d0acf0c8c41310/PasteBin/PasteBin/Assets.xcassets/IconSyntax.imageset/IconSyntax@2x.png
--------------------------------------------------------------------------------
/PasteBin/PasteBin/Assets.xcassets/IconSyntax.imageset/IconSyntax@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jonluca/PasteBinApp/2c4132b3cd488848431b4bb786d0acf0c8c41310/PasteBin/PasteBin/Assets.xcassets/IconSyntax.imageset/IconSyntax@3x.png
--------------------------------------------------------------------------------
/PasteBin/PasteBin/Assets.xcassets/Itunes1024.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jonluca/PasteBinApp/2c4132b3cd488848431b4bb786d0acf0c8c41310/PasteBin/PasteBin/Assets.xcassets/Itunes1024.png
--------------------------------------------------------------------------------
/PasteBin/PasteBin/Assets.xcassets/ItunesArtwork.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jonluca/PasteBinApp/2c4132b3cd488848431b4bb786d0acf0c8c41310/PasteBin/PasteBin/Assets.xcassets/ItunesArtwork.png
--------------------------------------------------------------------------------
/PasteBin/PasteBin/Assets.xcassets/ItunesArtwork@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jonluca/PasteBinApp/2c4132b3cd488848431b4bb786d0acf0c8c41310/PasteBin/PasteBin/Assets.xcassets/ItunesArtwork@2x.png
--------------------------------------------------------------------------------
/PasteBin/PasteBin/Assets.xcassets/LogoGrey.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "filename" : "LogoGrey@2x.png",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "filename" : "LogoGrey@3x.png",
15 | "scale" : "3x"
16 | }
17 | ],
18 | "info" : {
19 | "version" : 1,
20 | "author" : "xcode"
21 | }
22 | }
--------------------------------------------------------------------------------
/PasteBin/PasteBin/Assets.xcassets/LogoGrey.imageset/LogoGrey@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jonluca/PasteBinApp/2c4132b3cd488848431b4bb786d0acf0c8c41310/PasteBin/PasteBin/Assets.xcassets/LogoGrey.imageset/LogoGrey@2x.png
--------------------------------------------------------------------------------
/PasteBin/PasteBin/Assets.xcassets/LogoGrey.imageset/LogoGrey@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jonluca/PasteBinApp/2c4132b3cd488848431b4bb786d0acf0c8c41310/PasteBin/PasteBin/Assets.xcassets/LogoGrey.imageset/LogoGrey@3x.png
--------------------------------------------------------------------------------
/PasteBin/PasteBin/Assets.xcassets/LogoWithColour.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "filename" : "LogoWithColour@2x.png",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "filename" : "LogoWithColour@3x.png",
15 | "scale" : "3x"
16 | }
17 | ],
18 | "info" : {
19 | "version" : 1,
20 | "author" : "xcode"
21 | }
22 | }
--------------------------------------------------------------------------------
/PasteBin/PasteBin/Assets.xcassets/LogoWithColour.imageset/LogoWithColour@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jonluca/PasteBinApp/2c4132b3cd488848431b4bb786d0acf0c8c41310/PasteBin/PasteBin/Assets.xcassets/LogoWithColour.imageset/LogoWithColour@2x.png
--------------------------------------------------------------------------------
/PasteBin/PasteBin/Assets.xcassets/LogoWithColour.imageset/LogoWithColour@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jonluca/PasteBinApp/2c4132b3cd488848431b4bb786d0acf0c8c41310/PasteBin/PasteBin/Assets.xcassets/LogoWithColour.imageset/LogoWithColour@3x.png
--------------------------------------------------------------------------------
/PasteBin/PasteBin/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 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
--------------------------------------------------------------------------------
/PasteBin/PasteBin/HelpViewController.swift:
--------------------------------------------------------------------------------
1 | //
2 | // HelpViewController.swift
3 | // PasteBin
4 | //
5 | // Created by JonLuca De Caro on 12/29/16.
6 | // Copyright © 2016 JonLuca De Caro. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | class HelpViewController: UIViewController {
12 | override func viewDidLoad() {
13 | super.viewDidLoad()
14 | }
15 |
16 | var previousStoryboardIsMainView = false
17 |
18 | @IBAction func buttonBack(_: Any) {
19 | if previousStoryboardIsMainView {
20 | // Transition to main view in order to reset background scrolling
21 | let mainStoryboard = UIStoryboard(name: "Main", bundle: nil)
22 | let vC: ViewController = mainStoryboard.instantiateViewController(withIdentifier: "mainView") as! ViewController
23 | present(vC, animated: true, completion: nil)
24 | } else {
25 | dismiss(animated: true, completion: nil)
26 | }
27 | }
28 |
29 | @IBAction func done(_: Any) {
30 | if previousStoryboardIsMainView {
31 | // Transition to main view in order to reset background scrolling
32 | let mainStoryboard = UIStoryboard(name: "Main", bundle: nil)
33 | let vC: ViewController = mainStoryboard.instantiateViewController(withIdentifier: "mainView") as! ViewController
34 | present(vC, animated: true, completion: nil)
35 | } else {
36 | dismiss(animated: true, completion: nil)
37 | }
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/PasteBin/PasteBin/HistoryViewController.swift:
--------------------------------------------------------------------------------
1 | //
2 | // HistoryViewController.swift
3 | // PasteBin
4 | //
5 | // Created by Henrik Gustavii on 25/05/2018.
6 | // Copyright © 2018 JonLuca De Caro. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | class HistoryViewController: UIViewController, UITableViewDelegate, UITableViewDataSource {
12 | // Previous pastes array
13 | var savedList: [String] = []
14 |
15 | var previousStoryboardIsMainView = false
16 |
17 | override func viewDidLoad() {
18 | super.viewDidLoad()
19 |
20 | // Load previous pastes to savedList array
21 | savedList = PastebinHelper().loadSavedListItems()
22 | savedList = savedList.reversed()
23 | }
24 |
25 | @IBAction func donePress(_: Any) {
26 | if previousStoryboardIsMainView {
27 | // Transition to main view in order to reset background scrolling
28 | let mainStoryboard = UIStoryboard(name: "Main", bundle: nil)
29 | let vC: ViewController = mainStoryboard.instantiateViewController(withIdentifier: "mainView") as! ViewController
30 | present(vC, animated: true, completion: nil)
31 | } else {
32 | dismiss(animated: true, completion: nil)
33 | }
34 | }
35 |
36 | @IBAction func buttonBack(_: Any) {
37 | if previousStoryboardIsMainView {
38 | // Transition to main view in order to reset background scrolling
39 | let mainStoryboard = UIStoryboard(name: "Main", bundle: nil)
40 | let vC: ViewController = mainStoryboard.instantiateViewController(withIdentifier: "mainView") as! ViewController
41 | present(vC, animated: true, completion: nil)
42 | } else {
43 | dismiss(animated: true, completion: nil)
44 | }
45 | }
46 |
47 | func tableView(_: UITableView, numberOfRowsInSection _: Int) -> Int {
48 | return savedList.count
49 | }
50 |
51 | func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
52 | let cell = tableView.dequeueReusableCell(withIdentifier: "HistoryCell", for: indexPath)
53 |
54 | cell.textLabel?.text = savedList[indexPath.item]
55 | cell.textLabel?.textColor = UIColor.white
56 |
57 | return cell
58 | }
59 |
60 | func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
61 | if tableView.cellForRow(at: indexPath) != nil {
62 | let item = savedList[indexPath.row]
63 | UIPasteboard.general.string = item
64 |
65 | // Alert pop-up copied from PastebinHelper.swift
66 | let alertController = UIAlertController(title: "", message: "Share link or copy to clipboard?", preferredStyle: .alert)
67 | let shareAction = UIAlertAction(title: "Share", style: .default) { _ in
68 |
69 | let itemURL = URL(string: item) // NSURL(string: item)
70 | let vc = UIActivityViewController(activityItems: [itemURL ?? "No link found", item], applicationActivities: [])
71 | UIApplication.topViewController()?.present(vc, animated: true)
72 | print("responseString to share = \(String(describing: item))")
73 | }
74 | let copyAction = UIAlertAction(title: "Copy", style: .default, handler: { _ in
75 | UIPasteboard.general.string = item
76 | print("responseString to copy = \(String(describing: item))")
77 | })
78 |
79 | alertController.addAction(shareAction)
80 | alertController.addAction(copyAction)
81 | present(alertController, animated: true) {}
82 |
83 | tableView.deselectRow(at: indexPath, animated: true) // to stop greying persisting
84 | }
85 | }
86 | }
87 |
--------------------------------------------------------------------------------
/PasteBin/PasteBin/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 | 2.0.3
19 | CFBundleVersion
20 | 1
21 | LSRequiresIPhoneOS
22 |
23 | NSAppTransportSecurity
24 |
25 | NSAllowsArbitraryLoads
26 |
27 |
28 | UIApplicationShortcutItems
29 |
30 |
31 | UIApplicationShortcutItemIconType
32 | UIApplicationShortcutIconTypeInvitation
33 | UIApplicationShortcutItemTitle
34 | Quick Paste
35 | UIApplicationShortcutItemType
36 | com.jonluca.pastebinapp.quickpaste
37 |
38 |
39 | UILaunchStoryboardName
40 | LaunchScreen
41 | UIMainStoryboardFile
42 | Main
43 | UIRequiredDeviceCapabilities
44 |
45 | armv7
46 |
47 | UISupportedInterfaceOrientations
48 |
49 | UIInterfaceOrientationPortrait
50 | UIInterfaceOrientationPortraitUpsideDown
51 | UIInterfaceOrientationLandscapeRight
52 | UIInterfaceOrientationLandscapeLeft
53 |
54 | UISupportedInterfaceOrientations~ipad
55 |
56 | UIInterfaceOrientationPortrait
57 | UIInterfaceOrientationPortraitUpsideDown
58 | UIInterfaceOrientationLandscapeLeft
59 | UIInterfaceOrientationLandscapeRight
60 |
61 | UIViewControllerBasedStatusBarAppearance
62 |
63 |
64 |
65 |
--------------------------------------------------------------------------------
/PasteBin/PasteBin/MasterOptionsViewController.swift:
--------------------------------------------------------------------------------
1 | //
2 | // MasterOptionsViewController.swift
3 | // PasteBin
4 | //
5 | // Created by Henrik Gustavii on 30/05/2018.
6 | // Copyright © 2018 JonLuca De Caro. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | class MasterOptionsViewController: UIViewController {
12 | static var previousStoryboardIsMainView = false
13 |
14 | @IBOutlet var optionsContainer: UITableView!
15 |
16 | override func viewDidLoad() {
17 | super.viewDidLoad()
18 |
19 | // Do any additional setup after loading the view.
20 | }
21 |
22 | @IBAction func buttonBack(_: Any) {
23 | if MasterOptionsViewController.previousStoryboardIsMainView {
24 | // Transition to main view in order to reset background scrolling
25 | let mainStoryboard = UIStoryboard(name: "Main", bundle: nil)
26 | let vC: ViewController = mainStoryboard.instantiateViewController(withIdentifier: "mainView") as! ViewController
27 | vC.modalTransitionStyle = .coverVertical
28 | present(vC, animated: true, completion: nil)
29 | } else {
30 | dismiss(animated: true, completion: nil)
31 | }
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/PasteBin/PasteBin/NewOptionsViewController.swift:
--------------------------------------------------------------------------------
1 | //
2 | // NewOptionsViewController.swift
3 | // PasteBin
4 | //
5 | // Created by Henrik Gustavii on 26/05/2018.
6 | // Copyright © 2018 JonLuca De Caro. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | class NewOptionsViewController: UITableViewController {
12 | @IBOutlet var textLabel: UILabel!
13 | @IBOutlet var unlistedSwitch: UISwitch!
14 | @IBOutlet var syntaxSwitch: UISwitch!
15 |
16 | @IBOutlet var quickPasteTitle: UITextField!
17 |
18 | let languages = SyntaxLibraries().languages
19 |
20 | var previousStoryboardIsMainView = MasterOptionsViewController.previousStoryboardIsMainView
21 |
22 | override func viewDidLoad() {
23 | super.viewDidLoad()
24 | let defaults = UserDefaults.standard
25 | // Set Unlisted
26 | if defaults.object(forKey: "SwitchState") != nil {
27 | unlistedSwitch.isOn = defaults.bool(forKey: "SwitchState")
28 | }
29 | // Set language
30 | if defaults.object(forKey: "selectedText") != nil {
31 | textLabel.text = languages[defaults.integer(forKey: "selectedText")]
32 | } else {
33 | textLabel.text = "None"
34 | defaults.set(145, forKey: "selectedText")
35 | }
36 | // Set Syntax highlighter
37 | if defaults.object(forKey: "SyntaxState") != nil {
38 | syntaxSwitch.isOn = defaults.bool(forKey: "SyntaxState")
39 | }
40 | // Set quickpaste title
41 | if quickPasteTitle.text != nil {
42 | quickPasteTitle.text = defaults.string(forKey: "quickPasteTitle")
43 | }
44 |
45 | tableView.isScrollEnabled = true
46 | }
47 |
48 | override func viewWillAppear(_ animated: Bool) {
49 | super.viewDidAppear(animated)
50 | let defaults = UserDefaults.standard
51 |
52 | if defaults.object(forKey: "SwitchState") != nil {
53 | unlistedSwitch.isOn = defaults.bool(forKey: "SwitchState")
54 | }
55 | // Populates text before it shows, to prevent animation lags
56 | if defaults.object(forKey: "selectedText") != nil {
57 | textLabel.text = languages[defaults.integer(forKey: "selectedText")]
58 | } else {
59 | textLabel.text = "None"
60 | defaults.set(145, forKey: "selectedText")
61 | }
62 | if defaults.object(forKey: "SyntaxState") != nil {
63 | syntaxSwitch.isOn = defaults.bool(forKey: "SyntaxState")
64 | }
65 | }
66 |
67 | @IBAction func save(_: Any) {
68 | let defaults = UserDefaults.standard
69 | if unlistedSwitch.isOn {
70 | defaults.set(true, forKey: "SwitchState")
71 | } else {
72 | defaults.set(false, forKey: "SwitchState")
73 | }
74 | if quickPasteTitle.text != nil {
75 | defaults.set(quickPasteTitle.text, forKey: "quickPasteTitle")
76 | }
77 |
78 | if syntaxSwitch.isOn {
79 | defaults.set(true, forKey: "SyntaxState")
80 | } else {
81 | defaults.set(false, forKey: "SyntaxState")
82 | }
83 | if quickPasteTitle.text != nil {
84 | defaults.set(quickPasteTitle.text, forKey: "quickPasteTitle")
85 | }
86 |
87 | // Transition to main view in order to reset background scrolling
88 | if previousStoryboardIsMainView {
89 | // Transition to main view in order to reset background scrolling
90 | let mainStoryboard = UIStoryboard(name: "Main", bundle: nil)
91 | let vC: ViewController = mainStoryboard.instantiateViewController(withIdentifier: "mainView") as! ViewController
92 | present(vC, animated: true, completion: nil)
93 | } else {
94 | dismiss(animated: true, completion: nil)
95 | }
96 | }
97 |
98 | @IBAction func unlistedChange(_: Any) {
99 | let defaults = UserDefaults.standard
100 |
101 | if unlistedSwitch.isOn {
102 | defaults.set(true, forKey: "SwitchState")
103 | } else {
104 | defaults.set(false, forKey: "SwitchState")
105 | }
106 | }
107 |
108 | @IBAction func syntaxChange(_: Any) {
109 | let defaults = UserDefaults.standard
110 |
111 | if syntaxSwitch.isOn {
112 | defaults.set(true, forKey: "SyntaxState")
113 | } else {
114 | defaults.set(false, forKey: "SyntaxState")
115 | }
116 | }
117 |
118 | // Twitter
119 | @IBAction func twitterHandle(_: Any) {
120 | UIApplication.shared.open(URL(string: "http://www.twitter.com/jonlucadecaro")!, options: convertToUIApplicationOpenExternalURLOptionsKeyDictionary([:]), completionHandler: nil)
121 | }
122 |
123 | // Donate
124 | @IBAction func donate(_: Any) {
125 | UIApplication.shared.open(URL(string: "https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=TV28RGXB52DUA")!, options: convertToUIApplicationOpenExternalURLOptionsKeyDictionary([:]), completionHandler: nil)
126 | }
127 |
128 | // Pastebin
129 | @IBAction func pastebin(_: Any) {
130 | UIApplication.shared.open(URL(string: "http://www.pastebin.com")!, options: convertToUIApplicationOpenExternalURLOptionsKeyDictionary([:]), completionHandler: nil)
131 | }
132 | }
133 |
134 | // Helper function inserted by Swift 4.2 migrator.
135 | fileprivate func convertToUIApplicationOpenExternalURLOptionsKeyDictionary(_ input: [String: Any]) -> [UIApplication.OpenExternalURLOptionsKey: Any] {
136 | return Dictionary(uniqueKeysWithValues: input.map { key, value in (UIApplication.OpenExternalURLOptionsKey(rawValue: key), value) })
137 | }
138 |
--------------------------------------------------------------------------------
/PasteBin/PasteBin/PasteBin.entitlements:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | com.apple.developer.icloud-container-identifiers
6 |
7 | iCloud.$(CFBundleIdentifier)
8 |
9 | com.apple.developer.icloud-services
10 |
11 | CloudDocuments
12 |
13 | com.apple.developer.ubiquity-container-identifiers
14 |
15 | iCloud.$(CFBundleIdentifier)
16 |
17 | com.apple.developer.ubiquity-kvstore-identifier
18 | $(TeamIdentifierPrefix)$(CFBundleIdentifier)
19 |
20 |
21 |
--------------------------------------------------------------------------------
/PasteBin/PasteBin/PasteView.swift:
--------------------------------------------------------------------------------
1 | //
2 | // PasteView.swift
3 | // PasteBin
4 | //
5 | // Created by JonLuca De Caro on 12/28/16.
6 | // Copyright © 2016 JonLuca De Caro. All rights reserved.
7 | //
8 |
9 | import AFNetworking
10 | import Highlightr
11 | import UIKit
12 |
13 | class PasteView: UIViewController, UITextViewDelegate, UIGestureRecognizerDelegate {
14 | var isCurrentlyEditing = false
15 |
16 | var previousStoryboardIsMainView = false
17 |
18 | // Previous pastes (history) array
19 | var savedList: [String] = []
20 |
21 | var submitButtonState: Bool = true
22 |
23 | let highlightr = Highlightr()
24 | var syntaxIndex: Int = 0
25 | var syntaxPastebin: String = "Syntax"
26 | var syntaxHighlightr: String = ""
27 |
28 | let languages = SyntaxLibraries().languages
29 | let highlightrSyntax = SyntaxLibraries().highlightrLanguage
30 | let postLanguage = SyntaxLibraries().postLanguage
31 |
32 | @IBOutlet var submitButton: UIBarButtonItem!
33 | @IBOutlet var backButton: UIBarButtonItem!
34 |
35 | @IBOutlet var titleText: UITextField!
36 | @IBOutlet var textView: UITextView!
37 | var placeholderLabel: UILabel!
38 |
39 | @IBAction func selectSyntaxButton() {
40 | selectSyntax()
41 | }
42 |
43 | override func viewDidLoad() {
44 | super.viewDidLoad()
45 | // Don't judge for the following code - fairly redundant but works
46 | let tapOutTextField: UITapGestureRecognizer = UITapGestureRecognizer(target: self, action: #selector(edit))
47 | textView.delegate = self
48 | textView.addGestureRecognizer(tapOutTextField)
49 | view.addGestureRecognizer(tapOutTextField)
50 |
51 | // Sets the theme of syntax highlighter. Could be made a choice in the future in Options menu.
52 | highlightr?.setTheme(to: "atom-one-dark")
53 |
54 | // Picks up the user default syntax/language that was set in options menu/view
55 | let defaults = UserDefaults.standard
56 | syntaxIndex = defaults.integer(forKey: "selectedText")
57 | syntaxPastebin = languages[syntaxIndex]
58 | syntaxHighlightr = highlightrSyntax[syntaxPastebin]!
59 |
60 | // Sets a floating placeholder in the text view
61 | placeholderLabel = UILabel()
62 | placeholderLabel.text = "Enter or paste code/text here..."
63 | placeholderLabel.font = UIFont.italicSystemFont(ofSize: (textView.font?.pointSize)!)
64 | placeholderLabel.sizeToFit()
65 | textView.addSubview(placeholderLabel)
66 | placeholderLabel.frame.origin = CGPoint(x: 5, y: (textView.font?.pointSize)! / 2)
67 | placeholderLabel.textColor = UIColor.lightGray
68 | placeholderLabel.isHidden = !textView.text.isEmpty
69 | }
70 |
71 | override func viewWillAppear(_: Bool) {
72 | super.viewWillAppear(true)
73 |
74 | // Load previous pastes to savedList array
75 | savedList = PastebinHelper().loadSavedListItems()
76 | }
77 |
78 | @IBAction func editAction(_: Any) {
79 | titleText.text = ""
80 | }
81 |
82 | @IBAction func backButtonAction(_: Any) {
83 | if !isCurrentlyEditing {
84 | if (textView.text?.isEmpty)! {
85 | if previousStoryboardIsMainView {
86 | // Transition to main view in order to reset background scrolling
87 | let mainStoryboard = UIStoryboard(name: "Main", bundle: nil)
88 | let vC: ViewController = mainStoryboard.instantiateViewController(withIdentifier: "mainView") as! ViewController
89 | present(vC, animated: true, completion: nil)
90 | } else {
91 | dismiss(animated: true, completion: nil)
92 | }
93 | } else {
94 | let alertController = UIAlertController(title: "Are you sure?", message: "You'll lose all text currently in the editor", preferredStyle: .alert)
95 | let OKAction = UIAlertAction(title: "Yes", style: .default) { _ in
96 | if self.previousStoryboardIsMainView {
97 | // Transition to main view in order to reset background scrolling
98 | let mainStoryboard = UIStoryboard(name: "Main", bundle: nil)
99 | let vC: ViewController = mainStoryboard.instantiateViewController(withIdentifier: "mainView") as! ViewController
100 | self.present(vC, animated: true, completion: nil)
101 | } else {
102 | self.dismiss(animated: true, completion: nil)
103 | }
104 | }
105 | alertController.addAction(OKAction)
106 | let NoActions = UIAlertAction(title: "Cancel", style: .default) { _ in
107 | }
108 | alertController.addAction(NoActions)
109 |
110 | present(alertController, animated: true) {}
111 | }
112 |
113 | } else {
114 | // Pops up syntax selector popup if in Editing State
115 | selectSyntax()
116 | }
117 | }
118 |
119 | @objc func edit() {
120 | isCurrentlyEditing = true
121 | submitButtonState = false
122 |
123 | let defaults = UserDefaults.standard
124 | if defaults.bool(forKey: "SyntaxState") == true {
125 | backButton.title = syntaxPastebin
126 | } else {
127 | backButton.isEnabled = false
128 | backButton.title = "Syntax Off"
129 | }
130 |
131 | submitButton.title = "Done"
132 | }
133 |
134 | @IBAction func submitButtonAction(_: AnyObject!) {
135 | if submitButtonState {
136 | let text = textView.text
137 | if (text?.isEmpty)! {
138 | let alertController = UIAlertController(title: "Oops!", message: "Text cannot be empty!", preferredStyle: .alert)
139 | let OKAction = UIAlertAction(title: "OK", style: .default) { _ in
140 | // handle response here.
141 | }
142 | alertController.addAction(OKAction)
143 | present(alertController, animated: true) {}
144 | } else {
145 | let defaults = UserDefaults.standard
146 | let postSyntax = (defaults.object(forKey: "selectedText") != nil) ? postLanguage[languages[syntaxIndex]] : "text"
147 |
148 | PastebinHelper().postToPastebin(text: text!, savedList: savedList, syntax: postSyntax!, titleText: titleText.text!)
149 | }
150 |
151 | } else {
152 | isCurrentlyEditing = false
153 | backButton.title = "Back"
154 | view.endEditing(true)
155 | backButton.isEnabled = true
156 | submitButtonState = true
157 | submitButton.title = "Submit"
158 |
159 | // Converts pasted/typed text into highlighted syntax if selected in options menu
160 | let defaults = UserDefaults.standard
161 |
162 | if defaults.object(forKey: "SyntaxState") != nil && defaults.bool(forKey: "SyntaxState") == true {
163 | let code = textView.text
164 | if syntaxHighlightr == "default" {
165 | textView.attributedText = highlightr?.highlight(code!)
166 | } else if syntaxHighlightr == "none" {
167 | textView.attributedText = NSAttributedString(string: code!)
168 | } else {
169 | textView.attributedText = highlightr?.highlight(code!, as: syntaxHighlightr)
170 | }
171 | }
172 | }
173 | }
174 |
175 | // Syntax picker method with segue via code
176 | func selectSyntax() {
177 | let sb = UIStoryboard(name: "SyntaxSelectViewController", bundle: nil)
178 | let popup = sb.instantiateInitialViewController()! as! SyntaxSelectViewController
179 | popup.syntax = syntaxPastebin
180 | popup.syntaxIndex = syntaxIndex
181 | present(popup, animated: true)
182 |
183 | // Callback closure to fetch data from popup
184 | popup.onSave = { data, index in
185 | self.syntaxHighlightr = self.highlightrSyntax[data]!
186 | self.syntaxIndex = index
187 | self.syntaxPastebin = data
188 | self.backButton.title = self.syntaxPastebin
189 | }
190 | }
191 |
192 | func textViewDidBeginEditing(_: UITextView) {
193 | edit()
194 | }
195 |
196 | func textViewDidChange(_ textView: UITextView) {
197 | placeholderLabel.isHidden = !textView.text.isEmpty
198 |
199 | isCurrentlyEditing = true
200 | submitButtonState = false
201 |
202 | let defaults = UserDefaults.standard
203 | if defaults.bool(forKey: "SyntaxState") == true {
204 | backButton.title = syntaxPastebin
205 | } else {
206 | backButton.isEnabled = false
207 | backButton.title = "Syntax Off"
208 | }
209 |
210 | submitButton.title = "Done"
211 | }
212 |
213 | func gestureRecognizer(_: UIGestureRecognizer, shouldRecognizeSimultaneouslyWith _: UIGestureRecognizer) -> Bool {
214 | return true
215 | }
216 | }
217 |
--------------------------------------------------------------------------------
/PasteBin/PasteBin/PastebinHelper.swift:
--------------------------------------------------------------------------------
1 | //
2 | // PostHelper.swift
3 | // PasteBin
4 | //
5 | // Created by Henrik Gustavii on 04/04/2018.
6 | // Copyright © 2018 JonLuca De Caro. All rights reserved.
7 | //
8 |
9 | import AFNetworking
10 | import Foundation
11 |
12 | class PastebinHelper: UIViewController {
13 | // MARK: - Post to Pastebin methods
14 |
15 | func postToPastebin(text: String, savedList originalSavedList: [String], syntax: String = "", titleText: String = "") {
16 | var responseString: String = ""
17 |
18 | if isInternetAvailable() {
19 | let defaults = UserDefaults.standard
20 |
21 | // Our dev key
22 | let api_dev_key = "&api_dev_key=" + "71788ef035e5bf63bbbd11945bd8441c"
23 | var api_paste_private = "&api_paste_private="
24 |
25 | // Unlisted or not (0=public 1=unlisted 2=private)?
26 | api_paste_private += defaults.bool(forKey: "SwitchState") ? "1" : "0"
27 |
28 | var api_paste_name = "&api_paste_name="
29 |
30 | // name or title of your paste
31 |
32 | let qpTitle = defaults.string(forKey: "quickPasteTitle") ?? "Created with Pastebin Mobile"
33 |
34 | let finalTitleText: String = titleText.isEmpty ? qpTitle : titleText
35 |
36 | api_paste_name += finalTitleText
37 |
38 | let api_paste_expire_date = "&api_paste_expire_date=" + "N"
39 |
40 | var api_paste_format = "&api_paste_format="
41 |
42 | // defaults quickpaste to no syntax i.e. "text"
43 | api_paste_format += syntax.isEmpty ? "text" : syntax
44 |
45 | let api_user_key = "&api_user_key=" + ""
46 | // if an invalid api_user_key or no key is used, the paste will be create as a guest
47 | let encoded_text = "&api_paste_code=" + (text.addingPercentEncoding(withAllowedCharacters: .urlHostAllowed))!
48 |
49 | // URL Acceptable string
50 | let encoded_title = api_paste_name.addingPercentEncoding(withAllowedCharacters: .urlHostAllowed)
51 |
52 | var request = URLRequest(url: URL(string: "http://pastebin.com/api/api_post.php")!)
53 | request.httpMethod = "POST"
54 |
55 | // convoluted but necessary for their post api
56 | var postString = "api_option=paste"
57 | postString += api_user_key
58 | postString += api_paste_private
59 | postString += encoded_title!
60 | postString += api_paste_expire_date
61 | postString += api_paste_format
62 | postString += api_dev_key + encoded_text
63 |
64 | request.httpBody = postString.data(using: .utf8)
65 | // POST request
66 | let task = URLSession.shared.dataTask(with: request) { data, response, error in
67 | guard let data = data, error == nil else {
68 | // if not connected to internet
69 | print("error=\(String(describing: error))")
70 | return
71 | }
72 |
73 | if let httpStatus = response as? HTTPURLResponse, httpStatus.statusCode != 200 { // check for http errors
74 | print("statusCode should be 200, but is \(httpStatus.statusCode)")
75 | print("response = \(String(describing: response))")
76 | let alertController = UIAlertController(title: "Error!", message: "Unknown error - HTTP Code" + String(httpStatus.statusCode), preferredStyle: .alert)
77 | let OKAction = UIAlertAction(title: "OK", style: .default) { _ in
78 | // handle response here.
79 | }
80 | alertController.addAction(OKAction)
81 | UIApplication.topViewController()?.present(alertController, animated: true) {}
82 | }
83 |
84 | responseString = String(data: data, encoding: .utf8)! // Not happy about this forced unwrap
85 |
86 | // Adding the link to the savedList array and then saving to drive
87 | var savedList: [String] = originalSavedList
88 | savedList.append(responseString)
89 | self.saveSavedListItems(savedList: savedList)
90 |
91 | let alertController = UIAlertController(title: "Success!", message: responseString + "\nShare link or copy to clipboard?", preferredStyle: .alert)
92 | let shareAction = UIAlertAction(title: "Share", style: .default) { _ in
93 |
94 | let itemURL = URL(string: responseString)
95 | let vc = UIActivityViewController(activityItems: [itemURL ?? "No link found"], applicationActivities: [])
96 | UIApplication.topViewController()?.present(vc, animated: true)
97 | print("responseString to share = \(String(describing: itemURL))")
98 | }
99 | let copyAction = UIAlertAction(title: "Copy", style: .default, handler: { _ in
100 |
101 | UIPasteboard.general.string = responseString
102 | print("responseString to copy = \(String(describing: responseString))")
103 |
104 | })
105 |
106 | alertController.addAction(shareAction)
107 | alertController.addAction(copyAction)
108 | UIApplication.topViewController()?.present(alertController, animated: true) {}
109 | }
110 | task.resume()
111 |
112 | } else {
113 | let alertController = UIAlertController(title: "Error!", message: "Not connected to the internet!", preferredStyle: .alert)
114 | let OKAction = UIAlertAction(title: "OK", style: .default) { _ in
115 | // handle response here.
116 | }
117 | alertController.addAction(OKAction)
118 | UIApplication.topViewController()?.present(alertController, animated: true) {}
119 | }
120 | }
121 |
122 | // MARK: - Save and load file/items/list methods
123 |
124 | let dataFilePath = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask).first?.appendingPathComponent("SavedList.plist")
125 |
126 | func saveSavedListItems(savedList: [String]) {
127 | let encoder = PropertyListEncoder()
128 |
129 | do {
130 | let data = try encoder.encode(savedList)
131 | try data.write(to: dataFilePath!, options: Data.WritingOptions.atomic)
132 | } catch {
133 | print("Error encoding item array!")
134 | }
135 | }
136 |
137 | func loadSavedListItems() -> [String] {
138 | var savedList: [String] = []
139 | if let data = try? Data(contentsOf: dataFilePath!) {
140 | let decoder = PropertyListDecoder()
141 | do {
142 | savedList = try decoder.decode([String].self, from: data)
143 | } catch {
144 | print("Error decoding item array!")
145 | }
146 | }
147 |
148 | return savedList
149 | }
150 |
151 | // MARK: - Internet availability check method
152 |
153 | // credit to http://stackoverflow.com/questions/39558868/check-internet-connection-ios-10
154 | // Simple check if internet is available
155 | func isInternetAvailable() -> Bool {
156 | var zeroAddress = sockaddr_in()
157 | zeroAddress.sin_len = UInt8(MemoryLayout.size(ofValue: zeroAddress))
158 | zeroAddress.sin_family = sa_family_t(AF_INET)
159 |
160 | let defaultRouteReachability = withUnsafePointer(to: &zeroAddress) {
161 | $0.withMemoryRebound(to: sockaddr.self, capacity: 1) { zeroSockAddress in
162 | SCNetworkReachabilityCreateWithAddress(nil, zeroSockAddress)
163 | }
164 | }
165 |
166 | var flags = SCNetworkReachabilityFlags()
167 | if !SCNetworkReachabilityGetFlags(defaultRouteReachability!, &flags) {
168 | return false
169 | }
170 | let isReachable = (flags.rawValue & UInt32(kSCNetworkFlagsReachable)) != 0
171 | let needsConnection = (flags.rawValue & UInt32(kSCNetworkFlagsConnectionRequired)) != 0
172 | return (isReachable && !needsConnection)
173 | }
174 | }
175 |
176 | // MARK: - Return topViewController Extension
177 |
178 | // credit to https://stackoverflow.com/questions/40015171/how-to-show-an-alert-from-another-class-in-swift
179 | extension UIApplication {
180 | static func topViewController(base: UIViewController? = UIApplication.shared.delegate?.window??.rootViewController) -> UIViewController? {
181 | if let nav = base as? UINavigationController {
182 | return topViewController(base: nav.visibleViewController)
183 | }
184 | if let tab = base as? UITabBarController, let selected = tab.selectedViewController {
185 | return topViewController(base: selected)
186 | }
187 | if let presented = base?.presentedViewController {
188 | return topViewController(base: presented)
189 | }
190 |
191 | return base
192 | }
193 | }
194 |
--------------------------------------------------------------------------------
/PasteBin/PasteBin/SyntaxSelectViewController.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 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
59 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
--------------------------------------------------------------------------------
/PasteBin/PasteBin/SyntaxSelectViewController.swift:
--------------------------------------------------------------------------------
1 | //
2 | // SyntaxSelectViewController.swift
3 | // PasteBin
4 | //
5 | // Created by Henrik Gustavii on 22/03/2018.
6 | // Copyright © 2018 JonLuca De Caro. All rights reserved.
7 | //
8 |
9 | import Highlightr
10 | import SearchTextField
11 | import UIKit
12 |
13 | class SyntaxSelectViewController: UIViewController {
14 | let languages = SyntaxLibraries().languages
15 |
16 | @IBOutlet var titleLabel: UILabel!
17 | @IBOutlet var syntaxPicker: UIPickerView!
18 | @IBOutlet var saveButton: UIButton!
19 | @IBOutlet var searchSyntaxTextField: SearchTextField!
20 |
21 | var syntax: String = ""
22 | var syntaxIndex: Int = 0
23 |
24 | // Function type that can be accessed from Callback VC (PasteView.swift)
25 | var onSave: ((_ data: String, _ index: Int) -> Void)?
26 |
27 | override func viewDidLoad() {
28 | super.viewDidLoad()
29 |
30 | syntaxPicker.delegate = self
31 | syntaxPicker.dataSource = self
32 | titleLabel.text = syntax
33 | syntaxPicker.selectRow(syntaxIndex, inComponent: 0, animated: true)
34 |
35 | // SearchTextField settings
36 | searchSyntaxTextField.filterStrings(languages)
37 | // searchSyntaxTextField.theme = SearchTextFieldTheme.darkTheme()
38 | searchSyntaxTextField.theme.bgColor = UIColor(red: 160 / 255, green: 162 / 255, blue: 164 / 255, alpha: 0.95)
39 | searchSyntaxTextField.theme.fontColor = UIColor.white
40 | searchSyntaxTextField.maxNumberOfResults = 5
41 | searchSyntaxTextField.maxResultsListHeight = 180
42 | // searchSyntaxTextField.highlightAttributes = [kCTBackgroundColorAttributeName: UIColor(red: 181/255, green: 130/255, blue: 79/255, alpha: 1), kCTFontAttributeName: UIFont.boldSystemFont(ofSize: 12)] as [NSAttributedStringKey : AnyObject]
43 |
44 | // Handles what happens when user picks an item
45 | searchSyntaxTextField.itemSelectionHandler = { item, itemPosition in
46 | let item = item[itemPosition]
47 | self.searchSyntaxTextField.text = item.title
48 | self.syntax = item.title
49 |
50 | if self.languages.contains(self.syntax) {
51 | self.syntaxIndex = self.languages.index(of: self.syntax)!
52 | self.syntaxPicker.selectRow(self.syntaxIndex, inComponent: 0, animated: true)
53 | self.titleLabel.text = self.languages[self.syntaxIndex]
54 | }
55 | }
56 | }
57 |
58 | // Sends syntax choice to pasteview and dismisses popup
59 | @IBAction func saveSyntax_TouchUpInside(_: UIButton) {
60 | onSave?(syntax, syntaxIndex)
61 |
62 | dismiss(animated: true)
63 | }
64 |
65 | @IBAction func backPress(_: UIButton) {
66 | dismiss(animated: true)
67 | }
68 |
69 | // Makes keyboard disappear by touching outside popup keyboard
70 | override func touchesBegan(_: Set, with _: UIEvent?) {
71 | view.endEditing(true)
72 | }
73 | }
74 |
75 | // UIPickerView setup
76 | extension SyntaxSelectViewController: UIPickerViewDelegate, UIPickerViewDataSource {
77 | func numberOfComponents(in _: UIPickerView) -> Int {
78 | return 1
79 | }
80 |
81 | func pickerView(_: UIPickerView, numberOfRowsInComponent _: Int) -> Int {
82 | return languages.count
83 | }
84 |
85 | func pickerView(_: UIPickerView, didSelectRow row: Int, inComponent _: Int) {
86 | titleLabel.text = languages[row]
87 | syntax = languages[row]
88 | syntaxIndex = row
89 | }
90 |
91 | func pickerView(_: UIPickerView, attributedTitleForRow row: Int, forComponent _: Int) -> NSAttributedString? {
92 | let titleData = languages[row]
93 | let myTitle = NSAttributedString(string: titleData, attributes: [NSAttributedString.Key.font: UIFont.systemFont(ofSize: 15), NSAttributedString.Key.foregroundColor: UIColor.white])
94 | return myTitle
95 | }
96 | }
97 |
--------------------------------------------------------------------------------
/PasteBin/PasteBin/TextSelectionViewController.swift:
--------------------------------------------------------------------------------
1 | //
2 | // TextSelectionViewController.swift
3 | // PasteBin
4 | //
5 | // Created by JonLuca De Caro on 1/9/17.
6 | // Copyright © 2017 JonLuca De Caro. All rights reserved.
7 | //
8 |
9 | import SearchTextField
10 | import UIKit
11 |
12 | class TextSelectionViewController: UITableViewController {
13 | // All available languages from the pastebin API
14 | let languages = SyntaxLibraries().languages
15 |
16 | var syntaxIndex: Int = 0
17 | var syntax = ""
18 |
19 | @IBOutlet var searchSyntaxTextField: SearchTextField!
20 |
21 | override func viewDidLoad() {
22 | super.viewDidLoad()
23 |
24 | // Picks up the user default syntax/language
25 | let defaults = UserDefaults.standard
26 | syntaxIndex = defaults.integer(forKey: "selectedText")
27 | syntax = languages[defaults.integer(forKey: "selectedText")]
28 |
29 | let indexPath = IndexPath(row: syntaxIndex, section: 0)
30 | tableView.scrollToRow(at: indexPath, at: .top, animated: true)
31 |
32 | // SearchTextField settings
33 | searchSyntaxTextField.filterStrings(languages)
34 | // searchSyntaxTextField.theme.bgColor = UIColor (red: 1, green: 1, blue: 1, alpha: 0.95)
35 | searchSyntaxTextField.theme.bgColor = UIColor(red: 160 / 255, green: 162 / 255, blue: 164 / 255, alpha: 0.95)
36 | searchSyntaxTextField.theme.fontColor = UIColor.white
37 | // searchSyntaxTextField.theme = SearchTextFieldTheme.darkTheme()
38 | searchSyntaxTextField.maxNumberOfResults = 5
39 | searchSyntaxTextField.maxResultsListHeight = 180
40 |
41 | // Handles what happens when user picks an item
42 | searchSyntaxTextField.itemSelectionHandler = { item, itemPosition in
43 | let item = item[itemPosition]
44 | self.searchSyntaxTextField.text = item.title
45 | self.syntax = item.title
46 |
47 | if self.languages.contains(self.syntax) {
48 | self.syntaxIndex = self.languages.index(of: self.syntax)!
49 | let indexPath = IndexPath(row: self.syntaxIndex, section: 0)
50 | self.tableView.scrollToRow(at: indexPath, at: .top, animated: true)
51 | }
52 | }
53 | }
54 |
55 | @IBAction func donePress(_: Any) {
56 | dismiss(animated: true) {}
57 | }
58 |
59 | // 251 Languages, for reference
60 | override func tableView(_: UITableView, numberOfRowsInSection _: Int) -> Int {
61 | return languages.count
62 | }
63 |
64 | override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
65 | // Select Cell
66 | let cell = tableView.dequeueReusableCell(withIdentifier: "customcell", for: indexPath as IndexPath)
67 | // Label it from languages and index
68 | cell.textLabel?.text = languages[indexPath.item]
69 | cell.textLabel?.textColor = UIColor.white
70 |
71 | // Open savefile
72 | let defaults = UserDefaults.standard
73 |
74 | // If save already exists
75 | if defaults.object(forKey: "selectedText") != nil {
76 | if indexPath.item == defaults.integer(forKey: "selectedText") {
77 | cell.accessoryType = .checkmark
78 | } else {
79 | cell.accessoryType = .none
80 | }
81 | } else {
82 | let indPath = IndexPath(row: 145, section: 0)
83 | if let cell = tableView.cellForRow(at: indPath) {
84 | cell.accessoryType = .checkmark
85 | }
86 | }
87 | return cell
88 | }
89 |
90 | override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
91 | // Puts a checkmark on the selected one
92 | if let cell = tableView.cellForRow(at: indexPath) {
93 | cell.accessoryType = .checkmark
94 | }
95 | // Bad Code Alert! I should be saving it as a local variable and then dynamically changing it/setting it to unchecked. But this gets around manual edits to the plist on jailbroken systems 😎
96 | for i in 0 ..< languages.count {
97 | if i == indexPath.item {
98 | continue
99 | }
100 | let indPath = IndexPath(row: i, section: 0)
101 | if let cell = tableView.cellForRow(at: indPath) {
102 | cell.accessoryType = .none
103 | }
104 | }
105 |
106 | // Saves the int of the selected languages item
107 | let defaults = UserDefaults.standard
108 | defaults.set(indexPath.item, forKey: "selectedText")
109 | }
110 |
111 | // Should deselect the selected one... But it only works after the initial selection, so hacky workaround above
112 | override func tableView(_ tableView: UITableView, didDeselectRowAt indexPath: IndexPath) {
113 | if let cell = tableView.cellForRow(at: indexPath) {
114 | cell.accessoryType = .none
115 | }
116 | }
117 | }
118 |
--------------------------------------------------------------------------------
/PasteBin/PasteBin/ViewController.swift:
--------------------------------------------------------------------------------
1 | //
2 | // ViewController.swift
3 | // PasteBin
4 | //
5 | // Created by JonLuca De Caro on 12/28/16.
6 | // Copyright © 2016 JonLuca De Caro. All rights reserved.
7 | //
8 |
9 | import AFNetworking
10 | import UIKit
11 |
12 | class ViewController: UIViewController {
13 | // Previous pastes array
14 | var savedList: [String] = []
15 |
16 | let storyboardID = "mainView"
17 |
18 | @IBOutlet var create: UIButton!
19 | @IBOutlet var quickSubmit: UIButton!
20 |
21 | @IBOutlet var codeBackground: UIImageView!
22 |
23 | // init view vars
24 | var width = CGFloat(0)
25 | var last = CGFloat(-1400)
26 | var result = "null"
27 |
28 | override func viewDidLoad() {
29 | super.viewDidLoad()
30 |
31 | // If no defaults exist in save, create them
32 | let defaults = UserDefaults.standard
33 | if defaults.object(forKey: "selectedText") == nil {
34 | defaults.set(145, forKey: "selectedText")
35 | }
36 | if defaults.object(forKey: "SyntaxState") == nil {
37 | defaults.set(true, forKey: "SyntaxState")
38 | }
39 | if defaults.object(forKey: "SwitchState") == nil {
40 | defaults.set(true, forKey: "SwitchState")
41 | }
42 |
43 | // Lets the background animation resume after app has been in background
44 | NotificationCenter.default.addObserver(self, selector: #selector(backgroundInfinite), name: UIApplication.willEnterForegroundNotification, object: nil)
45 | }
46 |
47 | override func viewWillAppear(_ animated: Bool) {
48 | super.viewWillAppear(animated)
49 |
50 | // Get screen size for animated background
51 | let bounds = UIScreen.main.bounds
52 | width = bounds.size.width
53 | backgroundInfinite()
54 |
55 | // Load previous pastes to savedList array
56 | savedList = PastebinHelper().loadSavedListItems()
57 | }
58 |
59 | // Hide top bar
60 | override var prefersStatusBarHidden: Bool {
61 | return true
62 | }
63 |
64 | // Remembers the last position of scrolling background
65 | override func viewDidDisappear(_: Bool) {
66 | last = codeBackground.frame.origin.x
67 | }
68 |
69 | @objc func backgroundInfinite() {
70 | codeBackground.frame.origin.x = last
71 |
72 | // 10s animation, moves horizontally and back again
73 | UIView.animate(withDuration: 10.0, delay: 0, options: [.repeat, .autoreverse], animations: {
74 | self.codeBackground.frame.origin.x += self.width
75 |
76 | }, completion: nil)
77 | }
78 |
79 | @IBAction func createPaste(_: Any) {
80 | last = codeBackground.frame.origin.x
81 |
82 | // Show main paste view
83 | let mainStoryboard = UIStoryboard(name: "Main", bundle: nil)
84 | let pasteViewController: PasteView = mainStoryboard.instantiateViewController(withIdentifier: "pasteVC") as! PasteView
85 | pasteViewController.previousStoryboardIsMainView = true
86 | present(pasteViewController, animated: true, completion: nil)
87 | }
88 |
89 | @IBAction func about(_: Any) {
90 | // Yet again saves the position
91 | last = codeBackground.frame.origin.x
92 |
93 | // About Information
94 | let alertController = UIAlertController(title: "About", message: "© JonLuca De Caro 2018\n© Henrik Gustavii 2018\n© pastebin.com", preferredStyle: .alert)
95 | let OKAction = UIAlertAction(title: "OK", style: .default) { _ in
96 | // Do nothing
97 | }
98 | alertController.addAction(OKAction)
99 | present(alertController, animated: true) {}
100 | }
101 |
102 | @IBAction func historyButton(_: Any) {
103 | last = codeBackground.frame.origin.x
104 |
105 | let mainStoryboard = UIStoryboard(name: "Main", bundle: nil)
106 | let vC: HistoryViewController = mainStoryboard.instantiateViewController(withIdentifier: "historyView") as! HistoryViewController
107 | vC.previousStoryboardIsMainView = true
108 | vC.modalTransitionStyle = .coverVertical
109 | present(vC, animated: true, completion: nil)
110 | }
111 |
112 | @IBAction func helpButton(_: Any) {
113 | last = codeBackground.frame.origin.x
114 |
115 | let mainStoryboard = UIStoryboard(name: "Main", bundle: nil)
116 | let vC: HelpViewController = mainStoryboard.instantiateViewController(withIdentifier: "helpView") as! HelpViewController
117 | vC.previousStoryboardIsMainView = true
118 | vC.modalTransitionStyle = .coverVertical
119 | present(vC, animated: true, completion: nil)
120 | }
121 |
122 | @IBAction func optionsButton(_: Any) {
123 | last = codeBackground.frame.origin.x
124 |
125 | let mainStoryboard = UIStoryboard(name: "Main", bundle: nil)
126 | let vC: MasterOptionsViewController = mainStoryboard.instantiateViewController(withIdentifier: "optionsView") as! MasterOptionsViewController
127 | MasterOptionsViewController.previousStoryboardIsMainView = true
128 | vC.modalTransitionStyle = .coverVertical
129 | present(vC, animated: true, completion: nil)
130 | }
131 |
132 | @IBAction func quickSubmit(_: Any) {
133 | if let text = UIPasteboard.general.string {
134 | // Don't allow empty paste
135 | if text.isEmpty {
136 | let alertController = UIAlertController(title: "Error!", message: "Text cannot be empty!", preferredStyle: .alert)
137 | let OKAction = UIAlertAction(title: "OK", style: .default) { _ in
138 | // handle response here.
139 | }
140 | alertController.addAction(OKAction)
141 | present(alertController, animated: true) {}
142 | } else {
143 | PastebinHelper().postToPastebin(text: text, savedList: savedList)
144 | }
145 | }
146 | }
147 | }
148 |
--------------------------------------------------------------------------------
/PasteBin/PasteBin/code.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jonluca/PasteBinApp/2c4132b3cd488848431b4bb786d0acf0c8c41310/PasteBin/PasteBin/code.png
--------------------------------------------------------------------------------
/PasteBin/Podfile:
--------------------------------------------------------------------------------
1 | # Uncomment this line to define a global platform for your project
2 | # platform :ios, '9.0'
3 |
4 | target 'PasteBin' do
5 | # Comment this line if you're not using Swift and don't want to use dynamic frameworks
6 | use_frameworks!
7 |
8 | # Pods for PasteBin
9 | pod 'AFNetworking'
10 | pod 'Highlightr', '~> 2.0'
11 | pod 'SearchTextField'
12 |
13 | end
14 |
--------------------------------------------------------------------------------
/PasteBin/Podfile.lock:
--------------------------------------------------------------------------------
1 | PODS:
2 | - AFNetworking (3.2.1):
3 | - AFNetworking/NSURLSession (= 3.2.1)
4 | - AFNetworking/Reachability (= 3.2.1)
5 | - AFNetworking/Security (= 3.2.1)
6 | - AFNetworking/Serialization (= 3.2.1)
7 | - AFNetworking/UIKit (= 3.2.1)
8 | - AFNetworking/NSURLSession (3.2.1):
9 | - AFNetworking/Reachability
10 | - AFNetworking/Security
11 | - AFNetworking/Serialization
12 | - AFNetworking/Reachability (3.2.1)
13 | - AFNetworking/Security (3.2.1)
14 | - AFNetworking/Serialization (3.2.1)
15 | - AFNetworking/UIKit (3.2.1):
16 | - AFNetworking/NSURLSession
17 | - Highlightr (2.0.1)
18 | - SearchTextField (1.2.2)
19 |
20 | DEPENDENCIES:
21 | - AFNetworking
22 | - Highlightr (~> 2.0)
23 | - SearchTextField
24 |
25 | SPEC REPOS:
26 | https://github.com/cocoapods/specs.git:
27 | - AFNetworking
28 | - Highlightr
29 | - SearchTextField
30 |
31 | SPEC CHECKSUMS:
32 | AFNetworking: b6f891fdfaed196b46c7a83cf209e09697b94057
33 | Highlightr: 65655134dd0d5e1320afdd8a9d880c9e9dc0b437
34 | SearchTextField: a0992739d4b05dcbb40fb3a5cc6526bd991bdd23
35 |
36 | PODFILE CHECKSUM: df025333d225b1bfc27c8e3254e1a7570e54f0e9
37 |
38 | COCOAPODS: 1.6.0.beta.2
39 |
--------------------------------------------------------------------------------
/PasteBin/Pods/AFNetworking/AFNetworking/AFNetworkReachabilityManager.h:
--------------------------------------------------------------------------------
1 | // AFNetworkReachabilityManager.h
2 | // Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ )
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a copy
5 | // of this software and associated documentation files (the "Software"), to deal
6 | // in the Software without restriction, including without limitation the rights
7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | // copies of the Software, and to permit persons to whom the Software is
9 | // furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20 | // THE SOFTWARE.
21 |
22 | #import
23 |
24 | #if !TARGET_OS_WATCH
25 | #import
26 |
27 | typedef NS_ENUM(NSInteger, AFNetworkReachabilityStatus) {
28 | AFNetworkReachabilityStatusUnknown = -1,
29 | AFNetworkReachabilityStatusNotReachable = 0,
30 | AFNetworkReachabilityStatusReachableViaWWAN = 1,
31 | AFNetworkReachabilityStatusReachableViaWiFi = 2,
32 | };
33 |
34 | NS_ASSUME_NONNULL_BEGIN
35 |
36 | /**
37 | `AFNetworkReachabilityManager` monitors the reachability of domains, and addresses for both WWAN and WiFi network interfaces.
38 |
39 | Reachability can be used to determine background information about why a network operation failed, or to trigger a network operation retrying when a connection is established. It should not be used to prevent a user from initiating a network request, as it's possible that an initial request may be required to establish reachability.
40 |
41 | See Apple's Reachability Sample Code ( https://developer.apple.com/library/ios/samplecode/reachability/ )
42 |
43 | @warning Instances of `AFNetworkReachabilityManager` must be started with `-startMonitoring` before reachability status can be determined.
44 | */
45 | @interface AFNetworkReachabilityManager : NSObject
46 |
47 | /**
48 | The current network reachability status.
49 | */
50 | @property (readonly, nonatomic, assign) AFNetworkReachabilityStatus networkReachabilityStatus;
51 |
52 | /**
53 | Whether or not the network is currently reachable.
54 | */
55 | @property (readonly, nonatomic, assign, getter = isReachable) BOOL reachable;
56 |
57 | /**
58 | Whether or not the network is currently reachable via WWAN.
59 | */
60 | @property (readonly, nonatomic, assign, getter = isReachableViaWWAN) BOOL reachableViaWWAN;
61 |
62 | /**
63 | Whether or not the network is currently reachable via WiFi.
64 | */
65 | @property (readonly, nonatomic, assign, getter = isReachableViaWiFi) BOOL reachableViaWiFi;
66 |
67 | ///---------------------
68 | /// @name Initialization
69 | ///---------------------
70 |
71 | /**
72 | Returns the shared network reachability manager.
73 | */
74 | + (instancetype)sharedManager;
75 |
76 | /**
77 | Creates and returns a network reachability manager with the default socket address.
78 |
79 | @return An initialized network reachability manager, actively monitoring the default socket address.
80 | */
81 | + (instancetype)manager;
82 |
83 | /**
84 | Creates and returns a network reachability manager for the specified domain.
85 |
86 | @param domain The domain used to evaluate network reachability.
87 |
88 | @return An initialized network reachability manager, actively monitoring the specified domain.
89 | */
90 | + (instancetype)managerForDomain:(NSString *)domain;
91 |
92 | /**
93 | Creates and returns a network reachability manager for the socket address.
94 |
95 | @param address The socket address (`sockaddr_in6`) used to evaluate network reachability.
96 |
97 | @return An initialized network reachability manager, actively monitoring the specified socket address.
98 | */
99 | + (instancetype)managerForAddress:(const void *)address;
100 |
101 | /**
102 | Initializes an instance of a network reachability manager from the specified reachability object.
103 |
104 | @param reachability The reachability object to monitor.
105 |
106 | @return An initialized network reachability manager, actively monitoring the specified reachability.
107 | */
108 | - (instancetype)initWithReachability:(SCNetworkReachabilityRef)reachability NS_DESIGNATED_INITIALIZER;
109 |
110 | /**
111 | * Unavailable initializer
112 | */
113 | + (instancetype)new NS_UNAVAILABLE;
114 |
115 | /**
116 | * Unavailable initializer
117 | */
118 | - (instancetype)init NS_UNAVAILABLE;
119 |
120 | ///--------------------------------------------------
121 | /// @name Starting & Stopping Reachability Monitoring
122 | ///--------------------------------------------------
123 |
124 | /**
125 | Starts monitoring for changes in network reachability status.
126 | */
127 | - (void)startMonitoring;
128 |
129 | /**
130 | Stops monitoring for changes in network reachability status.
131 | */
132 | - (void)stopMonitoring;
133 |
134 | ///-------------------------------------------------
135 | /// @name Getting Localized Reachability Description
136 | ///-------------------------------------------------
137 |
138 | /**
139 | Returns a localized string representation of the current network reachability status.
140 | */
141 | - (NSString *)localizedNetworkReachabilityStatusString;
142 |
143 | ///---------------------------------------------------
144 | /// @name Setting Network Reachability Change Callback
145 | ///---------------------------------------------------
146 |
147 | /**
148 | Sets a callback to be executed when the network availability of the `baseURL` host changes.
149 |
150 | @param block A block object to be executed when the network availability of the `baseURL` host changes.. This block has no return value and takes a single argument which represents the various reachability states from the device to the `baseURL`.
151 | */
152 | - (void)setReachabilityStatusChangeBlock:(nullable void (^)(AFNetworkReachabilityStatus status))block;
153 |
154 | @end
155 |
156 | ///----------------
157 | /// @name Constants
158 | ///----------------
159 |
160 | /**
161 | ## Network Reachability
162 |
163 | The following constants are provided by `AFNetworkReachabilityManager` as possible network reachability statuses.
164 |
165 | enum {
166 | AFNetworkReachabilityStatusUnknown,
167 | AFNetworkReachabilityStatusNotReachable,
168 | AFNetworkReachabilityStatusReachableViaWWAN,
169 | AFNetworkReachabilityStatusReachableViaWiFi,
170 | }
171 |
172 | `AFNetworkReachabilityStatusUnknown`
173 | The `baseURL` host reachability is not known.
174 |
175 | `AFNetworkReachabilityStatusNotReachable`
176 | The `baseURL` host cannot be reached.
177 |
178 | `AFNetworkReachabilityStatusReachableViaWWAN`
179 | The `baseURL` host can be reached via a cellular connection, such as EDGE or GPRS.
180 |
181 | `AFNetworkReachabilityStatusReachableViaWiFi`
182 | The `baseURL` host can be reached via a Wi-Fi connection.
183 |
184 | ### Keys for Notification UserInfo Dictionary
185 |
186 | Strings that are used as keys in a `userInfo` dictionary in a network reachability status change notification.
187 |
188 | `AFNetworkingReachabilityNotificationStatusItem`
189 | A key in the userInfo dictionary in a `AFNetworkingReachabilityDidChangeNotification` notification.
190 | The corresponding value is an `NSNumber` object representing the `AFNetworkReachabilityStatus` value for the current reachability status.
191 | */
192 |
193 | ///--------------------
194 | /// @name Notifications
195 | ///--------------------
196 |
197 | /**
198 | Posted when network reachability changes.
199 | This notification assigns no notification object. The `userInfo` dictionary contains an `NSNumber` object under the `AFNetworkingReachabilityNotificationStatusItem` key, representing the `AFNetworkReachabilityStatus` value for the current network reachability.
200 |
201 | @warning In order for network reachability to be monitored, include the `SystemConfiguration` framework in the active target's "Link Binary With Library" build phase, and add `#import ` to the header prefix of the project (`Prefix.pch`).
202 | */
203 | FOUNDATION_EXPORT NSString * const AFNetworkingReachabilityDidChangeNotification;
204 | FOUNDATION_EXPORT NSString * const AFNetworkingReachabilityNotificationStatusItem;
205 |
206 | ///--------------------
207 | /// @name Functions
208 | ///--------------------
209 |
210 | /**
211 | Returns a localized string representation of an `AFNetworkReachabilityStatus` value.
212 | */
213 | FOUNDATION_EXPORT NSString * AFStringFromNetworkReachabilityStatus(AFNetworkReachabilityStatus status);
214 |
215 | NS_ASSUME_NONNULL_END
216 | #endif
217 |
--------------------------------------------------------------------------------
/PasteBin/Pods/AFNetworking/AFNetworking/AFNetworking.h:
--------------------------------------------------------------------------------
1 | // AFNetworking.h
2 | //
3 | // Copyright (c) 2013 AFNetworking (http://afnetworking.com/)
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
13 | // all 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
21 | // THE SOFTWARE.
22 |
23 | #import
24 | #import
25 | #import
26 |
27 | #ifndef _AFNETWORKING_
28 | #define _AFNETWORKING_
29 |
30 | #import "AFURLRequestSerialization.h"
31 | #import "AFURLResponseSerialization.h"
32 | #import "AFSecurityPolicy.h"
33 |
34 | #if !TARGET_OS_WATCH
35 | #import "AFNetworkReachabilityManager.h"
36 | #endif
37 |
38 | #import "AFURLSessionManager.h"
39 | #import "AFHTTPSessionManager.h"
40 |
41 | #endif /* _AFNETWORKING_ */
42 |
--------------------------------------------------------------------------------
/PasteBin/Pods/AFNetworking/AFNetworking/AFSecurityPolicy.h:
--------------------------------------------------------------------------------
1 | // AFSecurityPolicy.h
2 | // Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ )
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a copy
5 | // of this software and associated documentation files (the "Software"), to deal
6 | // in the Software without restriction, including without limitation the rights
7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | // copies of the Software, and to permit persons to whom the Software is
9 | // furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20 | // THE SOFTWARE.
21 |
22 | #import
23 | #import
24 |
25 | typedef NS_ENUM(NSUInteger, AFSSLPinningMode) {
26 | AFSSLPinningModeNone,
27 | AFSSLPinningModePublicKey,
28 | AFSSLPinningModeCertificate,
29 | };
30 |
31 | /**
32 | `AFSecurityPolicy` evaluates server trust against pinned X.509 certificates and public keys over secure connections.
33 |
34 | Adding pinned SSL certificates to your app helps prevent man-in-the-middle attacks and other vulnerabilities. Applications dealing with sensitive customer data or financial information are strongly encouraged to route all communication over an HTTPS connection with SSL pinning configured and enabled.
35 | */
36 |
37 | NS_ASSUME_NONNULL_BEGIN
38 |
39 | @interface AFSecurityPolicy : NSObject
40 |
41 | /**
42 | The criteria by which server trust should be evaluated against the pinned SSL certificates. Defaults to `AFSSLPinningModeNone`.
43 | */
44 | @property (readonly, nonatomic, assign) AFSSLPinningMode SSLPinningMode;
45 |
46 | /**
47 | The certificates used to evaluate server trust according to the SSL pinning mode.
48 |
49 | By default, this property is set to any (`.cer`) certificates included in the target compiling AFNetworking. Note that if you are using AFNetworking as embedded framework, no certificates will be pinned by default. Use `certificatesInBundle` to load certificates from your target, and then create a new policy by calling `policyWithPinningMode:withPinnedCertificates`.
50 |
51 | Note that if pinning is enabled, `evaluateServerTrust:forDomain:` will return true if any pinned certificate matches.
52 | */
53 | @property (nonatomic, strong, nullable) NSSet *pinnedCertificates;
54 |
55 | /**
56 | Whether or not to trust servers with an invalid or expired SSL certificates. Defaults to `NO`.
57 | */
58 | @property (nonatomic, assign) BOOL allowInvalidCertificates;
59 |
60 | /**
61 | Whether or not to validate the domain name in the certificate's CN field. Defaults to `YES`.
62 | */
63 | @property (nonatomic, assign) BOOL validatesDomainName;
64 |
65 | ///-----------------------------------------
66 | /// @name Getting Certificates from the Bundle
67 | ///-----------------------------------------
68 |
69 | /**
70 | Returns any certificates included in the bundle. If you are using AFNetworking as an embedded framework, you must use this method to find the certificates you have included in your app bundle, and use them when creating your security policy by calling `policyWithPinningMode:withPinnedCertificates`.
71 |
72 | @return The certificates included in the given bundle.
73 | */
74 | + (NSSet *)certificatesInBundle:(NSBundle *)bundle;
75 |
76 | ///-----------------------------------------
77 | /// @name Getting Specific Security Policies
78 | ///-----------------------------------------
79 |
80 | /**
81 | Returns the shared default security policy, which does not allow invalid certificates, validates domain name, and does not validate against pinned certificates or public keys.
82 |
83 | @return The default security policy.
84 | */
85 | + (instancetype)defaultPolicy;
86 |
87 | ///---------------------
88 | /// @name Initialization
89 | ///---------------------
90 |
91 | /**
92 | Creates and returns a security policy with the specified pinning mode.
93 |
94 | @param pinningMode The SSL pinning mode.
95 |
96 | @return A new security policy.
97 | */
98 | + (instancetype)policyWithPinningMode:(AFSSLPinningMode)pinningMode;
99 |
100 | /**
101 | Creates and returns a security policy with the specified pinning mode.
102 |
103 | @param pinningMode The SSL pinning mode.
104 | @param pinnedCertificates The certificates to pin against.
105 |
106 | @return A new security policy.
107 | */
108 | + (instancetype)policyWithPinningMode:(AFSSLPinningMode)pinningMode withPinnedCertificates:(NSSet *)pinnedCertificates;
109 |
110 | ///------------------------------
111 | /// @name Evaluating Server Trust
112 | ///------------------------------
113 |
114 | /**
115 | Whether or not the specified server trust should be accepted, based on the security policy.
116 |
117 | This method should be used when responding to an authentication challenge from a server.
118 |
119 | @param serverTrust The X.509 certificate trust of the server.
120 | @param domain The domain of serverTrust. If `nil`, the domain will not be validated.
121 |
122 | @return Whether or not to trust the server.
123 | */
124 | - (BOOL)evaluateServerTrust:(SecTrustRef)serverTrust
125 | forDomain:(nullable NSString *)domain;
126 |
127 | @end
128 |
129 | NS_ASSUME_NONNULL_END
130 |
131 | ///----------------
132 | /// @name Constants
133 | ///----------------
134 |
135 | /**
136 | ## SSL Pinning Modes
137 |
138 | The following constants are provided by `AFSSLPinningMode` as possible SSL pinning modes.
139 |
140 | enum {
141 | AFSSLPinningModeNone,
142 | AFSSLPinningModePublicKey,
143 | AFSSLPinningModeCertificate,
144 | }
145 |
146 | `AFSSLPinningModeNone`
147 | Do not used pinned certificates to validate servers.
148 |
149 | `AFSSLPinningModePublicKey`
150 | Validate host certificates against public keys of pinned certificates.
151 |
152 | `AFSSLPinningModeCertificate`
153 | Validate host certificates against pinned certificates.
154 | */
155 |
--------------------------------------------------------------------------------
/PasteBin/Pods/AFNetworking/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2011-2016 Alamofire Software Foundation (http://alamofire.org/)
2 |
3 | Permission is hereby granted, free of charge, to any person obtaining a copy
4 | of this software and associated documentation files (the "Software"), to deal
5 | in the Software without restriction, including without limitation the rights
6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7 | copies of the Software, and to permit persons to whom the Software is
8 | furnished to do so, subject to the following conditions:
9 |
10 | The above copyright notice and this permission notice shall be included in
11 | all copies or substantial portions of the Software.
12 |
13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19 | THE SOFTWARE.
20 |
--------------------------------------------------------------------------------
/PasteBin/Pods/AFNetworking/UIKit+AFNetworking/AFAutoPurgingImageCache.h:
--------------------------------------------------------------------------------
1 | // AFAutoPurgingImageCache.h
2 | // Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ )
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a copy
5 | // of this software and associated documentation files (the "Software"), to deal
6 | // in the Software without restriction, including without limitation the rights
7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | // copies of the Software, and to permit persons to whom the Software is
9 | // furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20 | // THE SOFTWARE.
21 |
22 | #import
23 | #import
24 |
25 | #if TARGET_OS_IOS || TARGET_OS_TV
26 | #import
27 |
28 | NS_ASSUME_NONNULL_BEGIN
29 |
30 | /**
31 | The `AFImageCache` protocol defines a set of APIs for adding, removing and fetching images from a cache synchronously.
32 | */
33 | @protocol AFImageCache
34 |
35 | /**
36 | Adds the image to the cache with the given identifier.
37 |
38 | @param image The image to cache.
39 | @param identifier The unique identifier for the image in the cache.
40 | */
41 | - (void)addImage:(UIImage *)image withIdentifier:(NSString *)identifier;
42 |
43 | /**
44 | Removes the image from the cache matching the given identifier.
45 |
46 | @param identifier The unique identifier for the image in the cache.
47 |
48 | @return A BOOL indicating whether or not the image was removed from the cache.
49 | */
50 | - (BOOL)removeImageWithIdentifier:(NSString *)identifier;
51 |
52 | /**
53 | Removes all images from the cache.
54 |
55 | @return A BOOL indicating whether or not all images were removed from the cache.
56 | */
57 | - (BOOL)removeAllImages;
58 |
59 | /**
60 | Returns the image in the cache associated with the given identifier.
61 |
62 | @param identifier The unique identifier for the image in the cache.
63 |
64 | @return An image for the matching identifier, or nil.
65 | */
66 | - (nullable UIImage *)imageWithIdentifier:(NSString *)identifier;
67 | @end
68 |
69 |
70 | /**
71 | The `ImageRequestCache` protocol extends the `ImageCache` protocol by adding methods for adding, removing and fetching images from a cache given an `NSURLRequest` and additional identifier.
72 | */
73 | @protocol AFImageRequestCache
74 |
75 | /**
76 | Asks if the image should be cached using an identifier created from the request and additional identifier.
77 |
78 | @param image The image to be cached.
79 | @param request The unique URL request identifing the image asset.
80 | @param identifier The additional identifier to apply to the URL request to identify the image.
81 |
82 | @return A BOOL indicating whether or not the image should be added to the cache. YES will cache, NO will prevent caching.
83 | */
84 | - (BOOL)shouldCacheImage:(UIImage *)image forRequest:(NSURLRequest *)request withAdditionalIdentifier:(nullable NSString *)identifier;
85 |
86 | /**
87 | Adds the image to the cache using an identifier created from the request and additional identifier.
88 |
89 | @param image The image to cache.
90 | @param request The unique URL request identifing the image asset.
91 | @param identifier The additional identifier to apply to the URL request to identify the image.
92 | */
93 | - (void)addImage:(UIImage *)image forRequest:(NSURLRequest *)request withAdditionalIdentifier:(nullable NSString *)identifier;
94 |
95 | /**
96 | Removes the image from the cache using an identifier created from the request and additional identifier.
97 |
98 | @param request The unique URL request identifing the image asset.
99 | @param identifier The additional identifier to apply to the URL request to identify the image.
100 |
101 | @return A BOOL indicating whether or not all images were removed from the cache.
102 | */
103 | - (BOOL)removeImageforRequest:(NSURLRequest *)request withAdditionalIdentifier:(nullable NSString *)identifier;
104 |
105 | /**
106 | Returns the image from the cache associated with an identifier created from the request and additional identifier.
107 |
108 | @param request The unique URL request identifing the image asset.
109 | @param identifier The additional identifier to apply to the URL request to identify the image.
110 |
111 | @return An image for the matching request and identifier, or nil.
112 | */
113 | - (nullable UIImage *)imageforRequest:(NSURLRequest *)request withAdditionalIdentifier:(nullable NSString *)identifier;
114 |
115 | @end
116 |
117 | /**
118 | The `AutoPurgingImageCache` in an in-memory image cache used to store images up to a given memory capacity. When the memory capacity is reached, the image cache is sorted by last access date, then the oldest image is continuously purged until the preferred memory usage after purge is met. Each time an image is accessed through the cache, the internal access date of the image is updated.
119 | */
120 | @interface AFAutoPurgingImageCache : NSObject
121 |
122 | /**
123 | The total memory capacity of the cache in bytes.
124 | */
125 | @property (nonatomic, assign) UInt64 memoryCapacity;
126 |
127 | /**
128 | The preferred memory usage after purge in bytes. During a purge, images will be purged until the memory capacity drops below this limit.
129 | */
130 | @property (nonatomic, assign) UInt64 preferredMemoryUsageAfterPurge;
131 |
132 | /**
133 | The current total memory usage in bytes of all images stored within the cache.
134 | */
135 | @property (nonatomic, assign, readonly) UInt64 memoryUsage;
136 |
137 | /**
138 | Initialies the `AutoPurgingImageCache` instance with default values for memory capacity and preferred memory usage after purge limit. `memoryCapcity` defaults to `100 MB`. `preferredMemoryUsageAfterPurge` defaults to `60 MB`.
139 |
140 | @return The new `AutoPurgingImageCache` instance.
141 | */
142 | - (instancetype)init;
143 |
144 | /**
145 | Initialies the `AutoPurgingImageCache` instance with the given memory capacity and preferred memory usage
146 | after purge limit.
147 |
148 | @param memoryCapacity The total memory capacity of the cache in bytes.
149 | @param preferredMemoryCapacity The preferred memory usage after purge in bytes.
150 |
151 | @return The new `AutoPurgingImageCache` instance.
152 | */
153 | - (instancetype)initWithMemoryCapacity:(UInt64)memoryCapacity preferredMemoryCapacity:(UInt64)preferredMemoryCapacity;
154 |
155 | @end
156 |
157 | NS_ASSUME_NONNULL_END
158 |
159 | #endif
160 |
161 |
--------------------------------------------------------------------------------
/PasteBin/Pods/AFNetworking/UIKit+AFNetworking/AFAutoPurgingImageCache.m:
--------------------------------------------------------------------------------
1 | // AFAutoPurgingImageCache.m
2 | // Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ )
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a copy
5 | // of this software and associated documentation files (the "Software"), to deal
6 | // in the Software without restriction, including without limitation the rights
7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | // copies of the Software, and to permit persons to whom the Software is
9 | // furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20 | // THE SOFTWARE.
21 |
22 | #import
23 |
24 | #if TARGET_OS_IOS || TARGET_OS_TV
25 |
26 | #import "AFAutoPurgingImageCache.h"
27 |
28 | @interface AFCachedImage : NSObject
29 |
30 | @property (nonatomic, strong) UIImage *image;
31 | @property (nonatomic, strong) NSString *identifier;
32 | @property (nonatomic, assign) UInt64 totalBytes;
33 | @property (nonatomic, strong) NSDate *lastAccessDate;
34 | @property (nonatomic, assign) UInt64 currentMemoryUsage;
35 |
36 | @end
37 |
38 | @implementation AFCachedImage
39 |
40 | -(instancetype)initWithImage:(UIImage *)image identifier:(NSString *)identifier {
41 | if (self = [self init]) {
42 | self.image = image;
43 | self.identifier = identifier;
44 |
45 | CGSize imageSize = CGSizeMake(image.size.width * image.scale, image.size.height * image.scale);
46 | CGFloat bytesPerPixel = 4.0;
47 | CGFloat bytesPerSize = imageSize.width * imageSize.height;
48 | self.totalBytes = (UInt64)bytesPerPixel * (UInt64)bytesPerSize;
49 | self.lastAccessDate = [NSDate date];
50 | }
51 | return self;
52 | }
53 |
54 | - (UIImage*)accessImage {
55 | self.lastAccessDate = [NSDate date];
56 | return self.image;
57 | }
58 |
59 | - (NSString *)description {
60 | NSString *descriptionString = [NSString stringWithFormat:@"Idenfitier: %@ lastAccessDate: %@ ", self.identifier, self.lastAccessDate];
61 | return descriptionString;
62 |
63 | }
64 |
65 | @end
66 |
67 | @interface AFAutoPurgingImageCache ()
68 | @property (nonatomic, strong) NSMutableDictionary *cachedImages;
69 | @property (nonatomic, assign) UInt64 currentMemoryUsage;
70 | @property (nonatomic, strong) dispatch_queue_t synchronizationQueue;
71 | @end
72 |
73 | @implementation AFAutoPurgingImageCache
74 |
75 | - (instancetype)init {
76 | return [self initWithMemoryCapacity:100 * 1024 * 1024 preferredMemoryCapacity:60 * 1024 * 1024];
77 | }
78 |
79 | - (instancetype)initWithMemoryCapacity:(UInt64)memoryCapacity preferredMemoryCapacity:(UInt64)preferredMemoryCapacity {
80 | if (self = [super init]) {
81 | self.memoryCapacity = memoryCapacity;
82 | self.preferredMemoryUsageAfterPurge = preferredMemoryCapacity;
83 | self.cachedImages = [[NSMutableDictionary alloc] init];
84 |
85 | NSString *queueName = [NSString stringWithFormat:@"com.alamofire.autopurgingimagecache-%@", [[NSUUID UUID] UUIDString]];
86 | self.synchronizationQueue = dispatch_queue_create([queueName cStringUsingEncoding:NSASCIIStringEncoding], DISPATCH_QUEUE_CONCURRENT);
87 |
88 | [[NSNotificationCenter defaultCenter]
89 | addObserver:self
90 | selector:@selector(removeAllImages)
91 | name:UIApplicationDidReceiveMemoryWarningNotification
92 | object:nil];
93 |
94 | }
95 | return self;
96 | }
97 |
98 | - (void)dealloc {
99 | [[NSNotificationCenter defaultCenter] removeObserver:self];
100 | }
101 |
102 | - (UInt64)memoryUsage {
103 | __block UInt64 result = 0;
104 | dispatch_sync(self.synchronizationQueue, ^{
105 | result = self.currentMemoryUsage;
106 | });
107 | return result;
108 | }
109 |
110 | - (void)addImage:(UIImage *)image withIdentifier:(NSString *)identifier {
111 | dispatch_barrier_async(self.synchronizationQueue, ^{
112 | AFCachedImage *cacheImage = [[AFCachedImage alloc] initWithImage:image identifier:identifier];
113 |
114 | AFCachedImage *previousCachedImage = self.cachedImages[identifier];
115 | if (previousCachedImage != nil) {
116 | self.currentMemoryUsage -= previousCachedImage.totalBytes;
117 | }
118 |
119 | self.cachedImages[identifier] = cacheImage;
120 | self.currentMemoryUsage += cacheImage.totalBytes;
121 | });
122 |
123 | dispatch_barrier_async(self.synchronizationQueue, ^{
124 | if (self.currentMemoryUsage > self.memoryCapacity) {
125 | UInt64 bytesToPurge = self.currentMemoryUsage - self.preferredMemoryUsageAfterPurge;
126 | NSMutableArray *sortedImages = [NSMutableArray arrayWithArray:self.cachedImages.allValues];
127 | NSSortDescriptor *sortDescriptor = [[NSSortDescriptor alloc] initWithKey:@"lastAccessDate"
128 | ascending:YES];
129 | [sortedImages sortUsingDescriptors:@[sortDescriptor]];
130 |
131 | UInt64 bytesPurged = 0;
132 |
133 | for (AFCachedImage *cachedImage in sortedImages) {
134 | [self.cachedImages removeObjectForKey:cachedImage.identifier];
135 | bytesPurged += cachedImage.totalBytes;
136 | if (bytesPurged >= bytesToPurge) {
137 | break ;
138 | }
139 | }
140 | self.currentMemoryUsage -= bytesPurged;
141 | }
142 | });
143 | }
144 |
145 | - (BOOL)removeImageWithIdentifier:(NSString *)identifier {
146 | __block BOOL removed = NO;
147 | dispatch_barrier_sync(self.synchronizationQueue, ^{
148 | AFCachedImage *cachedImage = self.cachedImages[identifier];
149 | if (cachedImage != nil) {
150 | [self.cachedImages removeObjectForKey:identifier];
151 | self.currentMemoryUsage -= cachedImage.totalBytes;
152 | removed = YES;
153 | }
154 | });
155 | return removed;
156 | }
157 |
158 | - (BOOL)removeAllImages {
159 | __block BOOL removed = NO;
160 | dispatch_barrier_sync(self.synchronizationQueue, ^{
161 | if (self.cachedImages.count > 0) {
162 | [self.cachedImages removeAllObjects];
163 | self.currentMemoryUsage = 0;
164 | removed = YES;
165 | }
166 | });
167 | return removed;
168 | }
169 |
170 | - (nullable UIImage *)imageWithIdentifier:(NSString *)identifier {
171 | __block UIImage *image = nil;
172 | dispatch_sync(self.synchronizationQueue, ^{
173 | AFCachedImage *cachedImage = self.cachedImages[identifier];
174 | image = [cachedImage accessImage];
175 | });
176 | return image;
177 | }
178 |
179 | - (void)addImage:(UIImage *)image forRequest:(NSURLRequest *)request withAdditionalIdentifier:(NSString *)identifier {
180 | [self addImage:image withIdentifier:[self imageCacheKeyFromURLRequest:request withAdditionalIdentifier:identifier]];
181 | }
182 |
183 | - (BOOL)removeImageforRequest:(NSURLRequest *)request withAdditionalIdentifier:(NSString *)identifier {
184 | return [self removeImageWithIdentifier:[self imageCacheKeyFromURLRequest:request withAdditionalIdentifier:identifier]];
185 | }
186 |
187 | - (nullable UIImage *)imageforRequest:(NSURLRequest *)request withAdditionalIdentifier:(NSString *)identifier {
188 | return [self imageWithIdentifier:[self imageCacheKeyFromURLRequest:request withAdditionalIdentifier:identifier]];
189 | }
190 |
191 | - (NSString *)imageCacheKeyFromURLRequest:(NSURLRequest *)request withAdditionalIdentifier:(NSString *)additionalIdentifier {
192 | NSString *key = request.URL.absoluteString;
193 | if (additionalIdentifier != nil) {
194 | key = [key stringByAppendingString:additionalIdentifier];
195 | }
196 | return key;
197 | }
198 |
199 | - (BOOL)shouldCacheImage:(UIImage *)image forRequest:(NSURLRequest *)request withAdditionalIdentifier:(nullable NSString *)identifier {
200 | return YES;
201 | }
202 |
203 | @end
204 |
205 | #endif
206 |
--------------------------------------------------------------------------------
/PasteBin/Pods/AFNetworking/UIKit+AFNetworking/AFNetworkActivityIndicatorManager.h:
--------------------------------------------------------------------------------
1 | // AFNetworkActivityIndicatorManager.h
2 | // Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ )
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a copy
5 | // of this software and associated documentation files (the "Software"), to deal
6 | // in the Software without restriction, including without limitation the rights
7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | // copies of the Software, and to permit persons to whom the Software is
9 | // furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20 | // THE SOFTWARE.
21 |
22 | #import
23 |
24 | #import
25 |
26 | #if TARGET_OS_IOS
27 |
28 | #import
29 |
30 | NS_ASSUME_NONNULL_BEGIN
31 |
32 | /**
33 | `AFNetworkActivityIndicatorManager` manages the state of the network activity indicator in the status bar. When enabled, it will listen for notifications indicating that a session task has started or finished, and start or stop animating the indicator accordingly. The number of active requests is incremented and decremented much like a stack or a semaphore, and the activity indicator will animate so long as that number is greater than zero.
34 |
35 | You should enable the shared instance of `AFNetworkActivityIndicatorManager` when your application finishes launching. In `AppDelegate application:didFinishLaunchingWithOptions:` you can do so with the following code:
36 |
37 | [[AFNetworkActivityIndicatorManager sharedManager] setEnabled:YES];
38 |
39 | By setting `enabled` to `YES` for `sharedManager`, the network activity indicator will show and hide automatically as requests start and finish. You should not ever need to call `incrementActivityCount` or `decrementActivityCount` yourself.
40 |
41 | See the Apple Human Interface Guidelines section about the Network Activity Indicator for more information:
42 | http://developer.apple.com/library/iOS/#documentation/UserExperience/Conceptual/MobileHIG/UIElementGuidelines/UIElementGuidelines.html#//apple_ref/doc/uid/TP40006556-CH13-SW44
43 | */
44 | NS_EXTENSION_UNAVAILABLE_IOS("Use view controller based solutions where appropriate instead.")
45 | @interface AFNetworkActivityIndicatorManager : NSObject
46 |
47 | /**
48 | A Boolean value indicating whether the manager is enabled.
49 |
50 | If YES, the manager will change status bar network activity indicator according to network operation notifications it receives. The default value is NO.
51 | */
52 | @property (nonatomic, assign, getter = isEnabled) BOOL enabled;
53 |
54 | /**
55 | A Boolean value indicating whether the network activity indicator manager is currently active.
56 | */
57 | @property (readonly, nonatomic, assign, getter=isNetworkActivityIndicatorVisible) BOOL networkActivityIndicatorVisible;
58 |
59 | /**
60 | A time interval indicating the minimum duration of networking activity that should occur before the activity indicator is displayed. The default value 1 second. If the network activity indicator should be displayed immediately when network activity occurs, this value should be set to 0 seconds.
61 |
62 | Apple's HIG describes the following:
63 |
64 | > Display the network activity indicator to provide feedback when your app accesses the network for more than a couple of seconds. If the operation finishes sooner than that, you don’t have to show the network activity indicator, because the indicator is likely to disappear before users notice its presence.
65 |
66 | */
67 | @property (nonatomic, assign) NSTimeInterval activationDelay;
68 |
69 | /**
70 | A time interval indicating the duration of time of no networking activity required before the activity indicator is disabled. This allows for continuous display of the network activity indicator across multiple requests. The default value is 0.17 seconds.
71 | */
72 |
73 | @property (nonatomic, assign) NSTimeInterval completionDelay;
74 |
75 | /**
76 | Returns the shared network activity indicator manager object for the system.
77 |
78 | @return The systemwide network activity indicator manager.
79 | */
80 | + (instancetype)sharedManager;
81 |
82 | /**
83 | Increments the number of active network requests. If this number was zero before incrementing, this will start animating the status bar network activity indicator.
84 | */
85 | - (void)incrementActivityCount;
86 |
87 | /**
88 | Decrements the number of active network requests. If this number becomes zero after decrementing, this will stop animating the status bar network activity indicator.
89 | */
90 | - (void)decrementActivityCount;
91 |
92 | /**
93 | Set the a custom method to be executed when the network activity indicator manager should be hidden/shown. By default, this is null, and the UIApplication Network Activity Indicator will be managed automatically. If this block is set, it is the responsiblity of the caller to manager the network activity indicator going forward.
94 |
95 | @param block A block to be executed when the network activity indicator status changes.
96 | */
97 | - (void)setNetworkingActivityActionWithBlock:(nullable void (^)(BOOL networkActivityIndicatorVisible))block;
98 |
99 | @end
100 |
101 | NS_ASSUME_NONNULL_END
102 |
103 | #endif
104 |
--------------------------------------------------------------------------------
/PasteBin/Pods/AFNetworking/UIKit+AFNetworking/UIActivityIndicatorView+AFNetworking.h:
--------------------------------------------------------------------------------
1 | // UIActivityIndicatorView+AFNetworking.h
2 | // Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ )
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a copy
5 | // of this software and associated documentation files (the "Software"), to deal
6 | // in the Software without restriction, including without limitation the rights
7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | // copies of the Software, and to permit persons to whom the Software is
9 | // furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20 | // THE SOFTWARE.
21 |
22 | #import
23 |
24 | #import
25 |
26 | #if TARGET_OS_IOS || TARGET_OS_TV
27 |
28 | #import
29 |
30 | /**
31 | This category adds methods to the UIKit framework's `UIActivityIndicatorView` class. The methods in this category provide support for automatically starting and stopping animation depending on the loading state of a session task.
32 | */
33 | @interface UIActivityIndicatorView (AFNetworking)
34 |
35 | ///----------------------------------
36 | /// @name Animating for Session Tasks
37 | ///----------------------------------
38 |
39 | /**
40 | Binds the animating state to the state of the specified task.
41 |
42 | @param task The task. If `nil`, automatic updating from any previously specified operation will be disabled.
43 | */
44 | - (void)setAnimatingWithStateOfTask:(nullable NSURLSessionTask *)task;
45 |
46 | @end
47 |
48 | #endif
49 |
--------------------------------------------------------------------------------
/PasteBin/Pods/AFNetworking/UIKit+AFNetworking/UIActivityIndicatorView+AFNetworking.m:
--------------------------------------------------------------------------------
1 | // UIActivityIndicatorView+AFNetworking.m
2 | // Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ )
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a copy
5 | // of this software and associated documentation files (the "Software"), to deal
6 | // in the Software without restriction, including without limitation the rights
7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | // copies of the Software, and to permit persons to whom the Software is
9 | // furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20 | // THE SOFTWARE.
21 |
22 | #import "UIActivityIndicatorView+AFNetworking.h"
23 | #import
24 |
25 | #if TARGET_OS_IOS || TARGET_OS_TV
26 |
27 | #import "AFURLSessionManager.h"
28 |
29 | @interface AFActivityIndicatorViewNotificationObserver : NSObject
30 | @property (readonly, nonatomic, weak) UIActivityIndicatorView *activityIndicatorView;
31 | - (instancetype)initWithActivityIndicatorView:(UIActivityIndicatorView *)activityIndicatorView;
32 |
33 | - (void)setAnimatingWithStateOfTask:(NSURLSessionTask *)task;
34 |
35 | @end
36 |
37 | @implementation UIActivityIndicatorView (AFNetworking)
38 |
39 | - (AFActivityIndicatorViewNotificationObserver *)af_notificationObserver {
40 | AFActivityIndicatorViewNotificationObserver *notificationObserver = objc_getAssociatedObject(self, @selector(af_notificationObserver));
41 | if (notificationObserver == nil) {
42 | notificationObserver = [[AFActivityIndicatorViewNotificationObserver alloc] initWithActivityIndicatorView:self];
43 | objc_setAssociatedObject(self, @selector(af_notificationObserver), notificationObserver, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
44 | }
45 | return notificationObserver;
46 | }
47 |
48 | - (void)setAnimatingWithStateOfTask:(NSURLSessionTask *)task {
49 | [[self af_notificationObserver] setAnimatingWithStateOfTask:task];
50 | }
51 |
52 | @end
53 |
54 | @implementation AFActivityIndicatorViewNotificationObserver
55 |
56 | - (instancetype)initWithActivityIndicatorView:(UIActivityIndicatorView *)activityIndicatorView
57 | {
58 | self = [super init];
59 | if (self) {
60 | _activityIndicatorView = activityIndicatorView;
61 | }
62 | return self;
63 | }
64 |
65 | - (void)setAnimatingWithStateOfTask:(NSURLSessionTask *)task {
66 | NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter];
67 |
68 | [notificationCenter removeObserver:self name:AFNetworkingTaskDidResumeNotification object:nil];
69 | [notificationCenter removeObserver:self name:AFNetworkingTaskDidSuspendNotification object:nil];
70 | [notificationCenter removeObserver:self name:AFNetworkingTaskDidCompleteNotification object:nil];
71 |
72 | if (task) {
73 | if (task.state != NSURLSessionTaskStateCompleted) {
74 | UIActivityIndicatorView *activityIndicatorView = self.activityIndicatorView;
75 | if (task.state == NSURLSessionTaskStateRunning) {
76 | [activityIndicatorView startAnimating];
77 | } else {
78 | [activityIndicatorView stopAnimating];
79 | }
80 |
81 | [notificationCenter addObserver:self selector:@selector(af_startAnimating) name:AFNetworkingTaskDidResumeNotification object:task];
82 | [notificationCenter addObserver:self selector:@selector(af_stopAnimating) name:AFNetworkingTaskDidCompleteNotification object:task];
83 | [notificationCenter addObserver:self selector:@selector(af_stopAnimating) name:AFNetworkingTaskDidSuspendNotification object:task];
84 | }
85 | }
86 | }
87 |
88 | #pragma mark -
89 |
90 | - (void)af_startAnimating {
91 | dispatch_async(dispatch_get_main_queue(), ^{
92 | [self.activityIndicatorView startAnimating];
93 | });
94 | }
95 |
96 | - (void)af_stopAnimating {
97 | dispatch_async(dispatch_get_main_queue(), ^{
98 | [self.activityIndicatorView stopAnimating];
99 | });
100 | }
101 |
102 | #pragma mark -
103 |
104 | - (void)dealloc {
105 | NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter];
106 |
107 | [notificationCenter removeObserver:self name:AFNetworkingTaskDidCompleteNotification object:nil];
108 | [notificationCenter removeObserver:self name:AFNetworkingTaskDidResumeNotification object:nil];
109 | [notificationCenter removeObserver:self name:AFNetworkingTaskDidSuspendNotification object:nil];
110 | }
111 |
112 | @end
113 |
114 | #endif
115 |
--------------------------------------------------------------------------------
/PasteBin/Pods/AFNetworking/UIKit+AFNetworking/UIImage+AFNetworking.h:
--------------------------------------------------------------------------------
1 | //
2 | // UIImage+AFNetworking.h
3 | //
4 | //
5 | // Created by Paulo Ferreira on 08/07/15.
6 | //
7 | // Permission is hereby granted, free of charge, to any person obtaining a copy
8 | // of this software and associated documentation files (the "Software"), to deal
9 | // in the Software without restriction, including without limitation the rights
10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11 | // copies of the Software, and to permit persons to whom the Software is
12 | // furnished to do so, subject to the following conditions:
13 | //
14 | // The above copyright notice and this permission notice shall be included in
15 | // all copies or substantial portions of the Software.
16 | //
17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23 | // THE SOFTWARE.
24 |
25 | #if TARGET_OS_IOS || TARGET_OS_TV
26 |
27 | #import
28 |
29 | @interface UIImage (AFNetworking)
30 |
31 | + (UIImage*) safeImageWithData:(NSData*)data;
32 |
33 | @end
34 |
35 | #endif
36 |
--------------------------------------------------------------------------------
/PasteBin/Pods/AFNetworking/UIKit+AFNetworking/UIImageView+AFNetworking.h:
--------------------------------------------------------------------------------
1 | // UIImageView+AFNetworking.h
2 | // Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ )
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a copy
5 | // of this software and associated documentation files (the "Software"), to deal
6 | // in the Software without restriction, including without limitation the rights
7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | // copies of the Software, and to permit persons to whom the Software is
9 | // furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20 | // THE SOFTWARE.
21 |
22 | #import
23 |
24 | #import
25 |
26 | #if TARGET_OS_IOS || TARGET_OS_TV
27 |
28 | #import
29 |
30 | NS_ASSUME_NONNULL_BEGIN
31 |
32 | @class AFImageDownloader;
33 |
34 | /**
35 | This category adds methods to the UIKit framework's `UIImageView` class. The methods in this category provide support for loading remote images asynchronously from a URL.
36 | */
37 | @interface UIImageView (AFNetworking)
38 |
39 | ///------------------------------------
40 | /// @name Accessing the Image Downloader
41 | ///------------------------------------
42 |
43 | /**
44 | Set the shared image downloader used to download images.
45 |
46 | @param imageDownloader The shared image downloader used to download images.
47 | */
48 | + (void)setSharedImageDownloader:(AFImageDownloader *)imageDownloader;
49 |
50 | /**
51 | The shared image downloader used to download images.
52 | */
53 | + (AFImageDownloader *)sharedImageDownloader;
54 |
55 | ///--------------------
56 | /// @name Setting Image
57 | ///--------------------
58 |
59 | /**
60 | Asynchronously downloads an image from the specified URL, and sets it once the request is finished. Any previous image request for the receiver will be cancelled.
61 |
62 | If the image is cached locally, the image is set immediately, otherwise the specified placeholder image will be set immediately, and then the remote image will be set once the request is finished.
63 |
64 | By default, URL requests have a `Accept` header field value of "image / *", a cache policy of `NSURLCacheStorageAllowed` and a timeout interval of 30 seconds, and are set not handle cookies. To configure URL requests differently, use `setImageWithURLRequest:placeholderImage:success:failure:`
65 |
66 | @param url The URL used for the image request.
67 | */
68 | - (void)setImageWithURL:(NSURL *)url;
69 |
70 | /**
71 | Asynchronously downloads an image from the specified URL, and sets it once the request is finished. Any previous image request for the receiver will be cancelled.
72 |
73 | If the image is cached locally, the image is set immediately, otherwise the specified placeholder image will be set immediately, and then the remote image will be set once the request is finished.
74 |
75 | By default, URL requests have a `Accept` header field value of "image / *", a cache policy of `NSURLCacheStorageAllowed` and a timeout interval of 30 seconds, and are set not handle cookies. To configure URL requests differently, use `setImageWithURLRequest:placeholderImage:success:failure:`
76 |
77 | @param url The URL used for the image request.
78 | @param placeholderImage The image to be set initially, until the image request finishes. If `nil`, the image view will not change its image until the image request finishes.
79 | */
80 | - (void)setImageWithURL:(NSURL *)url
81 | placeholderImage:(nullable UIImage *)placeholderImage;
82 |
83 | /**
84 | Asynchronously downloads an image from the specified URL request, and sets it once the request is finished. Any previous image request for the receiver will be cancelled.
85 |
86 | If the image is cached locally, the image is set immediately, otherwise the specified placeholder image will be set immediately, and then the remote image will be set once the request is finished.
87 |
88 | If a success block is specified, it is the responsibility of the block to set the image of the image view before returning. If no success block is specified, the default behavior of setting the image with `self.image = image` is applied.
89 |
90 | @param urlRequest The URL request used for the image request.
91 | @param placeholderImage The image to be set initially, until the image request finishes. If `nil`, the image view will not change its image until the image request finishes.
92 | @param success A block to be executed when the image data task finishes successfully. This block has no return value and takes three arguments: the request sent from the client, the response received from the server, and the image created from the response data of request. If the image was returned from cache, the response parameter will be `nil`.
93 | @param failure A block object to be executed when the image data task finishes unsuccessfully, or that finishes successfully. This block has no return value and takes three arguments: the request sent from the client, the response received from the server, and the error object describing the network or parsing error that occurred.
94 | */
95 | - (void)setImageWithURLRequest:(NSURLRequest *)urlRequest
96 | placeholderImage:(nullable UIImage *)placeholderImage
97 | success:(nullable void (^)(NSURLRequest *request, NSHTTPURLResponse * _Nullable response, UIImage *image))success
98 | failure:(nullable void (^)(NSURLRequest *request, NSHTTPURLResponse * _Nullable response, NSError *error))failure;
99 |
100 | /**
101 | Cancels any executing image operation for the receiver, if one exists.
102 | */
103 | - (void)cancelImageDownloadTask;
104 |
105 | @end
106 |
107 | NS_ASSUME_NONNULL_END
108 |
109 | #endif
110 |
--------------------------------------------------------------------------------
/PasteBin/Pods/AFNetworking/UIKit+AFNetworking/UIImageView+AFNetworking.m:
--------------------------------------------------------------------------------
1 | // UIImageView+AFNetworking.m
2 | // Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ )
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a copy
5 | // of this software and associated documentation files (the "Software"), to deal
6 | // in the Software without restriction, including without limitation the rights
7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | // copies of the Software, and to permit persons to whom the Software is
9 | // furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20 | // THE SOFTWARE.
21 |
22 | #import "UIImageView+AFNetworking.h"
23 |
24 | #import
25 |
26 | #if TARGET_OS_IOS || TARGET_OS_TV
27 |
28 | #import "AFImageDownloader.h"
29 |
30 | @interface UIImageView (_AFNetworking)
31 | @property (readwrite, nonatomic, strong, setter = af_setActiveImageDownloadReceipt:) AFImageDownloadReceipt *af_activeImageDownloadReceipt;
32 | @end
33 |
34 | @implementation UIImageView (_AFNetworking)
35 |
36 | - (AFImageDownloadReceipt *)af_activeImageDownloadReceipt {
37 | return (AFImageDownloadReceipt *)objc_getAssociatedObject(self, @selector(af_activeImageDownloadReceipt));
38 | }
39 |
40 | - (void)af_setActiveImageDownloadReceipt:(AFImageDownloadReceipt *)imageDownloadReceipt {
41 | objc_setAssociatedObject(self, @selector(af_activeImageDownloadReceipt), imageDownloadReceipt, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
42 | }
43 |
44 | @end
45 |
46 | #pragma mark -
47 |
48 | @implementation UIImageView (AFNetworking)
49 |
50 | + (AFImageDownloader *)sharedImageDownloader {
51 | return objc_getAssociatedObject(self, @selector(sharedImageDownloader)) ?: [AFImageDownloader defaultInstance];
52 | }
53 |
54 | + (void)setSharedImageDownloader:(AFImageDownloader *)imageDownloader {
55 | objc_setAssociatedObject(self, @selector(sharedImageDownloader), imageDownloader, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
56 | }
57 |
58 | #pragma mark -
59 |
60 | - (void)setImageWithURL:(NSURL *)url {
61 | [self setImageWithURL:url placeholderImage:nil];
62 | }
63 |
64 | - (void)setImageWithURL:(NSURL *)url
65 | placeholderImage:(UIImage *)placeholderImage
66 | {
67 | NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url];
68 | [request addValue:@"image/*" forHTTPHeaderField:@"Accept"];
69 |
70 | [self setImageWithURLRequest:request placeholderImage:placeholderImage success:nil failure:nil];
71 | }
72 |
73 | - (void)setImageWithURLRequest:(NSURLRequest *)urlRequest
74 | placeholderImage:(UIImage *)placeholderImage
75 | success:(void (^)(NSURLRequest *request, NSHTTPURLResponse * _Nullable response, UIImage *image))success
76 | failure:(void (^)(NSURLRequest *request, NSHTTPURLResponse * _Nullable response, NSError *error))failure
77 | {
78 |
79 | if ([urlRequest URL] == nil) {
80 | self.image = placeholderImage;
81 | if (failure) {
82 | NSError *error = [NSError errorWithDomain:NSURLErrorDomain code:NSURLErrorBadURL userInfo:nil];
83 | failure(urlRequest, nil, error);
84 | }
85 | return;
86 | }
87 |
88 | if ([self isActiveTaskURLEqualToURLRequest:urlRequest]){
89 | return;
90 | }
91 |
92 | [self cancelImageDownloadTask];
93 |
94 | AFImageDownloader *downloader = [[self class] sharedImageDownloader];
95 | id imageCache = downloader.imageCache;
96 |
97 | //Use the image from the image cache if it exists
98 | UIImage *cachedImage = [imageCache imageforRequest:urlRequest withAdditionalIdentifier:nil];
99 | if (cachedImage) {
100 | if (success) {
101 | success(urlRequest, nil, cachedImage);
102 | } else {
103 | self.image = cachedImage;
104 | }
105 | [self clearActiveDownloadInformation];
106 | } else {
107 | if (placeholderImage) {
108 | self.image = placeholderImage;
109 | }
110 |
111 | __weak __typeof(self)weakSelf = self;
112 | NSUUID *downloadID = [NSUUID UUID];
113 | AFImageDownloadReceipt *receipt;
114 | receipt = [downloader
115 | downloadImageForURLRequest:urlRequest
116 | withReceiptID:downloadID
117 | success:^(NSURLRequest * _Nonnull request, NSHTTPURLResponse * _Nullable response, UIImage * _Nonnull responseObject) {
118 | __strong __typeof(weakSelf)strongSelf = weakSelf;
119 | if ([strongSelf.af_activeImageDownloadReceipt.receiptID isEqual:downloadID]) {
120 | if (success) {
121 | success(request, response, responseObject);
122 | } else if(responseObject) {
123 | strongSelf.image = responseObject;
124 | }
125 | [strongSelf clearActiveDownloadInformation];
126 | }
127 |
128 | }
129 | failure:^(NSURLRequest * _Nonnull request, NSHTTPURLResponse * _Nullable response, NSError * _Nonnull error) {
130 | __strong __typeof(weakSelf)strongSelf = weakSelf;
131 | if ([strongSelf.af_activeImageDownloadReceipt.receiptID isEqual:downloadID]) {
132 | if (failure) {
133 | failure(request, response, error);
134 | }
135 | [strongSelf clearActiveDownloadInformation];
136 | }
137 | }];
138 |
139 | self.af_activeImageDownloadReceipt = receipt;
140 | }
141 | }
142 |
143 | - (void)cancelImageDownloadTask {
144 | if (self.af_activeImageDownloadReceipt != nil) {
145 | [[self.class sharedImageDownloader] cancelTaskForImageDownloadReceipt:self.af_activeImageDownloadReceipt];
146 | [self clearActiveDownloadInformation];
147 | }
148 | }
149 |
150 | - (void)clearActiveDownloadInformation {
151 | self.af_activeImageDownloadReceipt = nil;
152 | }
153 |
154 | - (BOOL)isActiveTaskURLEqualToURLRequest:(NSURLRequest *)urlRequest {
155 | return [self.af_activeImageDownloadReceipt.task.originalRequest.URL.absoluteString isEqualToString:urlRequest.URL.absoluteString];
156 | }
157 |
158 | @end
159 |
160 | #endif
161 |
--------------------------------------------------------------------------------
/PasteBin/Pods/AFNetworking/UIKit+AFNetworking/UIKit+AFNetworking.h:
--------------------------------------------------------------------------------
1 | // UIKit+AFNetworking.h
2 | //
3 | // Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ )
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
13 | // all 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
21 | // THE SOFTWARE.
22 |
23 | #if TARGET_OS_IOS || TARGET_OS_TV
24 | #import
25 |
26 | #ifndef _UIKIT_AFNETWORKING_
27 | #define _UIKIT_AFNETWORKING_
28 |
29 | #if TARGET_OS_IOS
30 | #import "AFAutoPurgingImageCache.h"
31 | #import "AFImageDownloader.h"
32 | #import "AFNetworkActivityIndicatorManager.h"
33 | #import "UIRefreshControl+AFNetworking.h"
34 | #import "UIWebView+AFNetworking.h"
35 | #endif
36 |
37 | #import "UIActivityIndicatorView+AFNetworking.h"
38 | #import "UIButton+AFNetworking.h"
39 | #import "UIImageView+AFNetworking.h"
40 | #import "UIProgressView+AFNetworking.h"
41 | #endif /* _UIKIT_AFNETWORKING_ */
42 | #endif
43 |
--------------------------------------------------------------------------------
/PasteBin/Pods/AFNetworking/UIKit+AFNetworking/UIProgressView+AFNetworking.h:
--------------------------------------------------------------------------------
1 | // UIProgressView+AFNetworking.h
2 | // Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ )
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a copy
5 | // of this software and associated documentation files (the "Software"), to deal
6 | // in the Software without restriction, including without limitation the rights
7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | // copies of the Software, and to permit persons to whom the Software is
9 | // furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20 | // THE SOFTWARE.
21 |
22 | #import
23 |
24 | #import
25 |
26 | #if TARGET_OS_IOS || TARGET_OS_TV
27 |
28 | #import
29 |
30 | NS_ASSUME_NONNULL_BEGIN
31 |
32 |
33 | /**
34 | This category adds methods to the UIKit framework's `UIProgressView` class. The methods in this category provide support for binding the progress to the upload and download progress of a session task.
35 | */
36 | @interface UIProgressView (AFNetworking)
37 |
38 | ///------------------------------------
39 | /// @name Setting Session Task Progress
40 | ///------------------------------------
41 |
42 | /**
43 | Binds the progress to the upload progress of the specified session task.
44 |
45 | @param task The session task.
46 | @param animated `YES` if the change should be animated, `NO` if the change should happen immediately.
47 | */
48 | - (void)setProgressWithUploadProgressOfTask:(NSURLSessionUploadTask *)task
49 | animated:(BOOL)animated;
50 |
51 | /**
52 | Binds the progress to the download progress of the specified session task.
53 |
54 | @param task The session task.
55 | @param animated `YES` if the change should be animated, `NO` if the change should happen immediately.
56 | */
57 | - (void)setProgressWithDownloadProgressOfTask:(NSURLSessionDownloadTask *)task
58 | animated:(BOOL)animated;
59 |
60 | @end
61 |
62 | NS_ASSUME_NONNULL_END
63 |
64 | #endif
65 |
--------------------------------------------------------------------------------
/PasteBin/Pods/AFNetworking/UIKit+AFNetworking/UIProgressView+AFNetworking.m:
--------------------------------------------------------------------------------
1 | // UIProgressView+AFNetworking.m
2 | // Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ )
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a copy
5 | // of this software and associated documentation files (the "Software"), to deal
6 | // in the Software without restriction, including without limitation the rights
7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | // copies of the Software, and to permit persons to whom the Software is
9 | // furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20 | // THE SOFTWARE.
21 |
22 | #import "UIProgressView+AFNetworking.h"
23 |
24 | #import
25 |
26 | #if TARGET_OS_IOS || TARGET_OS_TV
27 |
28 | #import "AFURLSessionManager.h"
29 |
30 | static void * AFTaskCountOfBytesSentContext = &AFTaskCountOfBytesSentContext;
31 | static void * AFTaskCountOfBytesReceivedContext = &AFTaskCountOfBytesReceivedContext;
32 |
33 | #pragma mark -
34 |
35 | @implementation UIProgressView (AFNetworking)
36 |
37 | - (BOOL)af_uploadProgressAnimated {
38 | return [(NSNumber *)objc_getAssociatedObject(self, @selector(af_uploadProgressAnimated)) boolValue];
39 | }
40 |
41 | - (void)af_setUploadProgressAnimated:(BOOL)animated {
42 | objc_setAssociatedObject(self, @selector(af_uploadProgressAnimated), @(animated), OBJC_ASSOCIATION_RETAIN_NONATOMIC);
43 | }
44 |
45 | - (BOOL)af_downloadProgressAnimated {
46 | return [(NSNumber *)objc_getAssociatedObject(self, @selector(af_downloadProgressAnimated)) boolValue];
47 | }
48 |
49 | - (void)af_setDownloadProgressAnimated:(BOOL)animated {
50 | objc_setAssociatedObject(self, @selector(af_downloadProgressAnimated), @(animated), OBJC_ASSOCIATION_RETAIN_NONATOMIC);
51 | }
52 |
53 | #pragma mark -
54 |
55 | - (void)setProgressWithUploadProgressOfTask:(NSURLSessionUploadTask *)task
56 | animated:(BOOL)animated
57 | {
58 | if (task.state == NSURLSessionTaskStateCompleted) {
59 | return;
60 | }
61 |
62 | [task addObserver:self forKeyPath:@"state" options:(NSKeyValueObservingOptions)0 context:AFTaskCountOfBytesSentContext];
63 | [task addObserver:self forKeyPath:@"countOfBytesSent" options:(NSKeyValueObservingOptions)0 context:AFTaskCountOfBytesSentContext];
64 |
65 | [self af_setUploadProgressAnimated:animated];
66 | }
67 |
68 | - (void)setProgressWithDownloadProgressOfTask:(NSURLSessionDownloadTask *)task
69 | animated:(BOOL)animated
70 | {
71 | if (task.state == NSURLSessionTaskStateCompleted) {
72 | return;
73 | }
74 |
75 | [task addObserver:self forKeyPath:@"state" options:(NSKeyValueObservingOptions)0 context:AFTaskCountOfBytesReceivedContext];
76 | [task addObserver:self forKeyPath:@"countOfBytesReceived" options:(NSKeyValueObservingOptions)0 context:AFTaskCountOfBytesReceivedContext];
77 |
78 | [self af_setDownloadProgressAnimated:animated];
79 | }
80 |
81 | #pragma mark - NSKeyValueObserving
82 |
83 | - (void)observeValueForKeyPath:(NSString *)keyPath
84 | ofObject:(id)object
85 | change:(__unused NSDictionary *)change
86 | context:(void *)context
87 | {
88 | if (context == AFTaskCountOfBytesSentContext || context == AFTaskCountOfBytesReceivedContext) {
89 | if ([keyPath isEqualToString:NSStringFromSelector(@selector(countOfBytesSent))]) {
90 | if ([object countOfBytesExpectedToSend] > 0) {
91 | dispatch_async(dispatch_get_main_queue(), ^{
92 | [self setProgress:[object countOfBytesSent] / ([object countOfBytesExpectedToSend] * 1.0f) animated:self.af_uploadProgressAnimated];
93 | });
94 | }
95 | }
96 |
97 | if ([keyPath isEqualToString:NSStringFromSelector(@selector(countOfBytesReceived))]) {
98 | if ([object countOfBytesExpectedToReceive] > 0) {
99 | dispatch_async(dispatch_get_main_queue(), ^{
100 | [self setProgress:[object countOfBytesReceived] / ([object countOfBytesExpectedToReceive] * 1.0f) animated:self.af_downloadProgressAnimated];
101 | });
102 | }
103 | }
104 |
105 | if ([keyPath isEqualToString:NSStringFromSelector(@selector(state))]) {
106 | if ([(NSURLSessionTask *)object state] == NSURLSessionTaskStateCompleted) {
107 | @try {
108 | [object removeObserver:self forKeyPath:NSStringFromSelector(@selector(state))];
109 |
110 | if (context == AFTaskCountOfBytesSentContext) {
111 | [object removeObserver:self forKeyPath:NSStringFromSelector(@selector(countOfBytesSent))];
112 | }
113 |
114 | if (context == AFTaskCountOfBytesReceivedContext) {
115 | [object removeObserver:self forKeyPath:NSStringFromSelector(@selector(countOfBytesReceived))];
116 | }
117 | }
118 | @catch (NSException * __unused exception) {}
119 | }
120 | }
121 | }
122 | }
123 |
124 | @end
125 |
126 | #endif
127 |
--------------------------------------------------------------------------------
/PasteBin/Pods/AFNetworking/UIKit+AFNetworking/UIRefreshControl+AFNetworking.h:
--------------------------------------------------------------------------------
1 | // UIRefreshControl+AFNetworking.m
2 | //
3 | // Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ )
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
13 | // all 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
21 | // THE SOFTWARE.
22 |
23 | #import
24 |
25 | #import
26 |
27 | #if TARGET_OS_IOS
28 |
29 | #import
30 |
31 | NS_ASSUME_NONNULL_BEGIN
32 |
33 | /**
34 | This category adds methods to the UIKit framework's `UIRefreshControl` class. The methods in this category provide support for automatically beginning and ending refreshing depending on the loading state of a session task.
35 | */
36 | @interface UIRefreshControl (AFNetworking)
37 |
38 | ///-----------------------------------
39 | /// @name Refreshing for Session Tasks
40 | ///-----------------------------------
41 |
42 | /**
43 | Binds the refreshing state to the state of the specified task.
44 |
45 | @param task The task. If `nil`, automatic updating from any previously specified operation will be disabled.
46 | */
47 | - (void)setRefreshingWithStateOfTask:(NSURLSessionTask *)task;
48 |
49 | @end
50 |
51 | NS_ASSUME_NONNULL_END
52 |
53 | #endif
54 |
--------------------------------------------------------------------------------
/PasteBin/Pods/AFNetworking/UIKit+AFNetworking/UIRefreshControl+AFNetworking.m:
--------------------------------------------------------------------------------
1 | // UIRefreshControl+AFNetworking.m
2 | //
3 | // Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ )
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
13 | // all 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
21 | // THE SOFTWARE.
22 |
23 | #import "UIRefreshControl+AFNetworking.h"
24 | #import
25 |
26 | #if TARGET_OS_IOS
27 |
28 | #import "AFURLSessionManager.h"
29 |
30 | @interface AFRefreshControlNotificationObserver : NSObject
31 | @property (readonly, nonatomic, weak) UIRefreshControl *refreshControl;
32 | - (instancetype)initWithActivityRefreshControl:(UIRefreshControl *)refreshControl;
33 |
34 | - (void)setRefreshingWithStateOfTask:(NSURLSessionTask *)task;
35 |
36 | @end
37 |
38 | @implementation UIRefreshControl (AFNetworking)
39 |
40 | - (AFRefreshControlNotificationObserver *)af_notificationObserver {
41 | AFRefreshControlNotificationObserver *notificationObserver = objc_getAssociatedObject(self, @selector(af_notificationObserver));
42 | if (notificationObserver == nil) {
43 | notificationObserver = [[AFRefreshControlNotificationObserver alloc] initWithActivityRefreshControl:self];
44 | objc_setAssociatedObject(self, @selector(af_notificationObserver), notificationObserver, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
45 | }
46 | return notificationObserver;
47 | }
48 |
49 | - (void)setRefreshingWithStateOfTask:(NSURLSessionTask *)task {
50 | [[self af_notificationObserver] setRefreshingWithStateOfTask:task];
51 | }
52 |
53 | @end
54 |
55 | @implementation AFRefreshControlNotificationObserver
56 |
57 | - (instancetype)initWithActivityRefreshControl:(UIRefreshControl *)refreshControl
58 | {
59 | self = [super init];
60 | if (self) {
61 | _refreshControl = refreshControl;
62 | }
63 | return self;
64 | }
65 |
66 | - (void)setRefreshingWithStateOfTask:(NSURLSessionTask *)task {
67 | NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter];
68 |
69 | [notificationCenter removeObserver:self name:AFNetworkingTaskDidResumeNotification object:nil];
70 | [notificationCenter removeObserver:self name:AFNetworkingTaskDidSuspendNotification object:nil];
71 | [notificationCenter removeObserver:self name:AFNetworkingTaskDidCompleteNotification object:nil];
72 |
73 | if (task) {
74 | UIRefreshControl *refreshControl = self.refreshControl;
75 | if (task.state == NSURLSessionTaskStateRunning) {
76 | [refreshControl beginRefreshing];
77 |
78 | [notificationCenter addObserver:self selector:@selector(af_beginRefreshing) name:AFNetworkingTaskDidResumeNotification object:task];
79 | [notificationCenter addObserver:self selector:@selector(af_endRefreshing) name:AFNetworkingTaskDidCompleteNotification object:task];
80 | [notificationCenter addObserver:self selector:@selector(af_endRefreshing) name:AFNetworkingTaskDidSuspendNotification object:task];
81 | } else {
82 | [refreshControl endRefreshing];
83 | }
84 | }
85 | }
86 |
87 | #pragma mark -
88 |
89 | - (void)af_beginRefreshing {
90 | dispatch_async(dispatch_get_main_queue(), ^{
91 | [self.refreshControl beginRefreshing];
92 | });
93 | }
94 |
95 | - (void)af_endRefreshing {
96 | dispatch_async(dispatch_get_main_queue(), ^{
97 | [self.refreshControl endRefreshing];
98 | });
99 | }
100 |
101 | #pragma mark -
102 |
103 | - (void)dealloc {
104 | NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter];
105 |
106 | [notificationCenter removeObserver:self name:AFNetworkingTaskDidCompleteNotification object:nil];
107 | [notificationCenter removeObserver:self name:AFNetworkingTaskDidResumeNotification object:nil];
108 | [notificationCenter removeObserver:self name:AFNetworkingTaskDidSuspendNotification object:nil];
109 | }
110 |
111 | @end
112 |
113 | #endif
114 |
--------------------------------------------------------------------------------
/PasteBin/Pods/AFNetworking/UIKit+AFNetworking/UIWebView+AFNetworking.h:
--------------------------------------------------------------------------------
1 | // UIWebView+AFNetworking.h
2 | // Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ )
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a copy
5 | // of this software and associated documentation files (the "Software"), to deal
6 | // in the Software without restriction, including without limitation the rights
7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | // copies of the Software, and to permit persons to whom the Software is
9 | // furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20 | // THE SOFTWARE.
21 |
22 | #import
23 |
24 | #import
25 |
26 | #if TARGET_OS_IOS
27 |
28 | #import
29 |
30 | NS_ASSUME_NONNULL_BEGIN
31 |
32 | @class AFHTTPSessionManager;
33 |
34 | /**
35 | This category adds methods to the UIKit framework's `UIWebView` class. The methods in this category provide increased control over the request cycle, including progress monitoring and success / failure handling.
36 |
37 | @discussion When using these category methods, make sure to assign `delegate` for the web view, which implements `–webView:shouldStartLoadWithRequest:navigationType:` appropriately. This allows for tapped links to be loaded through AFNetworking, and can ensure that `canGoBack` & `canGoForward` update their values correctly.
38 | */
39 | @interface UIWebView (AFNetworking)
40 |
41 | /**
42 | The session manager used to download all requests.
43 | */
44 | @property (nonatomic, strong) AFHTTPSessionManager *sessionManager;
45 |
46 | /**
47 | Asynchronously loads the specified request.
48 |
49 | @param request A URL request identifying the location of the content to load. This must not be `nil`.
50 | @param progress A progress object monitoring the current download progress.
51 | @param success A block object to be executed when the request finishes loading successfully. This block returns the HTML string to be loaded by the web view, and takes two arguments: the response, and the response string.
52 | @param failure A block object to be executed when the data task finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the response data. This block has no return value and takes a single argument: the error that occurred.
53 | */
54 | - (void)loadRequest:(NSURLRequest *)request
55 | progress:(NSProgress * _Nullable __autoreleasing * _Nullable)progress
56 | success:(nullable NSString * (^)(NSHTTPURLResponse *response, NSString *HTML))success
57 | failure:(nullable void (^)(NSError *error))failure;
58 |
59 | /**
60 | Asynchronously loads the data associated with a particular request with a specified MIME type and text encoding.
61 |
62 | @param request A URL request identifying the location of the content to load. This must not be `nil`.
63 | @param MIMEType The MIME type of the content. Defaults to the content type of the response if not specified.
64 | @param textEncodingName The IANA encoding name, as in `utf-8` or `utf-16`. Defaults to the response text encoding if not specified.
65 | @param progress A progress object monitoring the current download progress.
66 | @param success A block object to be executed when the request finishes loading successfully. This block returns the data to be loaded by the web view and takes two arguments: the response, and the downloaded data.
67 | @param failure A block object to be executed when the data task finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the response data. This block has no return value and takes a single argument: the error that occurred.
68 | */
69 | - (void)loadRequest:(NSURLRequest *)request
70 | MIMEType:(nullable NSString *)MIMEType
71 | textEncodingName:(nullable NSString *)textEncodingName
72 | progress:(NSProgress * _Nullable __autoreleasing * _Nullable)progress
73 | success:(nullable NSData * (^)(NSHTTPURLResponse *response, NSData *data))success
74 | failure:(nullable void (^)(NSError *error))failure;
75 |
76 | @end
77 |
78 | NS_ASSUME_NONNULL_END
79 |
80 | #endif
81 |
--------------------------------------------------------------------------------
/PasteBin/Pods/AFNetworking/UIKit+AFNetworking/UIWebView+AFNetworking.m:
--------------------------------------------------------------------------------
1 | // UIWebView+AFNetworking.m
2 | // Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ )
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a copy
5 | // of this software and associated documentation files (the "Software"), to deal
6 | // in the Software without restriction, including without limitation the rights
7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | // copies of the Software, and to permit persons to whom the Software is
9 | // furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20 | // THE SOFTWARE.
21 |
22 | #import "UIWebView+AFNetworking.h"
23 |
24 | #import
25 |
26 | #if TARGET_OS_IOS
27 |
28 | #import "AFHTTPSessionManager.h"
29 | #import "AFURLResponseSerialization.h"
30 | #import "AFURLRequestSerialization.h"
31 |
32 | @interface UIWebView (_AFNetworking)
33 | @property (readwrite, nonatomic, strong, setter = af_setURLSessionTask:) NSURLSessionDataTask *af_URLSessionTask;
34 | @end
35 |
36 | @implementation UIWebView (_AFNetworking)
37 |
38 | - (NSURLSessionDataTask *)af_URLSessionTask {
39 | return (NSURLSessionDataTask *)objc_getAssociatedObject(self, @selector(af_URLSessionTask));
40 | }
41 |
42 | - (void)af_setURLSessionTask:(NSURLSessionDataTask *)af_URLSessionTask {
43 | objc_setAssociatedObject(self, @selector(af_URLSessionTask), af_URLSessionTask, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
44 | }
45 |
46 | @end
47 |
48 | #pragma mark -
49 |
50 | @implementation UIWebView (AFNetworking)
51 |
52 | - (AFHTTPSessionManager *)sessionManager {
53 | static AFHTTPSessionManager *_af_defaultHTTPSessionManager = nil;
54 | static dispatch_once_t onceToken;
55 | dispatch_once(&onceToken, ^{
56 | _af_defaultHTTPSessionManager = [[AFHTTPSessionManager alloc] initWithSessionConfiguration:[NSURLSessionConfiguration defaultSessionConfiguration]];
57 | _af_defaultHTTPSessionManager.requestSerializer = [AFHTTPRequestSerializer serializer];
58 | _af_defaultHTTPSessionManager.responseSerializer = [AFHTTPResponseSerializer serializer];
59 | });
60 |
61 | return objc_getAssociatedObject(self, @selector(sessionManager)) ?: _af_defaultHTTPSessionManager;
62 | }
63 |
64 | - (void)setSessionManager:(AFHTTPSessionManager *)sessionManager {
65 | objc_setAssociatedObject(self, @selector(sessionManager), sessionManager, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
66 | }
67 |
68 | - (AFHTTPResponseSerializer *)responseSerializer {
69 | static AFHTTPResponseSerializer *_af_defaultResponseSerializer = nil;
70 | static dispatch_once_t onceToken;
71 | dispatch_once(&onceToken, ^{
72 | _af_defaultResponseSerializer = [AFHTTPResponseSerializer serializer];
73 | });
74 |
75 | return objc_getAssociatedObject(self, @selector(responseSerializer)) ?: _af_defaultResponseSerializer;
76 | }
77 |
78 | - (void)setResponseSerializer:(AFHTTPResponseSerializer *)responseSerializer {
79 | objc_setAssociatedObject(self, @selector(responseSerializer), responseSerializer, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
80 | }
81 |
82 | #pragma mark -
83 |
84 | - (void)loadRequest:(NSURLRequest *)request
85 | progress:(NSProgress * _Nullable __autoreleasing * _Nullable)progress
86 | success:(NSString * (^)(NSHTTPURLResponse *response, NSString *HTML))success
87 | failure:(void (^)(NSError *error))failure
88 | {
89 | [self loadRequest:request MIMEType:nil textEncodingName:nil progress:progress success:^NSData *(NSHTTPURLResponse *response, NSData *data) {
90 | NSStringEncoding stringEncoding = NSUTF8StringEncoding;
91 | if (response.textEncodingName) {
92 | CFStringEncoding encoding = CFStringConvertIANACharSetNameToEncoding((CFStringRef)response.textEncodingName);
93 | if (encoding != kCFStringEncodingInvalidId) {
94 | stringEncoding = CFStringConvertEncodingToNSStringEncoding(encoding);
95 | }
96 | }
97 |
98 | NSString *string = [[NSString alloc] initWithData:data encoding:stringEncoding];
99 | if (success) {
100 | string = success(response, string);
101 | }
102 |
103 | return [string dataUsingEncoding:stringEncoding];
104 | } failure:failure];
105 | }
106 |
107 | - (void)loadRequest:(NSURLRequest *)request
108 | MIMEType:(NSString *)MIMEType
109 | textEncodingName:(NSString *)textEncodingName
110 | progress:(NSProgress * _Nullable __autoreleasing * _Nullable)progress
111 | success:(NSData * (^)(NSHTTPURLResponse *response, NSData *data))success
112 | failure:(void (^)(NSError *error))failure
113 | {
114 | NSParameterAssert(request);
115 |
116 | if (self.af_URLSessionTask.state == NSURLSessionTaskStateRunning || self.af_URLSessionTask.state == NSURLSessionTaskStateSuspended) {
117 | [self.af_URLSessionTask cancel];
118 | }
119 | self.af_URLSessionTask = nil;
120 |
121 | __weak __typeof(self)weakSelf = self;
122 | __block NSURLSessionDataTask *dataTask;
123 | dataTask = [self.sessionManager
124 | dataTaskWithRequest:request
125 | uploadProgress:nil
126 | downloadProgress:nil
127 | completionHandler:^(NSURLResponse * _Nonnull response, id _Nonnull responseObject, NSError * _Nullable error) {
128 | __strong __typeof(weakSelf) strongSelf = weakSelf;
129 | if (error) {
130 | if (failure) {
131 | failure(error);
132 | }
133 | } else {
134 | if (success) {
135 | success((NSHTTPURLResponse *)response, responseObject);
136 | }
137 | [strongSelf loadData:responseObject MIMEType:MIMEType textEncodingName:textEncodingName baseURL:[dataTask.currentRequest URL]];
138 |
139 | if ([strongSelf.delegate respondsToSelector:@selector(webViewDidFinishLoad:)]) {
140 | [strongSelf.delegate webViewDidFinishLoad:strongSelf];
141 | }
142 | }
143 | }];
144 | self.af_URLSessionTask = dataTask;
145 | if (progress != nil) {
146 | *progress = [self.sessionManager downloadProgressForTask:dataTask];
147 | }
148 | [self.af_URLSessionTask resume];
149 |
150 | if ([self.delegate respondsToSelector:@selector(webViewDidStartLoad:)]) {
151 | [self.delegate webViewDidStartLoad:self];
152 | }
153 | }
154 |
155 | @end
156 |
157 | #endif
158 |
--------------------------------------------------------------------------------
/PasteBin/Pods/Manifest.lock:
--------------------------------------------------------------------------------
1 | PODS:
2 | - AFNetworking (3.2.1):
3 | - AFNetworking/NSURLSession (= 3.2.1)
4 | - AFNetworking/Reachability (= 3.2.1)
5 | - AFNetworking/Security (= 3.2.1)
6 | - AFNetworking/Serialization (= 3.2.1)
7 | - AFNetworking/UIKit (= 3.2.1)
8 | - AFNetworking/NSURLSession (3.2.1):
9 | - AFNetworking/Reachability
10 | - AFNetworking/Security
11 | - AFNetworking/Serialization
12 | - AFNetworking/Reachability (3.2.1)
13 | - AFNetworking/Security (3.2.1)
14 | - AFNetworking/Serialization (3.2.1)
15 | - AFNetworking/UIKit (3.2.1):
16 | - AFNetworking/NSURLSession
17 | - Highlightr (2.0.1)
18 | - SearchTextField (1.2.2)
19 |
20 | DEPENDENCIES:
21 | - AFNetworking
22 | - Highlightr (~> 2.0)
23 | - SearchTextField
24 |
25 | SPEC REPOS:
26 | https://github.com/cocoapods/specs.git:
27 | - AFNetworking
28 | - Highlightr
29 | - SearchTextField
30 |
31 | SPEC CHECKSUMS:
32 | AFNetworking: b6f891fdfaed196b46c7a83cf209e09697b94057
33 | Highlightr: 65655134dd0d5e1320afdd8a9d880c9e9dc0b437
34 | SearchTextField: a0992739d4b05dcbb40fb3a5cc6526bd991bdd23
35 |
36 | PODFILE CHECKSUM: df025333d225b1bfc27c8e3254e1a7570e54f0e9
37 |
38 | COCOAPODS: 1.6.0.beta.2
39 |
--------------------------------------------------------------------------------
/PasteBin/Pods/Target Support Files/AFNetworking/AFNetworking-dummy.m:
--------------------------------------------------------------------------------
1 | #import
2 | @interface PodsDummy_AFNetworking : NSObject
3 | @end
4 | @implementation PodsDummy_AFNetworking
5 | @end
6 |
--------------------------------------------------------------------------------
/PasteBin/Pods/Target Support Files/AFNetworking/AFNetworking-prefix.pch:
--------------------------------------------------------------------------------
1 | #ifdef __OBJC__
2 | #import
3 | #else
4 | #ifndef FOUNDATION_EXPORT
5 | #if defined(__cplusplus)
6 | #define FOUNDATION_EXPORT extern "C"
7 | #else
8 | #define FOUNDATION_EXPORT extern
9 | #endif
10 | #endif
11 | #endif
12 |
13 | #ifndef TARGET_OS_IOS
14 | #define TARGET_OS_IOS TARGET_OS_IPHONE
15 | #endif
16 |
17 | #ifndef TARGET_OS_WATCH
18 | #define TARGET_OS_WATCH 0
19 | #endif
20 |
21 | #ifndef TARGET_OS_TV
22 | #define TARGET_OS_TV 0
23 | #endif
24 |
--------------------------------------------------------------------------------
/PasteBin/Pods/Target Support Files/AFNetworking/AFNetworking-umbrella.h:
--------------------------------------------------------------------------------
1 | #ifdef __OBJC__
2 | #import
3 | #else
4 | #ifndef FOUNDATION_EXPORT
5 | #if defined(__cplusplus)
6 | #define FOUNDATION_EXPORT extern "C"
7 | #else
8 | #define FOUNDATION_EXPORT extern
9 | #endif
10 | #endif
11 | #endif
12 |
13 | #import "AFNetworking.h"
14 | #import "AFHTTPSessionManager.h"
15 | #import "AFURLSessionManager.h"
16 | #import "AFCompatibilityMacros.h"
17 | #import "AFNetworkReachabilityManager.h"
18 | #import "AFSecurityPolicy.h"
19 | #import "AFURLRequestSerialization.h"
20 | #import "AFURLResponseSerialization.h"
21 | #import "AFAutoPurgingImageCache.h"
22 | #import "AFImageDownloader.h"
23 | #import "AFNetworkActivityIndicatorManager.h"
24 | #import "UIActivityIndicatorView+AFNetworking.h"
25 | #import "UIButton+AFNetworking.h"
26 | #import "UIImage+AFNetworking.h"
27 | #import "UIImageView+AFNetworking.h"
28 | #import "UIKit+AFNetworking.h"
29 | #import "UIProgressView+AFNetworking.h"
30 | #import "UIRefreshControl+AFNetworking.h"
31 | #import "UIWebView+AFNetworking.h"
32 |
33 | FOUNDATION_EXPORT double AFNetworkingVersionNumber;
34 | FOUNDATION_EXPORT const unsigned char AFNetworkingVersionString[];
35 |
36 |
--------------------------------------------------------------------------------
/PasteBin/Pods/Target Support Files/AFNetworking/AFNetworking.modulemap:
--------------------------------------------------------------------------------
1 | framework module AFNetworking {
2 | umbrella header "AFNetworking-umbrella.h"
3 |
4 | export *
5 | module * { export * }
6 | }
7 |
--------------------------------------------------------------------------------
/PasteBin/Pods/Target Support Files/AFNetworking/AFNetworking.xcconfig:
--------------------------------------------------------------------------------
1 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/AFNetworking
2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
3 | OTHER_LDFLAGS = $(inherited) -framework "CoreGraphics" -framework "MobileCoreServices" -framework "Security" -framework "SystemConfiguration"
4 | PODS_BUILD_DIR = ${BUILD_DIR}
5 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
6 | PODS_ROOT = ${SRCROOT}
7 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/AFNetworking
8 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier}
9 | SKIP_INSTALL = YES
10 |
--------------------------------------------------------------------------------
/PasteBin/Pods/Target Support Files/Pods-PasteBin/Pods-PasteBin-acknowledgements.markdown:
--------------------------------------------------------------------------------
1 | # Acknowledgements
2 | This application makes use of the following third party libraries:
3 |
4 | ## AFNetworking
5 |
6 | Copyright (c) 2011-2016 Alamofire Software Foundation (http://alamofire.org/)
7 |
8 | Permission is hereby granted, free of charge, to any person obtaining a copy
9 | of this software and associated documentation files (the "Software"), to deal
10 | in the Software without restriction, including without limitation the rights
11 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12 | copies of the Software, and to permit persons to whom the Software is
13 | furnished to do so, subject to the following conditions:
14 |
15 | The above copyright notice and this permission notice shall be included in
16 | all copies or substantial portions of the Software.
17 |
18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24 | THE SOFTWARE.
25 |
26 |
27 | ## Highlightr
28 |
29 | Copyright (c) 2016 Illanes, Juan Pablo
30 |
31 | Permission is hereby granted, free of charge, to any person obtaining a copy
32 | of this software and associated documentation files (the "Software"), to deal
33 | in the Software without restriction, including without limitation the rights
34 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
35 | copies of the Software, and to permit persons to whom the Software is
36 | furnished to do so, subject to the following conditions:
37 |
38 | The above copyright notice and this permission notice shall be included in
39 | all copies or substantial portions of the Software.
40 |
41 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
42 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
43 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
44 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
45 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
46 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
47 | THE SOFTWARE.
48 |
49 |
50 | ## SearchTextField
51 |
52 | Copyright (c) 2016 Alejandro Pasccon
53 |
54 | Permission is hereby granted, free of charge, to any person obtaining a copy
55 | of this software and associated documentation files (the "Software"), to deal
56 | in the Software without restriction, including without limitation the rights
57 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
58 | copies of the Software, and to permit persons to whom the Software is
59 | furnished to do so, subject to the following conditions:
60 |
61 | The above copyright notice and this permission notice shall be included in
62 | all copies or substantial portions of the Software.
63 |
64 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
65 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
66 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
67 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
68 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
69 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
70 | THE SOFTWARE.
71 |
72 | Generated by CocoaPods - https://cocoapods.org
73 |
--------------------------------------------------------------------------------
/PasteBin/Pods/Target Support Files/Pods-PasteBin/Pods-PasteBin-acknowledgements.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | PreferenceSpecifiers
6 |
7 |
8 | FooterText
9 | This application makes use of the following third party libraries:
10 | Title
11 | Acknowledgements
12 | Type
13 | PSGroupSpecifier
14 |
15 |
16 | FooterText
17 | Copyright (c) 2011-2016 Alamofire Software Foundation (http://alamofire.org/)
18 |
19 | Permission is hereby granted, free of charge, to any person obtaining a copy
20 | of this software and associated documentation files (the "Software"), to deal
21 | in the Software without restriction, including without limitation the rights
22 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
23 | copies of the Software, and to permit persons to whom the Software is
24 | furnished to do so, subject to the following conditions:
25 |
26 | The above copyright notice and this permission notice shall be included in
27 | all copies or substantial portions of the Software.
28 |
29 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
30 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
31 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
32 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
33 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
34 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
35 | THE SOFTWARE.
36 |
37 | License
38 | MIT
39 | Title
40 | AFNetworking
41 | Type
42 | PSGroupSpecifier
43 |
44 |
45 | FooterText
46 | Copyright (c) 2016 Illanes, Juan Pablo <jpillaness+highlightr@gmail.com>
47 |
48 | Permission is hereby granted, free of charge, to any person obtaining a copy
49 | of this software and associated documentation files (the "Software"), to deal
50 | in the Software without restriction, including without limitation the rights
51 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
52 | copies of the Software, and to permit persons to whom the Software is
53 | furnished to do so, subject to the following conditions:
54 |
55 | The above copyright notice and this permission notice shall be included in
56 | all copies or substantial portions of the Software.
57 |
58 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
59 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
60 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
61 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
62 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
63 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
64 | THE SOFTWARE.
65 |
66 | License
67 | MIT
68 | Title
69 | Highlightr
70 | Type
71 | PSGroupSpecifier
72 |
73 |
74 | FooterText
75 | Copyright (c) 2016 Alejandro Pasccon <apasccon@gmail.com>
76 |
77 | Permission is hereby granted, free of charge, to any person obtaining a copy
78 | of this software and associated documentation files (the "Software"), to deal
79 | in the Software without restriction, including without limitation the rights
80 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
81 | copies of the Software, and to permit persons to whom the Software is
82 | furnished to do so, subject to the following conditions:
83 |
84 | The above copyright notice and this permission notice shall be included in
85 | all copies or substantial portions of the Software.
86 |
87 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
88 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
89 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
90 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
91 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
92 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
93 | THE SOFTWARE.
94 |
95 | License
96 | MIT
97 | Title
98 | SearchTextField
99 | Type
100 | PSGroupSpecifier
101 |
102 |
103 | FooterText
104 | Generated by CocoaPods - https://cocoapods.org
105 | Title
106 |
107 | Type
108 | PSGroupSpecifier
109 |
110 |
111 | StringsTable
112 | Acknowledgements
113 | Title
114 | Acknowledgements
115 |
116 |
117 |
--------------------------------------------------------------------------------
/PasteBin/Pods/Target Support Files/Pods-PasteBin/Pods-PasteBin-dummy.m:
--------------------------------------------------------------------------------
1 | #import
2 | @interface PodsDummy_Pods_PasteBin : NSObject
3 | @end
4 | @implementation PodsDummy_Pods_PasteBin
5 | @end
6 |
--------------------------------------------------------------------------------
/PasteBin/Pods/Target Support Files/Pods-PasteBin/Pods-PasteBin-frameworks.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | set -e
3 | set -u
4 | set -o pipefail
5 |
6 | function on_error {
7 | echo "$(realpath -mq "${0}"):$1: error: Unexpected failure"
8 | }
9 | trap 'on_error $LINENO' ERR
10 |
11 | if [ -z ${FRAMEWORKS_FOLDER_PATH+x} ]; then
12 | # If FRAMEWORKS_FOLDER_PATH is not set, then there's nowhere for us to copy
13 | # frameworks to, so exit 0 (signalling the script phase was successful).
14 | exit 0
15 | fi
16 |
17 | echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
18 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
19 |
20 | COCOAPODS_PARALLEL_CODE_SIGN="${COCOAPODS_PARALLEL_CODE_SIGN:-false}"
21 | SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}"
22 |
23 | # Used as a return value for each invocation of `strip_invalid_archs` function.
24 | STRIP_BINARY_RETVAL=0
25 |
26 | # This protects against multiple targets copying the same framework dependency at the same time. The solution
27 | # was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html
28 | RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????")
29 |
30 | # Copies and strips a vendored framework
31 | install_framework()
32 | {
33 | if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then
34 | local source="${BUILT_PRODUCTS_DIR}/$1"
35 | elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then
36 | local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")"
37 | elif [ -r "$1" ]; then
38 | local source="$1"
39 | fi
40 |
41 | local destination="${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
42 |
43 | if [ -L "${source}" ]; then
44 | echo "Symlinked..."
45 | source="$(readlink "${source}")"
46 | fi
47 |
48 | # Use filter instead of exclude so missing patterns don't throw errors.
49 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\""
50 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}"
51 |
52 | local basename
53 | basename="$(basename -s .framework "$1")"
54 | binary="${destination}/${basename}.framework/${basename}"
55 |
56 | if ! [ -r "$binary" ]; then
57 | binary="${destination}/${basename}"
58 | elif [ -L "${binary}" ]; then
59 | echo "Destination binary is symlinked..."
60 | dirname="$(dirname "${binary}")"
61 | binary="${dirname}/$(readlink "${binary}")"
62 | fi
63 |
64 | # Strip invalid architectures so "fat" simulator / device frameworks work on device
65 | if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then
66 | strip_invalid_archs "$binary"
67 | fi
68 |
69 | # Resign the code if required by the build settings to avoid unstable apps
70 | code_sign_if_enabled "${destination}/$(basename "$1")"
71 |
72 | # Embed linked Swift runtime libraries. No longer necessary as of Xcode 7.
73 | if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then
74 | local swift_runtime_libs
75 | swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u)
76 | for lib in $swift_runtime_libs; do
77 | echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\""
78 | rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}"
79 | code_sign_if_enabled "${destination}/${lib}"
80 | done
81 | fi
82 | }
83 |
84 | # Copies and strips a vendored dSYM
85 | install_dsym() {
86 | local source="$1"
87 | if [ -r "$source" ]; then
88 | # Copy the dSYM into a the targets temp dir.
89 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${DERIVED_FILES_DIR}\""
90 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${DERIVED_FILES_DIR}"
91 |
92 | local basename
93 | basename="$(basename -s .framework.dSYM "$source")"
94 | binary="${DERIVED_FILES_DIR}/${basename}.framework.dSYM/Contents/Resources/DWARF/${basename}"
95 |
96 | # Strip invalid architectures so "fat" simulator / device frameworks work on device
97 | if [[ "$(file "$binary")" == *"Mach-O dSYM companion"* ]]; then
98 | strip_invalid_archs "$binary"
99 | fi
100 |
101 | if [[ $STRIP_BINARY_RETVAL == 1 ]]; then
102 | # Move the stripped file into its final destination.
103 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${DERIVED_FILES_DIR}/${basename}.framework.dSYM\" \"${DWARF_DSYM_FOLDER_PATH}\""
104 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${DERIVED_FILES_DIR}/${basename}.framework.dSYM" "${DWARF_DSYM_FOLDER_PATH}"
105 | else
106 | # The dSYM was not stripped at all, in this case touch a fake folder so the input/output paths from Xcode do not reexecute this script because the file is missing.
107 | touch "${DWARF_DSYM_FOLDER_PATH}/${basename}.framework.dSYM"
108 | fi
109 | fi
110 | }
111 |
112 | # Signs a framework with the provided identity
113 | code_sign_if_enabled() {
114 | if [ -n "${EXPANDED_CODE_SIGN_IDENTITY:-}" -a "${CODE_SIGNING_REQUIRED:-}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then
115 | # Use the current code_sign_identity
116 | echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}"
117 | local code_sign_cmd="/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS:-} --preserve-metadata=identifier,entitlements '$1'"
118 |
119 | if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then
120 | code_sign_cmd="$code_sign_cmd &"
121 | fi
122 | echo "$code_sign_cmd"
123 | eval "$code_sign_cmd"
124 | fi
125 | }
126 |
127 | # Strip invalid architectures
128 | strip_invalid_archs() {
129 | binary="$1"
130 | # Get architectures for current target binary
131 | binary_archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | awk '{$1=$1;print}' | rev)"
132 | # Intersect them with the architectures we are building for
133 | intersected_archs="$(echo ${ARCHS[@]} ${binary_archs[@]} | tr ' ' '\n' | sort | uniq -d)"
134 | # If there are no archs supported by this binary then warn the user
135 | if [[ -z "$intersected_archs" ]]; then
136 | echo "warning: [CP] Vendored binary '$binary' contains architectures ($binary_archs) none of which match the current build architectures ($ARCHS)."
137 | STRIP_BINARY_RETVAL=0
138 | return
139 | fi
140 | stripped=""
141 | for arch in $binary_archs; do
142 | if ! [[ "${ARCHS}" == *"$arch"* ]]; then
143 | # Strip non-valid architectures in-place
144 | lipo -remove "$arch" -output "$binary" "$binary"
145 | stripped="$stripped $arch"
146 | fi
147 | done
148 | if [[ "$stripped" ]]; then
149 | echo "Stripped $binary of architectures:$stripped"
150 | fi
151 | STRIP_BINARY_RETVAL=1
152 | }
153 |
154 |
155 | if [[ "$CONFIGURATION" == "Debug" ]]; then
156 | install_framework "${BUILT_PRODUCTS_DIR}/AFNetworking/AFNetworking.framework"
157 | install_framework "${BUILT_PRODUCTS_DIR}/Highlightr/Highlightr.framework"
158 | install_framework "${BUILT_PRODUCTS_DIR}/SearchTextField/SearchTextField.framework"
159 | fi
160 | if [[ "$CONFIGURATION" == "Release" ]]; then
161 | install_framework "${BUILT_PRODUCTS_DIR}/AFNetworking/AFNetworking.framework"
162 | install_framework "${BUILT_PRODUCTS_DIR}/Highlightr/Highlightr.framework"
163 | install_framework "${BUILT_PRODUCTS_DIR}/SearchTextField/SearchTextField.framework"
164 | fi
165 | if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then
166 | wait
167 | fi
168 |
--------------------------------------------------------------------------------
/PasteBin/Pods/Target Support Files/Pods-PasteBin/Pods-PasteBin-umbrella.h:
--------------------------------------------------------------------------------
1 | #ifdef __OBJC__
2 | #import
3 | #else
4 | #ifndef FOUNDATION_EXPORT
5 | #if defined(__cplusplus)
6 | #define FOUNDATION_EXPORT extern "C"
7 | #else
8 | #define FOUNDATION_EXPORT extern
9 | #endif
10 | #endif
11 | #endif
12 |
13 |
14 | FOUNDATION_EXPORT double Pods_PasteBinVersionNumber;
15 | FOUNDATION_EXPORT const unsigned char Pods_PasteBinVersionString[];
16 |
17 |
--------------------------------------------------------------------------------
/PasteBin/Pods/Target Support Files/Pods-PasteBin/Pods-PasteBin.debug.xcconfig:
--------------------------------------------------------------------------------
1 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES $(inherited)
2 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/AFNetworking" "${PODS_CONFIGURATION_BUILD_DIR}/Highlightr" "${PODS_CONFIGURATION_BUILD_DIR}/SearchTextField"
3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
4 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/AFNetworking/AFNetworking.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/Highlightr/Highlightr.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/SearchTextField/SearchTextField.framework/Headers"
5 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks'
6 | OTHER_LDFLAGS = $(inherited) -framework "AFNetworking" -framework "CoreGraphics" -framework "Highlightr" -framework "MobileCoreServices" -framework "SearchTextField" -framework "Security" -framework "SystemConfiguration" -framework "UIKit"
7 | OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS
8 | PODS_BUILD_DIR = ${BUILD_DIR}
9 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
10 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/.
11 | PODS_ROOT = ${SRCROOT}/Pods
12 |
--------------------------------------------------------------------------------
/PasteBin/Pods/Target Support Files/Pods-PasteBin/Pods-PasteBin.modulemap:
--------------------------------------------------------------------------------
1 | framework module Pods_PasteBin {
2 | umbrella header "Pods-PasteBin-umbrella.h"
3 |
4 | export *
5 | module * { export * }
6 | }
7 |
--------------------------------------------------------------------------------
/PasteBin/Pods/Target Support Files/Pods-PasteBin/Pods-PasteBin.release.xcconfig:
--------------------------------------------------------------------------------
1 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES $(inherited)
2 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/AFNetworking" "${PODS_CONFIGURATION_BUILD_DIR}/Highlightr" "${PODS_CONFIGURATION_BUILD_DIR}/SearchTextField"
3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
4 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/AFNetworking/AFNetworking.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/Highlightr/Highlightr.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/SearchTextField/SearchTextField.framework/Headers"
5 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks'
6 | OTHER_LDFLAGS = $(inherited) -framework "AFNetworking" -framework "CoreGraphics" -framework "Highlightr" -framework "MobileCoreServices" -framework "SearchTextField" -framework "Security" -framework "SystemConfiguration" -framework "UIKit"
7 | OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS
8 | PODS_BUILD_DIR = ${BUILD_DIR}
9 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
10 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/.
11 | PODS_ROOT = ${SRCROOT}/Pods
12 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # PasteBin Mobile
2 |
3 | PasteBin Mobile is an app to quickly upload text or code to http://pastebin.com!
4 |
5 | ## App Store
6 |
7 | [PasteBin Mobile is live on the AppStore here](https://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=1246981062&mt=8)
8 |
9 | ## Screenshot
10 |
11 |
12 |
13 |
14 | ## Notes
15 |
16 | Current build passes all tests. We use [SwiftFormat](https://github.com/nicklockwood/SwiftFormat) to format our swift code.
17 |
18 | ## Features
19 |
20 | - [x] Save API Settings
21 |
22 | - [x] Implement quick paste with default settings
23 |
24 | - [x] iOS icon for all sizes
25 |
26 | - [x] Change title, syntax
27 |
28 | - [x] Locally save list of prior pastes
29 |
30 | - [x] Syntax Highlighting
31 |
32 | - [ ] User profiles
33 |
34 | ## Credits
35 |
36 | 3rd party libraries, icons, graphics, or other assets used.
37 |
38 | - [AFNetworking](https://github.com/AFNetworking/AFNetworking) - networking task library
39 | - [Highlightr](https://github.com/raspu/Highlightr) - syntax highlighting library
40 | - [SearchTextField](https://github.com/apasccon/SearchTextField)
41 |
42 | ## License
43 |
44 | Copyright [2017] [JonLuca DeCaro]
45 |
46 | Licensed under the Apache License, Version 2.0 (the "License");
47 | you may not use this file except in compliance with the License.
48 | You may obtain a copy of the License at
49 |
50 | http://www.apache.org/licenses/LICENSE-2.0
51 |
52 | Unless required by applicable law or agreed to in writing, software
53 | distributed under the License is distributed on an "AS IS" BASIS,
54 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
55 | See the License for the specific language governing permissions and
56 | limitations under the License.
57 |
--------------------------------------------------------------------------------