├── SBCollectionView
├── Assets.xcassets
│ ├── Contents.json
│ └── AppIcon.appiconset
│ │ ├── LALIcon58.png
│ │ ├── LALIcon80.png
│ │ ├── LALIcon87.png
│ │ ├── LALIcon120-1.png
│ │ ├── LALIcon120.png
│ │ ├── LALIcon180.png
│ │ └── Contents.json
├── Info.plist
├── Base.lproj
│ └── LaunchScreen.storyboard
├── AppDelegate.swift
├── ImageCache.swift
└── SBCollectoinViewController.swift
├── SBCollectionView.xcodeproj
├── project.xcworkspace
│ ├── contents.xcworkspacedata
│ └── xcuserdata
│ │ ├── prodapt.xcuserdatad
│ │ └── UserInterfaceState.xcuserstate
│ │ └── support.xcuserdatad
│ │ └── UserInterfaceState.xcuserstate
├── xcuserdata
│ ├── prodapt.xcuserdatad
│ │ └── xcschemes
│ │ │ ├── xcschememanagement.plist
│ │ │ └── SBCollectionView.xcscheme
│ └── support.xcuserdatad
│ │ └── xcschemes
│ │ ├── xcschememanagement.plist
│ │ └── SBCollectionView.xcscheme
└── project.pbxproj
├── SBCollectionViewTests
├── Info.plist
└── SBCollectionViewTests.swift
├── SBCollectionViewUITests
├── Info.plist
└── SBCollectionViewUITests.swift
└── README.md
/SBCollectionView/Assets.xcassets/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | }
6 | }
--------------------------------------------------------------------------------
/SBCollectionView/Assets.xcassets/AppIcon.appiconset/LALIcon58.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SankarLal/SBCollectionView/HEAD/SBCollectionView/Assets.xcassets/AppIcon.appiconset/LALIcon58.png
--------------------------------------------------------------------------------
/SBCollectionView/Assets.xcassets/AppIcon.appiconset/LALIcon80.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SankarLal/SBCollectionView/HEAD/SBCollectionView/Assets.xcassets/AppIcon.appiconset/LALIcon80.png
--------------------------------------------------------------------------------
/SBCollectionView/Assets.xcassets/AppIcon.appiconset/LALIcon87.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SankarLal/SBCollectionView/HEAD/SBCollectionView/Assets.xcassets/AppIcon.appiconset/LALIcon87.png
--------------------------------------------------------------------------------
/SBCollectionView/Assets.xcassets/AppIcon.appiconset/LALIcon120-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SankarLal/SBCollectionView/HEAD/SBCollectionView/Assets.xcassets/AppIcon.appiconset/LALIcon120-1.png
--------------------------------------------------------------------------------
/SBCollectionView/Assets.xcassets/AppIcon.appiconset/LALIcon120.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SankarLal/SBCollectionView/HEAD/SBCollectionView/Assets.xcassets/AppIcon.appiconset/LALIcon120.png
--------------------------------------------------------------------------------
/SBCollectionView/Assets.xcassets/AppIcon.appiconset/LALIcon180.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SankarLal/SBCollectionView/HEAD/SBCollectionView/Assets.xcassets/AppIcon.appiconset/LALIcon180.png
--------------------------------------------------------------------------------
/SBCollectionView.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/SBCollectionView.xcodeproj/project.xcworkspace/xcuserdata/prodapt.xcuserdatad/UserInterfaceState.xcuserstate:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SankarLal/SBCollectionView/HEAD/SBCollectionView.xcodeproj/project.xcworkspace/xcuserdata/prodapt.xcuserdatad/UserInterfaceState.xcuserstate
--------------------------------------------------------------------------------
/SBCollectionView.xcodeproj/project.xcworkspace/xcuserdata/support.xcuserdatad/UserInterfaceState.xcuserstate:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SankarLal/SBCollectionView/HEAD/SBCollectionView.xcodeproj/project.xcworkspace/xcuserdata/support.xcuserdatad/UserInterfaceState.xcuserstate
--------------------------------------------------------------------------------
/SBCollectionViewTests/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | BNDL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1
23 |
24 |
25 |
--------------------------------------------------------------------------------
/SBCollectionViewUITests/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | BNDL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1
23 |
24 |
25 |
--------------------------------------------------------------------------------
/SBCollectionView.xcodeproj/xcuserdata/prodapt.xcuserdatad/xcschemes/xcschememanagement.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | SchemeUserState
6 |
7 | SBCollectionView.xcscheme
8 |
9 | orderHint
10 | 0
11 |
12 |
13 | SuppressBuildableAutocreation
14 |
15 | 4EE375911BE0B999001A6624
16 |
17 | primary
18 |
19 |
20 | 4EE375A51BE0B999001A6624
21 |
22 | primary
23 |
24 |
25 | 4EE375B01BE0B999001A6624
26 |
27 | primary
28 |
29 |
30 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/SBCollectionView.xcodeproj/xcuserdata/support.xcuserdatad/xcschemes/xcschememanagement.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | SchemeUserState
6 |
7 | SBCollectionView.xcscheme
8 |
9 | orderHint
10 | 0
11 |
12 |
13 | SuppressBuildableAutocreation
14 |
15 | 4EE375911BE0B999001A6624
16 |
17 | primary
18 |
19 |
20 | 4EE375A51BE0B999001A6624
21 |
22 | primary
23 |
24 |
25 | 4EE375B01BE0B999001A6624
26 |
27 | primary
28 |
29 |
30 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/SBCollectionViewTests/SBCollectionViewTests.swift:
--------------------------------------------------------------------------------
1 |
2 |
3 | import XCTest
4 | @testable import SBCollectionView
5 |
6 | class SBCollectionViewTests: XCTestCase {
7 |
8 | override func setUp() {
9 | super.setUp()
10 | // Put setup code here. This method is called before the invocation of each test method in the class.
11 | }
12 |
13 | override func tearDown() {
14 | // Put teardown code here. This method is called after the invocation of each test method in the class.
15 | super.tearDown()
16 | }
17 |
18 | func testExample() {
19 | // This is an example of a functional test case.
20 | // Use XCTAssert and related functions to verify your tests produce the correct results.
21 | }
22 |
23 | func testPerformanceExample() {
24 | // This is an example of a performance test case.
25 | self.measureBlock {
26 | // Put the code you want to measure the time of here.
27 | }
28 | }
29 |
30 | }
31 |
--------------------------------------------------------------------------------
/SBCollectionView/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "size" : "29x29",
5 | "idiom" : "iphone",
6 | "filename" : "LALIcon58.png",
7 | "scale" : "2x"
8 | },
9 | {
10 | "size" : "29x29",
11 | "idiom" : "iphone",
12 | "filename" : "LALIcon87.png",
13 | "scale" : "3x"
14 | },
15 | {
16 | "size" : "40x40",
17 | "idiom" : "iphone",
18 | "filename" : "LALIcon80.png",
19 | "scale" : "2x"
20 | },
21 | {
22 | "size" : "40x40",
23 | "idiom" : "iphone",
24 | "filename" : "LALIcon120.png",
25 | "scale" : "3x"
26 | },
27 | {
28 | "size" : "60x60",
29 | "idiom" : "iphone",
30 | "filename" : "LALIcon120-1.png",
31 | "scale" : "2x"
32 | },
33 | {
34 | "size" : "60x60",
35 | "idiom" : "iphone",
36 | "filename" : "LALIcon180.png",
37 | "scale" : "3x"
38 | }
39 | ],
40 | "info" : {
41 | "version" : 1,
42 | "author" : "xcode"
43 | }
44 | }
--------------------------------------------------------------------------------
/SBCollectionViewUITests/SBCollectionViewUITests.swift:
--------------------------------------------------------------------------------
1 |
2 |
3 | import XCTest
4 |
5 | class SBCollectionViewUITests: XCTestCase {
6 |
7 | override func setUp() {
8 | super.setUp()
9 |
10 | // Put setup code here. This method is called before the invocation of each test method in the class.
11 |
12 | // In UI tests it is usually best to stop immediately when a failure occurs.
13 | continueAfterFailure = false
14 | // UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method.
15 | XCUIApplication().launch()
16 |
17 | // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this.
18 | }
19 |
20 | override func tearDown() {
21 | // Put teardown code here. This method is called after the invocation of each test method in the class.
22 | super.tearDown()
23 | }
24 |
25 | func testExample() {
26 | // Use recording to get started writing UI tests.
27 | // Use XCTAssert and related functions to verify your tests produce the correct results.
28 | }
29 |
30 | }
31 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # SBCollectionView
2 | This is simple CollectionView with downloading images and storing in cache using Swift...
3 |
4 | ## Requirements
5 | * Xcode 5 or higher
6 | * Apple LLVM compiler
7 | * iOS 7.1 or higher
8 | * ARC
9 |
10 | ## Contact
11 | sankarlal20@gmail.com
12 |
13 | ## License
14 |
15 | SBCollectionView is available under the MIT license.
16 |
17 | Copyright © 2015
18 |
19 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
20 |
21 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
22 |
23 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
24 |
--------------------------------------------------------------------------------
/SBCollectionView/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | APPL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1
23 | LSRequiresIPhoneOS
24 |
25 | UILaunchStoryboardName
26 | LaunchScreen
27 | UIRequiredDeviceCapabilities
28 |
29 | armv7
30 |
31 | UISupportedInterfaceOrientations
32 |
33 | UIInterfaceOrientationPortrait
34 | UIInterfaceOrientationLandscapeLeft
35 | UIInterfaceOrientationLandscapeRight
36 |
37 | NSAppTransportSecurity
38 |
39 | NSAllowsArbitraryLoads
40 |
41 |
42 |
43 |
44 |
--------------------------------------------------------------------------------
/SBCollectionView/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 |
--------------------------------------------------------------------------------
/SBCollectionView/AppDelegate.swift:
--------------------------------------------------------------------------------
1 |
2 |
3 | import UIKit
4 |
5 | @UIApplicationMain
6 | class AppDelegate: UIResponder, UIApplicationDelegate {
7 |
8 | var window: UIWindow?
9 |
10 |
11 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
12 | // Override point for customization after application launch.
13 |
14 |
15 | self.window = UIWindow(frame: UIScreen.main.bounds)
16 | self.window?.backgroundColor = UIColor.white
17 |
18 | let rootNavigationController : UINavigationController = UINavigationController(rootViewController: SBCollectoinViewController ())
19 | self.window?.rootViewController = rootNavigationController
20 | self.window?.makeKeyAndVisible()
21 | return true
22 | }
23 |
24 | func applicationWillResignActive(_ application: UIApplication) {
25 | // 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.
26 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
27 | }
28 |
29 | func applicationDidEnterBackground(_ application: UIApplication) {
30 | // 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.
31 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
32 | }
33 |
34 | func applicationWillEnterForeground(_ application: UIApplication) {
35 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
36 | }
37 |
38 | func applicationDidBecomeActive(_ application: UIApplication) {
39 | // 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.
40 | }
41 |
42 | func applicationWillTerminate(_ application: UIApplication) {
43 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
44 | }
45 |
46 |
47 | }
48 |
49 |
--------------------------------------------------------------------------------
/SBCollectionView/ImageCache.swift:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | import Foundation
5 | import UIKit
6 |
7 | class ImageCache: NSObject, URLSessionTaskDelegate {
8 |
9 | class var sharedInstance: ImageCache {
10 | struct Singleton {
11 | static let instance = ImageCache()
12 | }
13 | return Singleton.instance
14 | }
15 |
16 | var session:URLSession!
17 | var uRLCache = URLCache(memoryCapacity: 20 * 1024 * 1024, diskCapacity: 100 * 1024 * 1024, diskPath: "ImageDownloadCache")
18 | var downloadQueue = Dictionary()?>()
19 |
20 | override init() {
21 | super.init()
22 |
23 | let config = URLSessionConfiguration.default
24 | config.requestCachePolicy = NSURLRequest.CachePolicy.returnCacheDataElseLoad
25 | config.urlCache = uRLCache
26 | self.session = URLSession(configuration: config, delegate: self, delegateQueue: nil)
27 | }
28 |
29 | func getImageFromCache(url : URL, completion:@escaping (UIImage?, NSError?)->()) {
30 | let urlRequest = URLRequest(url: url, cachePolicy: .returnCacheDataElseLoad, timeoutInterval: 30.0)
31 | if let response = URLCache.shared.cachedResponse(for: urlRequest) {
32 | let image = UIImage(data: response.data)
33 | DispatchQueue.main.async {
34 | completion(image, nil)
35 | return
36 | }
37 | } else {
38 | completion(nil, nil)
39 | }
40 | }
41 |
42 | func getImage(url:URL, completion:((UIImage?, NSError?)->())?) {
43 |
44 | let urlRequest = URLRequest(url: url, cachePolicy: .returnCacheDataElseLoad, timeoutInterval: 30.0)
45 |
46 | if let response = URLCache.shared.cachedResponse(for: urlRequest){
47 | let image = UIImage(data: response.data)
48 | DispatchQueue.main.async {
49 | completion!(image, nil)
50 | return
51 | }
52 | } else {
53 | let task = self.session.dataTask(with: urlRequest) { [weak self] (data, response, error) -> Void in
54 | if let strongSelf = self {
55 | if let completionHandler = strongSelf.downloadQueue[url] {
56 | if error != nil {
57 | // print("ERROR >>>>>>>>> \(errorReceived.localizedFailureReason)")
58 | DispatchQueue.main.async {
59 | completionHandler(nil, nil)
60 | return
61 | }
62 |
63 | } else {
64 | if let httpResponse = response as? HTTPURLResponse {
65 | if httpResponse.statusCode >= 400 {
66 | completionHandler(nil, NSError(domain: NSURLErrorDomain, code: httpResponse.statusCode, userInfo: nil))
67 | } else {
68 | strongSelf.uRLCache.storeCachedResponse(CachedURLResponse(response:response!, data:data!, userInfo:nil, storagePolicy:URLCache.StoragePolicy.allowed), for: urlRequest)
69 |
70 | let image = UIImage(data: data!)
71 | DispatchQueue.main.async {
72 | completionHandler(image, nil)
73 | return
74 | }
75 |
76 | }
77 | }
78 | }
79 | }
80 | strongSelf.cancelImage(url)
81 | }
82 | }
83 | addToQueue(url, task, completion: completion)
84 | }
85 | }
86 |
87 | func cancelImage(_ requestUrl: URL?) {
88 | if let url = requestUrl {
89 | if let index = self.downloadQueue.index(forKey: url) {
90 | self.downloadQueue.remove(at: index)
91 | }
92 | }
93 | }
94 |
95 |
96 | // MARK: - Private
97 |
98 | private func addToQueue(_ url: URL, _ task:URLSessionDataTask, completion:((UIImage?, NSError?)->())?) {
99 | self.downloadQueue[url] = completion
100 | if task.state != .running {
101 | task.resume()
102 | }
103 | }
104 | }
105 |
--------------------------------------------------------------------------------
/SBCollectionView.xcodeproj/xcuserdata/prodapt.xcuserdatad/xcschemes/SBCollectionView.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
33 |
39 |
40 |
41 |
43 |
49 |
50 |
51 |
52 |
53 |
59 |
60 |
61 |
62 |
63 |
64 |
74 |
76 |
82 |
83 |
84 |
85 |
86 |
87 |
93 |
95 |
101 |
102 |
103 |
104 |
106 |
107 |
110 |
111 |
112 |
--------------------------------------------------------------------------------
/SBCollectionView.xcodeproj/xcuserdata/support.xcuserdatad/xcschemes/SBCollectionView.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
31 |
32 |
34 |
40 |
41 |
42 |
44 |
50 |
51 |
52 |
53 |
54 |
60 |
61 |
62 |
63 |
64 |
65 |
76 |
78 |
84 |
85 |
86 |
87 |
88 |
89 |
95 |
97 |
103 |
104 |
105 |
106 |
108 |
109 |
112 |
113 |
114 |
--------------------------------------------------------------------------------
/SBCollectionView/SBCollectoinViewController.swift:
--------------------------------------------------------------------------------
1 |
2 |
3 | import UIKit
4 |
5 | class SBCollectoinViewController: UIViewController, UICollectionViewDataSource, UICollectionViewDelegate, UICollectionViewDelegateFlowLayout, UIScrollViewDelegate {
6 |
7 | var dCollectionView : UICollectionView!
8 |
9 | let customeArray = [
10 | [
11 | "http://oi43.tinypic.com/25hz7sg.jpg",
12 | "http://oi44.tinypic.com/16hvtok.jpg",
13 | "http://www.google.com/intl/en_ALL/images/logo.png",
14 | "https://www.gstatic.com/webp/gallery3/1.png",
15 | "https://www.gstatic.com/webp/gallery3/2.png"
16 | ],
17 |
18 | [
19 | "https://www.gstatic.com/webp/gallery3/3.png",
20 | "https://www.gstatic.com/webp/gallery3/5.png",
21 | "https://www.gstatic.com/webp/gallery3/4.png"
22 | ]
23 | ,
24 | [
25 | "http://www.gstatic.com/webp/gallery/1.jpg",
26 | "http://www.gstatic.com/webp/gallery/2.jpg",
27 | "http://www.gstatic.com/webp/gallery/3.jpg"
28 | ],
29 | [
30 | "http://www.gstatic.com/webp/gallery/4.jpg",
31 | "http://www.gstatic.com/webp/gallery/5.jpg",
32 | "http://www.bbcode.org/images/lubeck_small.jpg"
33 | ],
34 | [
35 | "http://www.fnordware.com/superpng/pnggrad16rgb.png",
36 | "https://www.gstatic.com/webp/gallery3/2.png"
37 | ],
38 | [
39 | "https://www.gstatic.com/webp/gallery3/3.png"
40 | ]
41 | ]
42 |
43 | override func viewDidLoad() {
44 | super.viewDidLoad()
45 | // Do any additional setup after loading the view, typically from a nib.
46 | self.title = "SB Collection View Demo"
47 |
48 | setupCollectionView()
49 | }
50 |
51 | func setupCollectionView () {
52 |
53 | let dCollectionViewFlowLayout : UICollectionViewFlowLayout = UICollectionViewFlowLayout ()
54 | dCollectionView = UICollectionView (frame: self.view.frame, collectionViewLayout: dCollectionViewFlowLayout)
55 | dCollectionView.delegate = self
56 | dCollectionView.dataSource = self
57 | dCollectionView.backgroundColor = UIColor.black
58 |
59 | dCollectionView.register(UICollectionViewCell.classForCoder(), forCellWithReuseIdentifier: "cellIdentifier")
60 | self.view.addSubview(dCollectionView)
61 |
62 | }
63 |
64 | func numberOfSections(in collectionView: UICollectionView) -> Int {
65 | return 1
66 | }
67 |
68 | func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
69 | return customeArray.count
70 | }
71 |
72 | func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize {
73 | return CGSize(width: self.view.frame.size.width, height: 200)
74 | }
75 |
76 | func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
77 |
78 | let cell : UICollectionViewCell = collectionView.dequeueReusableCell(withReuseIdentifier: "cellIdentifier", for: indexPath)
79 | cell.backgroundColor = UIColor(red: 255.0/255.0, green: 255.0/255.0, blue: 255.0/255.0, alpha: 0.5)
80 |
81 | let lbl_Title : UILabel = UILabel.init(frame: CGRect.init(x: 0, y: 1, width: dCollectionView.frame.size.width, height: 30))
82 | lbl_Title.backgroundColor = UIColor.white
83 | lbl_Title.textAlignment = .center
84 | cell.addSubview(lbl_Title)
85 |
86 | let scroll: UIScrollView = UIScrollView.init(frame: CGRect.init(x: 0, y: 33, width: dCollectionView.frame.size.width, height: 164))
87 | scroll.delegate = self
88 | scroll.backgroundColor = UIColor.white
89 | cell.addSubview(scroll)
90 |
91 | var xbase : CGFloat = 10
92 |
93 | for i in customeArray[indexPath.row] {
94 |
95 | let imgView : UIImageView = UIImageView.init(frame: CGRect.init(x: xbase, y: 7, width: 100, height: 150))
96 | imgView.layer.cornerRadius = 0.5
97 | imgView.layer.borderColor = UIColor.red.cgColor
98 | imgView.layer.borderWidth = 0.5
99 | scroll.addSubview(imgView)
100 | xbase += 100 + 10
101 |
102 | let indicator : UIActivityIndicatorView = UIActivityIndicatorView.init(activityIndicatorStyle: .gray)
103 | indicator.frame = CGRect.init(x: 0, y: 0, width: 25, height: 25)
104 | indicator.color = UIColor.black
105 | indicator.center = imgView.center
106 | indicator.startAnimating()
107 | scroll.addSubview(indicator)
108 |
109 | ImageCache.sharedInstance.getImage(url: URL.init(string: i)! , completion: { (image, error) in
110 | if let _ = error {
111 | // thou shall handle errors
112 | } else if let fullImage = image {
113 | imgView.image = fullImage
114 | indicator.stopAnimating()
115 | }
116 | })
117 | }
118 | scroll.contentSize = CGSize.init(width: xbase, height: scroll.frame.size.height)
119 | lbl_Title.text = "Index Path Row Is \(indexPath.row)"
120 |
121 | return cell
122 |
123 | }
124 |
125 | override func didReceiveMemoryWarning() {
126 | super.didReceiveMemoryWarning()
127 | // Dispose of any resources that can be recreated.
128 | }
129 |
130 |
131 |
132 | }
133 |
--------------------------------------------------------------------------------
/SBCollectionView.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 46;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | 4EE375961BE0B999001A6624 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EE375951BE0B999001A6624 /* AppDelegate.swift */; };
11 | 4EE3759D1BE0B999001A6624 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 4EE3759C1BE0B999001A6624 /* Assets.xcassets */; };
12 | 4EE375A01BE0B999001A6624 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 4EE3759E1BE0B999001A6624 /* LaunchScreen.storyboard */; };
13 | 4EE375AB1BE0B999001A6624 /* SBCollectionViewTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EE375AA1BE0B999001A6624 /* SBCollectionViewTests.swift */; };
14 | 4EE375B61BE0B999001A6624 /* SBCollectionViewUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EE375B51BE0B999001A6624 /* SBCollectionViewUITests.swift */; };
15 | 4EE375C51BE0B9BB001A6624 /* ImageCache.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EE375C41BE0B9BB001A6624 /* ImageCache.swift */; };
16 | 4EE375C91BE0B9EC001A6624 /* SBCollectoinViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EE375C81BE0B9EC001A6624 /* SBCollectoinViewController.swift */; };
17 | /* End PBXBuildFile section */
18 |
19 | /* Begin PBXContainerItemProxy section */
20 | 4EE375A71BE0B999001A6624 /* PBXContainerItemProxy */ = {
21 | isa = PBXContainerItemProxy;
22 | containerPortal = 4EE3758A1BE0B999001A6624 /* Project object */;
23 | proxyType = 1;
24 | remoteGlobalIDString = 4EE375911BE0B999001A6624;
25 | remoteInfo = SBCollectionView;
26 | };
27 | 4EE375B21BE0B999001A6624 /* PBXContainerItemProxy */ = {
28 | isa = PBXContainerItemProxy;
29 | containerPortal = 4EE3758A1BE0B999001A6624 /* Project object */;
30 | proxyType = 1;
31 | remoteGlobalIDString = 4EE375911BE0B999001A6624;
32 | remoteInfo = SBCollectionView;
33 | };
34 | /* End PBXContainerItemProxy section */
35 |
36 | /* Begin PBXFileReference section */
37 | 4EE375921BE0B999001A6624 /* SBCollectionView.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SBCollectionView.app; sourceTree = BUILT_PRODUCTS_DIR; };
38 | 4EE375951BE0B999001A6624 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; };
39 | 4EE3759C1BE0B999001A6624 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; };
40 | 4EE3759F1BE0B999001A6624 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; };
41 | 4EE375A11BE0B999001A6624 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
42 | 4EE375A61BE0B999001A6624 /* SBCollectionViewTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = SBCollectionViewTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
43 | 4EE375AA1BE0B999001A6624 /* SBCollectionViewTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SBCollectionViewTests.swift; sourceTree = ""; };
44 | 4EE375AC1BE0B999001A6624 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
45 | 4EE375B11BE0B999001A6624 /* SBCollectionViewUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = SBCollectionViewUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
46 | 4EE375B51BE0B999001A6624 /* SBCollectionViewUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SBCollectionViewUITests.swift; sourceTree = ""; };
47 | 4EE375B71BE0B999001A6624 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
48 | 4EE375C41BE0B9BB001A6624 /* ImageCache.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ImageCache.swift; sourceTree = ""; };
49 | 4EE375C81BE0B9EC001A6624 /* SBCollectoinViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SBCollectoinViewController.swift; sourceTree = ""; };
50 | /* End PBXFileReference section */
51 |
52 | /* Begin PBXFrameworksBuildPhase section */
53 | 4EE3758F1BE0B999001A6624 /* Frameworks */ = {
54 | isa = PBXFrameworksBuildPhase;
55 | buildActionMask = 2147483647;
56 | files = (
57 | );
58 | runOnlyForDeploymentPostprocessing = 0;
59 | };
60 | 4EE375A31BE0B999001A6624 /* Frameworks */ = {
61 | isa = PBXFrameworksBuildPhase;
62 | buildActionMask = 2147483647;
63 | files = (
64 | );
65 | runOnlyForDeploymentPostprocessing = 0;
66 | };
67 | 4EE375AE1BE0B999001A6624 /* Frameworks */ = {
68 | isa = PBXFrameworksBuildPhase;
69 | buildActionMask = 2147483647;
70 | files = (
71 | );
72 | runOnlyForDeploymentPostprocessing = 0;
73 | };
74 | /* End PBXFrameworksBuildPhase section */
75 |
76 | /* Begin PBXGroup section */
77 | 4EE375891BE0B999001A6624 = {
78 | isa = PBXGroup;
79 | children = (
80 | 4EE375941BE0B999001A6624 /* SBCollectionView */,
81 | 4EE375A91BE0B999001A6624 /* SBCollectionViewTests */,
82 | 4EE375B41BE0B999001A6624 /* SBCollectionViewUITests */,
83 | 4EE375931BE0B999001A6624 /* Products */,
84 | );
85 | sourceTree = "";
86 | };
87 | 4EE375931BE0B999001A6624 /* Products */ = {
88 | isa = PBXGroup;
89 | children = (
90 | 4EE375921BE0B999001A6624 /* SBCollectionView.app */,
91 | 4EE375A61BE0B999001A6624 /* SBCollectionViewTests.xctest */,
92 | 4EE375B11BE0B999001A6624 /* SBCollectionViewUITests.xctest */,
93 | );
94 | name = Products;
95 | sourceTree = "";
96 | };
97 | 4EE375941BE0B999001A6624 /* SBCollectionView */ = {
98 | isa = PBXGroup;
99 | children = (
100 | 4EE375C61BE0B9C0001A6624 /* App Delegate */,
101 | 4EE375C31BE0B9B0001A6624 /* External */,
102 | 4EE375C71BE0B9D1001A6624 /* View Controller */,
103 | 4EE3759C1BE0B999001A6624 /* Assets.xcassets */,
104 | 4EE3759E1BE0B999001A6624 /* LaunchScreen.storyboard */,
105 | 4EE375A11BE0B999001A6624 /* Info.plist */,
106 | );
107 | path = SBCollectionView;
108 | sourceTree = "";
109 | };
110 | 4EE375A91BE0B999001A6624 /* SBCollectionViewTests */ = {
111 | isa = PBXGroup;
112 | children = (
113 | 4EE375AA1BE0B999001A6624 /* SBCollectionViewTests.swift */,
114 | 4EE375AC1BE0B999001A6624 /* Info.plist */,
115 | );
116 | path = SBCollectionViewTests;
117 | sourceTree = "";
118 | };
119 | 4EE375B41BE0B999001A6624 /* SBCollectionViewUITests */ = {
120 | isa = PBXGroup;
121 | children = (
122 | 4EE375B51BE0B999001A6624 /* SBCollectionViewUITests.swift */,
123 | 4EE375B71BE0B999001A6624 /* Info.plist */,
124 | );
125 | path = SBCollectionViewUITests;
126 | sourceTree = "";
127 | };
128 | 4EE375C31BE0B9B0001A6624 /* External */ = {
129 | isa = PBXGroup;
130 | children = (
131 | 4EE375C41BE0B9BB001A6624 /* ImageCache.swift */,
132 | );
133 | name = External;
134 | sourceTree = "";
135 | };
136 | 4EE375C61BE0B9C0001A6624 /* App Delegate */ = {
137 | isa = PBXGroup;
138 | children = (
139 | 4EE375951BE0B999001A6624 /* AppDelegate.swift */,
140 | );
141 | name = "App Delegate";
142 | sourceTree = "";
143 | };
144 | 4EE375C71BE0B9D1001A6624 /* View Controller */ = {
145 | isa = PBXGroup;
146 | children = (
147 | 4EE375C81BE0B9EC001A6624 /* SBCollectoinViewController.swift */,
148 | );
149 | name = "View Controller";
150 | sourceTree = "";
151 | };
152 | /* End PBXGroup section */
153 |
154 | /* Begin PBXNativeTarget section */
155 | 4EE375911BE0B999001A6624 /* SBCollectionView */ = {
156 | isa = PBXNativeTarget;
157 | buildConfigurationList = 4EE375BA1BE0B999001A6624 /* Build configuration list for PBXNativeTarget "SBCollectionView" */;
158 | buildPhases = (
159 | 4EE3758E1BE0B999001A6624 /* Sources */,
160 | 4EE3758F1BE0B999001A6624 /* Frameworks */,
161 | 4EE375901BE0B999001A6624 /* Resources */,
162 | );
163 | buildRules = (
164 | );
165 | dependencies = (
166 | );
167 | name = SBCollectionView;
168 | productName = SBCollectionView;
169 | productReference = 4EE375921BE0B999001A6624 /* SBCollectionView.app */;
170 | productType = "com.apple.product-type.application";
171 | };
172 | 4EE375A51BE0B999001A6624 /* SBCollectionViewTests */ = {
173 | isa = PBXNativeTarget;
174 | buildConfigurationList = 4EE375BD1BE0B999001A6624 /* Build configuration list for PBXNativeTarget "SBCollectionViewTests" */;
175 | buildPhases = (
176 | 4EE375A21BE0B999001A6624 /* Sources */,
177 | 4EE375A31BE0B999001A6624 /* Frameworks */,
178 | 4EE375A41BE0B999001A6624 /* Resources */,
179 | );
180 | buildRules = (
181 | );
182 | dependencies = (
183 | 4EE375A81BE0B999001A6624 /* PBXTargetDependency */,
184 | );
185 | name = SBCollectionViewTests;
186 | productName = SBCollectionViewTests;
187 | productReference = 4EE375A61BE0B999001A6624 /* SBCollectionViewTests.xctest */;
188 | productType = "com.apple.product-type.bundle.unit-test";
189 | };
190 | 4EE375B01BE0B999001A6624 /* SBCollectionViewUITests */ = {
191 | isa = PBXNativeTarget;
192 | buildConfigurationList = 4EE375C01BE0B999001A6624 /* Build configuration list for PBXNativeTarget "SBCollectionViewUITests" */;
193 | buildPhases = (
194 | 4EE375AD1BE0B999001A6624 /* Sources */,
195 | 4EE375AE1BE0B999001A6624 /* Frameworks */,
196 | 4EE375AF1BE0B999001A6624 /* Resources */,
197 | );
198 | buildRules = (
199 | );
200 | dependencies = (
201 | 4EE375B31BE0B999001A6624 /* PBXTargetDependency */,
202 | );
203 | name = SBCollectionViewUITests;
204 | productName = SBCollectionViewUITests;
205 | productReference = 4EE375B11BE0B999001A6624 /* SBCollectionViewUITests.xctest */;
206 | productType = "com.apple.product-type.bundle.ui-testing";
207 | };
208 | /* End PBXNativeTarget section */
209 |
210 | /* Begin PBXProject section */
211 | 4EE3758A1BE0B999001A6624 /* Project object */ = {
212 | isa = PBXProject;
213 | attributes = {
214 | LastSwiftUpdateCheck = 0710;
215 | LastUpgradeCheck = 0920;
216 | ORGANIZATIONNAME = SANKARLAL;
217 | TargetAttributes = {
218 | 4EE375911BE0B999001A6624 = {
219 | CreatedOnToolsVersion = 7.1;
220 | };
221 | 4EE375A51BE0B999001A6624 = {
222 | CreatedOnToolsVersion = 7.1;
223 | TestTargetID = 4EE375911BE0B999001A6624;
224 | };
225 | 4EE375B01BE0B999001A6624 = {
226 | CreatedOnToolsVersion = 7.1;
227 | TestTargetID = 4EE375911BE0B999001A6624;
228 | };
229 | };
230 | };
231 | buildConfigurationList = 4EE3758D1BE0B999001A6624 /* Build configuration list for PBXProject "SBCollectionView" */;
232 | compatibilityVersion = "Xcode 3.2";
233 | developmentRegion = English;
234 | hasScannedForEncodings = 0;
235 | knownRegions = (
236 | en,
237 | Base,
238 | );
239 | mainGroup = 4EE375891BE0B999001A6624;
240 | productRefGroup = 4EE375931BE0B999001A6624 /* Products */;
241 | projectDirPath = "";
242 | projectRoot = "";
243 | targets = (
244 | 4EE375911BE0B999001A6624 /* SBCollectionView */,
245 | 4EE375A51BE0B999001A6624 /* SBCollectionViewTests */,
246 | 4EE375B01BE0B999001A6624 /* SBCollectionViewUITests */,
247 | );
248 | };
249 | /* End PBXProject section */
250 |
251 | /* Begin PBXResourcesBuildPhase section */
252 | 4EE375901BE0B999001A6624 /* Resources */ = {
253 | isa = PBXResourcesBuildPhase;
254 | buildActionMask = 2147483647;
255 | files = (
256 | 4EE375A01BE0B999001A6624 /* LaunchScreen.storyboard in Resources */,
257 | 4EE3759D1BE0B999001A6624 /* Assets.xcassets in Resources */,
258 | );
259 | runOnlyForDeploymentPostprocessing = 0;
260 | };
261 | 4EE375A41BE0B999001A6624 /* Resources */ = {
262 | isa = PBXResourcesBuildPhase;
263 | buildActionMask = 2147483647;
264 | files = (
265 | );
266 | runOnlyForDeploymentPostprocessing = 0;
267 | };
268 | 4EE375AF1BE0B999001A6624 /* Resources */ = {
269 | isa = PBXResourcesBuildPhase;
270 | buildActionMask = 2147483647;
271 | files = (
272 | );
273 | runOnlyForDeploymentPostprocessing = 0;
274 | };
275 | /* End PBXResourcesBuildPhase section */
276 |
277 | /* Begin PBXSourcesBuildPhase section */
278 | 4EE3758E1BE0B999001A6624 /* Sources */ = {
279 | isa = PBXSourcesBuildPhase;
280 | buildActionMask = 2147483647;
281 | files = (
282 | 4EE375C51BE0B9BB001A6624 /* ImageCache.swift in Sources */,
283 | 4EE375C91BE0B9EC001A6624 /* SBCollectoinViewController.swift in Sources */,
284 | 4EE375961BE0B999001A6624 /* AppDelegate.swift in Sources */,
285 | );
286 | runOnlyForDeploymentPostprocessing = 0;
287 | };
288 | 4EE375A21BE0B999001A6624 /* Sources */ = {
289 | isa = PBXSourcesBuildPhase;
290 | buildActionMask = 2147483647;
291 | files = (
292 | 4EE375AB1BE0B999001A6624 /* SBCollectionViewTests.swift in Sources */,
293 | );
294 | runOnlyForDeploymentPostprocessing = 0;
295 | };
296 | 4EE375AD1BE0B999001A6624 /* Sources */ = {
297 | isa = PBXSourcesBuildPhase;
298 | buildActionMask = 2147483647;
299 | files = (
300 | 4EE375B61BE0B999001A6624 /* SBCollectionViewUITests.swift in Sources */,
301 | );
302 | runOnlyForDeploymentPostprocessing = 0;
303 | };
304 | /* End PBXSourcesBuildPhase section */
305 |
306 | /* Begin PBXTargetDependency section */
307 | 4EE375A81BE0B999001A6624 /* PBXTargetDependency */ = {
308 | isa = PBXTargetDependency;
309 | target = 4EE375911BE0B999001A6624 /* SBCollectionView */;
310 | targetProxy = 4EE375A71BE0B999001A6624 /* PBXContainerItemProxy */;
311 | };
312 | 4EE375B31BE0B999001A6624 /* PBXTargetDependency */ = {
313 | isa = PBXTargetDependency;
314 | target = 4EE375911BE0B999001A6624 /* SBCollectionView */;
315 | targetProxy = 4EE375B21BE0B999001A6624 /* PBXContainerItemProxy */;
316 | };
317 | /* End PBXTargetDependency section */
318 |
319 | /* Begin PBXVariantGroup section */
320 | 4EE3759E1BE0B999001A6624 /* LaunchScreen.storyboard */ = {
321 | isa = PBXVariantGroup;
322 | children = (
323 | 4EE3759F1BE0B999001A6624 /* Base */,
324 | );
325 | name = LaunchScreen.storyboard;
326 | sourceTree = "";
327 | };
328 | /* End PBXVariantGroup section */
329 |
330 | /* Begin XCBuildConfiguration section */
331 | 4EE375B81BE0B999001A6624 /* Debug */ = {
332 | isa = XCBuildConfiguration;
333 | buildSettings = {
334 | ALWAYS_SEARCH_USER_PATHS = NO;
335 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
336 | CLANG_CXX_LIBRARY = "libc++";
337 | CLANG_ENABLE_MODULES = YES;
338 | CLANG_ENABLE_OBJC_ARC = YES;
339 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
340 | CLANG_WARN_BOOL_CONVERSION = YES;
341 | CLANG_WARN_COMMA = YES;
342 | CLANG_WARN_CONSTANT_CONVERSION = YES;
343 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
344 | CLANG_WARN_EMPTY_BODY = YES;
345 | CLANG_WARN_ENUM_CONVERSION = YES;
346 | CLANG_WARN_INFINITE_RECURSION = YES;
347 | CLANG_WARN_INT_CONVERSION = YES;
348 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
349 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
350 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
351 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
352 | CLANG_WARN_STRICT_PROTOTYPES = YES;
353 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
354 | CLANG_WARN_UNREACHABLE_CODE = YES;
355 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
356 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
357 | COPY_PHASE_STRIP = NO;
358 | DEBUG_INFORMATION_FORMAT = dwarf;
359 | ENABLE_STRICT_OBJC_MSGSEND = YES;
360 | ENABLE_TESTABILITY = YES;
361 | GCC_C_LANGUAGE_STANDARD = gnu99;
362 | GCC_DYNAMIC_NO_PIC = NO;
363 | GCC_NO_COMMON_BLOCKS = YES;
364 | GCC_OPTIMIZATION_LEVEL = 0;
365 | GCC_PREPROCESSOR_DEFINITIONS = (
366 | "DEBUG=1",
367 | "$(inherited)",
368 | );
369 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
370 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
371 | GCC_WARN_UNDECLARED_SELECTOR = YES;
372 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
373 | GCC_WARN_UNUSED_FUNCTION = YES;
374 | GCC_WARN_UNUSED_VARIABLE = YES;
375 | IPHONEOS_DEPLOYMENT_TARGET = 9.1;
376 | MTL_ENABLE_DEBUG_INFO = YES;
377 | ONLY_ACTIVE_ARCH = YES;
378 | SDKROOT = iphoneos;
379 | SWIFT_OPTIMIZATION_LEVEL = "-Onone";
380 | };
381 | name = Debug;
382 | };
383 | 4EE375B91BE0B999001A6624 /* Release */ = {
384 | isa = XCBuildConfiguration;
385 | buildSettings = {
386 | ALWAYS_SEARCH_USER_PATHS = NO;
387 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
388 | CLANG_CXX_LIBRARY = "libc++";
389 | CLANG_ENABLE_MODULES = YES;
390 | CLANG_ENABLE_OBJC_ARC = YES;
391 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
392 | CLANG_WARN_BOOL_CONVERSION = YES;
393 | CLANG_WARN_COMMA = YES;
394 | CLANG_WARN_CONSTANT_CONVERSION = YES;
395 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
396 | CLANG_WARN_EMPTY_BODY = YES;
397 | CLANG_WARN_ENUM_CONVERSION = YES;
398 | CLANG_WARN_INFINITE_RECURSION = YES;
399 | CLANG_WARN_INT_CONVERSION = YES;
400 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
401 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
402 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
403 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
404 | CLANG_WARN_STRICT_PROTOTYPES = YES;
405 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
406 | CLANG_WARN_UNREACHABLE_CODE = YES;
407 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
408 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
409 | COPY_PHASE_STRIP = NO;
410 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
411 | ENABLE_NS_ASSERTIONS = NO;
412 | ENABLE_STRICT_OBJC_MSGSEND = YES;
413 | GCC_C_LANGUAGE_STANDARD = gnu99;
414 | GCC_NO_COMMON_BLOCKS = YES;
415 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
416 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
417 | GCC_WARN_UNDECLARED_SELECTOR = YES;
418 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
419 | GCC_WARN_UNUSED_FUNCTION = YES;
420 | GCC_WARN_UNUSED_VARIABLE = YES;
421 | IPHONEOS_DEPLOYMENT_TARGET = 9.1;
422 | MTL_ENABLE_DEBUG_INFO = NO;
423 | SDKROOT = iphoneos;
424 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
425 | VALIDATE_PRODUCT = YES;
426 | };
427 | name = Release;
428 | };
429 | 4EE375BB1BE0B999001A6624 /* Debug */ = {
430 | isa = XCBuildConfiguration;
431 | buildSettings = {
432 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
433 | INFOPLIST_FILE = SBCollectionView/Info.plist;
434 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
435 | PRODUCT_BUNDLE_IDENTIFIER = com.sankarlal20.SBCollectionView;
436 | PRODUCT_NAME = "$(TARGET_NAME)";
437 | SWIFT_VERSION = 4.0;
438 | };
439 | name = Debug;
440 | };
441 | 4EE375BC1BE0B999001A6624 /* Release */ = {
442 | isa = XCBuildConfiguration;
443 | buildSettings = {
444 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
445 | INFOPLIST_FILE = SBCollectionView/Info.plist;
446 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
447 | PRODUCT_BUNDLE_IDENTIFIER = com.sankarlal20.SBCollectionView;
448 | PRODUCT_NAME = "$(TARGET_NAME)";
449 | SWIFT_VERSION = 4.0;
450 | };
451 | name = Release;
452 | };
453 | 4EE375BE1BE0B999001A6624 /* Debug */ = {
454 | isa = XCBuildConfiguration;
455 | buildSettings = {
456 | BUNDLE_LOADER = "$(TEST_HOST)";
457 | INFOPLIST_FILE = SBCollectionViewTests/Info.plist;
458 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
459 | PRODUCT_BUNDLE_IDENTIFIER = com.sankarlal20.SBCollectionViewTests;
460 | PRODUCT_NAME = "$(TARGET_NAME)";
461 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/SBCollectionView.app/SBCollectionView";
462 | };
463 | name = Debug;
464 | };
465 | 4EE375BF1BE0B999001A6624 /* Release */ = {
466 | isa = XCBuildConfiguration;
467 | buildSettings = {
468 | BUNDLE_LOADER = "$(TEST_HOST)";
469 | INFOPLIST_FILE = SBCollectionViewTests/Info.plist;
470 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
471 | PRODUCT_BUNDLE_IDENTIFIER = com.sankarlal20.SBCollectionViewTests;
472 | PRODUCT_NAME = "$(TARGET_NAME)";
473 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/SBCollectionView.app/SBCollectionView";
474 | };
475 | name = Release;
476 | };
477 | 4EE375C11BE0B999001A6624 /* Debug */ = {
478 | isa = XCBuildConfiguration;
479 | buildSettings = {
480 | INFOPLIST_FILE = SBCollectionViewUITests/Info.plist;
481 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
482 | PRODUCT_BUNDLE_IDENTIFIER = com.sankarlal20.SBCollectionViewUITests;
483 | PRODUCT_NAME = "$(TARGET_NAME)";
484 | TEST_TARGET_NAME = SBCollectionView;
485 | USES_XCTRUNNER = YES;
486 | };
487 | name = Debug;
488 | };
489 | 4EE375C21BE0B999001A6624 /* Release */ = {
490 | isa = XCBuildConfiguration;
491 | buildSettings = {
492 | INFOPLIST_FILE = SBCollectionViewUITests/Info.plist;
493 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
494 | PRODUCT_BUNDLE_IDENTIFIER = com.sankarlal20.SBCollectionViewUITests;
495 | PRODUCT_NAME = "$(TARGET_NAME)";
496 | TEST_TARGET_NAME = SBCollectionView;
497 | USES_XCTRUNNER = YES;
498 | };
499 | name = Release;
500 | };
501 | /* End XCBuildConfiguration section */
502 |
503 | /* Begin XCConfigurationList section */
504 | 4EE3758D1BE0B999001A6624 /* Build configuration list for PBXProject "SBCollectionView" */ = {
505 | isa = XCConfigurationList;
506 | buildConfigurations = (
507 | 4EE375B81BE0B999001A6624 /* Debug */,
508 | 4EE375B91BE0B999001A6624 /* Release */,
509 | );
510 | defaultConfigurationIsVisible = 0;
511 | defaultConfigurationName = Release;
512 | };
513 | 4EE375BA1BE0B999001A6624 /* Build configuration list for PBXNativeTarget "SBCollectionView" */ = {
514 | isa = XCConfigurationList;
515 | buildConfigurations = (
516 | 4EE375BB1BE0B999001A6624 /* Debug */,
517 | 4EE375BC1BE0B999001A6624 /* Release */,
518 | );
519 | defaultConfigurationIsVisible = 0;
520 | defaultConfigurationName = Release;
521 | };
522 | 4EE375BD1BE0B999001A6624 /* Build configuration list for PBXNativeTarget "SBCollectionViewTests" */ = {
523 | isa = XCConfigurationList;
524 | buildConfigurations = (
525 | 4EE375BE1BE0B999001A6624 /* Debug */,
526 | 4EE375BF1BE0B999001A6624 /* Release */,
527 | );
528 | defaultConfigurationIsVisible = 0;
529 | defaultConfigurationName = Release;
530 | };
531 | 4EE375C01BE0B999001A6624 /* Build configuration list for PBXNativeTarget "SBCollectionViewUITests" */ = {
532 | isa = XCConfigurationList;
533 | buildConfigurations = (
534 | 4EE375C11BE0B999001A6624 /* Debug */,
535 | 4EE375C21BE0B999001A6624 /* Release */,
536 | );
537 | defaultConfigurationIsVisible = 0;
538 | defaultConfigurationName = Release;
539 | };
540 | /* End XCConfigurationList section */
541 | };
542 | rootObject = 4EE3758A1BE0B999001A6624 /* Project object */;
543 | }
544 |
--------------------------------------------------------------------------------