├── AWCollectionViewDialLayoutDemo
├── logo.png
├── nyc.jpg
├── beach.jpg
├── hands.jpg
├── australia.jpg
├── building.jpg
├── indonesia.jpg
├── montain.jpg
├── rotterdam.jpg
├── seattle.jpg
├── awcollectionviewdiallayout_1.jpg
├── awcollectionviewdiallayout_2.jpg
├── AWCollectionCell.swift
├── UIColorExtension.swift
├── Assets.xcassets
│ └── AppIcon.appiconset
│ │ └── Contents.json
├── Info.plist
├── Base.lproj
│ ├── LaunchScreen.storyboard
│ └── Main.storyboard
├── AppDelegate.swift
├── photos.json
├── ViewController.swift
└── AWCollectionViewDialLayout.swift
└── AWCollectionViewDialLayoutDemo.xcodeproj
├── project.xcworkspace
├── contents.xcworkspacedata
└── xcuserdata
│ └── moayad.xcuserdatad
│ └── UserInterfaceState.xcuserstate
├── xcuserdata
└── moayad.xcuserdatad
│ ├── xcschemes
│ ├── xcschememanagement.plist
│ └── AWCollectionViewDialLayoutDemo.xcscheme
│ └── xcdebugger
│ └── Breakpoints_v2.xcbkptlist
└── project.pbxproj
/AWCollectionViewDialLayoutDemo/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/malkouz/SwiftAWCollectionViewDialLayout/HEAD/AWCollectionViewDialLayoutDemo/logo.png
--------------------------------------------------------------------------------
/AWCollectionViewDialLayoutDemo/nyc.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/malkouz/SwiftAWCollectionViewDialLayout/HEAD/AWCollectionViewDialLayoutDemo/nyc.jpg
--------------------------------------------------------------------------------
/AWCollectionViewDialLayoutDemo/beach.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/malkouz/SwiftAWCollectionViewDialLayout/HEAD/AWCollectionViewDialLayoutDemo/beach.jpg
--------------------------------------------------------------------------------
/AWCollectionViewDialLayoutDemo/hands.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/malkouz/SwiftAWCollectionViewDialLayout/HEAD/AWCollectionViewDialLayoutDemo/hands.jpg
--------------------------------------------------------------------------------
/AWCollectionViewDialLayoutDemo/australia.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/malkouz/SwiftAWCollectionViewDialLayout/HEAD/AWCollectionViewDialLayoutDemo/australia.jpg
--------------------------------------------------------------------------------
/AWCollectionViewDialLayoutDemo/building.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/malkouz/SwiftAWCollectionViewDialLayout/HEAD/AWCollectionViewDialLayoutDemo/building.jpg
--------------------------------------------------------------------------------
/AWCollectionViewDialLayoutDemo/indonesia.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/malkouz/SwiftAWCollectionViewDialLayout/HEAD/AWCollectionViewDialLayoutDemo/indonesia.jpg
--------------------------------------------------------------------------------
/AWCollectionViewDialLayoutDemo/montain.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/malkouz/SwiftAWCollectionViewDialLayout/HEAD/AWCollectionViewDialLayoutDemo/montain.jpg
--------------------------------------------------------------------------------
/AWCollectionViewDialLayoutDemo/rotterdam.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/malkouz/SwiftAWCollectionViewDialLayout/HEAD/AWCollectionViewDialLayoutDemo/rotterdam.jpg
--------------------------------------------------------------------------------
/AWCollectionViewDialLayoutDemo/seattle.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/malkouz/SwiftAWCollectionViewDialLayout/HEAD/AWCollectionViewDialLayoutDemo/seattle.jpg
--------------------------------------------------------------------------------
/AWCollectionViewDialLayoutDemo/awcollectionviewdiallayout_1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/malkouz/SwiftAWCollectionViewDialLayout/HEAD/AWCollectionViewDialLayoutDemo/awcollectionviewdiallayout_1.jpg
--------------------------------------------------------------------------------
/AWCollectionViewDialLayoutDemo/awcollectionviewdiallayout_2.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/malkouz/SwiftAWCollectionViewDialLayout/HEAD/AWCollectionViewDialLayoutDemo/awcollectionviewdiallayout_2.jpg
--------------------------------------------------------------------------------
/AWCollectionViewDialLayoutDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/AWCollectionViewDialLayoutDemo.xcodeproj/project.xcworkspace/xcuserdata/moayad.xcuserdatad/UserInterfaceState.xcuserstate:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/malkouz/SwiftAWCollectionViewDialLayout/HEAD/AWCollectionViewDialLayoutDemo.xcodeproj/project.xcworkspace/xcuserdata/moayad.xcuserdatad/UserInterfaceState.xcuserstate
--------------------------------------------------------------------------------
/AWCollectionViewDialLayoutDemo/AWCollectionCell.swift:
--------------------------------------------------------------------------------
1 | //
2 | // AWCollectionCellCollectionViewCell.swift
3 | // AWCollectionViewDialLayoutDemo
4 | //
5 | // Created by Moayad on 5/29/16.
6 | // Copyright © 2016 Moayad. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | class AWCollectionCell: UICollectionViewCell {
12 | @IBOutlet weak var icon:UIImageView!
13 | @IBOutlet weak var label:UILabel!
14 |
15 | }
16 |
--------------------------------------------------------------------------------
/AWCollectionViewDialLayoutDemo.xcodeproj/xcuserdata/moayad.xcuserdatad/xcschemes/xcschememanagement.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | SchemeUserState
6 |
7 | AWCollectionViewDialLayoutDemo.xcscheme
8 |
9 | orderHint
10 | 0
11 |
12 |
13 | SuppressBuildableAutocreation
14 |
15 | C75E254A1CFAD25D00E763D5
16 |
17 | primary
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/AWCollectionViewDialLayoutDemo.xcodeproj/xcuserdata/moayad.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
8 |
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/AWCollectionViewDialLayoutDemo/UIColorExtension.swift:
--------------------------------------------------------------------------------
1 | //
2 | // UIColorExtension.swift
3 | // HEXColor
4 | //
5 | // Created by R0CKSTAR on 6/13/14.
6 | // Copyright (c) 2014 P.D.Q. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | func hexStringToUIColor (_ hex:String) -> UIColor {
12 | var cString:String = hex.trimmingCharacters(in: CharacterSet.whitespacesAndNewlines).uppercased()
13 |
14 | if (cString.hasPrefix("#")) {
15 | cString = cString.substring(from: cString.characters.index(cString.startIndex, offsetBy: 1))
16 | }
17 |
18 | if ((cString.characters.count) != 6) {
19 | return UIColor.gray
20 | }
21 |
22 | var rgbValue:UInt32 = 0
23 | Scanner(string: cString).scanHexInt32(&rgbValue)
24 |
25 | return UIColor(
26 | red: CGFloat((rgbValue & 0xFF0000) >> 16) / 255.0,
27 | green: CGFloat((rgbValue & 0x00FF00) >> 8) / 255.0,
28 | blue: CGFloat(rgbValue & 0x0000FF) / 255.0,
29 | alpha: CGFloat(1.0)
30 | )
31 | }
32 |
--------------------------------------------------------------------------------
/AWCollectionViewDialLayoutDemo/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "iphone",
5 | "size" : "29x29",
6 | "scale" : "2x"
7 | },
8 | {
9 | "idiom" : "iphone",
10 | "size" : "29x29",
11 | "scale" : "3x"
12 | },
13 | {
14 | "idiom" : "iphone",
15 | "size" : "40x40",
16 | "scale" : "2x"
17 | },
18 | {
19 | "idiom" : "iphone",
20 | "size" : "40x40",
21 | "scale" : "3x"
22 | },
23 | {
24 | "idiom" : "iphone",
25 | "size" : "60x60",
26 | "scale" : "2x"
27 | },
28 | {
29 | "idiom" : "iphone",
30 | "size" : "60x60",
31 | "scale" : "3x"
32 | },
33 | {
34 | "idiom" : "ipad",
35 | "size" : "29x29",
36 | "scale" : "1x"
37 | },
38 | {
39 | "idiom" : "ipad",
40 | "size" : "29x29",
41 | "scale" : "2x"
42 | },
43 | {
44 | "idiom" : "ipad",
45 | "size" : "40x40",
46 | "scale" : "1x"
47 | },
48 | {
49 | "idiom" : "ipad",
50 | "size" : "40x40",
51 | "scale" : "2x"
52 | },
53 | {
54 | "idiom" : "ipad",
55 | "size" : "76x76",
56 | "scale" : "1x"
57 | },
58 | {
59 | "idiom" : "ipad",
60 | "size" : "76x76",
61 | "scale" : "2x"
62 | }
63 | ],
64 | "info" : {
65 | "version" : 1,
66 | "author" : "xcode"
67 | }
68 | }
--------------------------------------------------------------------------------
/AWCollectionViewDialLayoutDemo/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 | UIMainStoryboardFile
28 | Main
29 | UIRequiredDeviceCapabilities
30 |
31 | armv7
32 |
33 | UISupportedInterfaceOrientations
34 |
35 | UIInterfaceOrientationPortrait
36 | UIInterfaceOrientationLandscapeLeft
37 | UIInterfaceOrientationLandscapeRight
38 |
39 | UISupportedInterfaceOrientations~ipad
40 |
41 | UIInterfaceOrientationPortrait
42 | UIInterfaceOrientationPortraitUpsideDown
43 | UIInterfaceOrientationLandscapeLeft
44 | UIInterfaceOrientationLandscapeRight
45 |
46 |
47 |
48 |
--------------------------------------------------------------------------------
/AWCollectionViewDialLayoutDemo/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 |
--------------------------------------------------------------------------------
/AWCollectionViewDialLayoutDemo/AppDelegate.swift:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.swift
3 | // AWCollectionViewDialLayoutDemo
4 | //
5 | // Created by Moayad on 5/29/16.
6 | // Copyright © 2016 Moayad. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | @UIApplicationMain
12 | class AppDelegate: UIResponder, UIApplicationDelegate {
13 |
14 | var window: UIWindow?
15 |
16 |
17 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
18 | // Override point for customization after application launch.
19 | return true
20 | }
21 |
22 | func applicationWillResignActive(_ application: UIApplication) {
23 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
24 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
25 | }
26 |
27 | func applicationDidEnterBackground(_ application: UIApplication) {
28 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
29 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
30 | }
31 |
32 | func applicationWillEnterForeground(_ application: UIApplication) {
33 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
34 | }
35 |
36 | func applicationDidBecomeActive(_ application: UIApplication) {
37 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
38 | }
39 |
40 | func applicationWillTerminate(_ application: UIApplication) {
41 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
42 | }
43 |
44 |
45 | }
46 |
47 |
--------------------------------------------------------------------------------
/AWCollectionViewDialLayoutDemo.xcodeproj/xcuserdata/moayad.xcuserdatad/xcschemes/AWCollectionViewDialLayoutDemo.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
32 |
33 |
39 |
40 |
41 |
42 |
43 |
44 |
54 |
56 |
62 |
63 |
64 |
65 |
66 |
67 |
73 |
75 |
81 |
82 |
83 |
84 |
86 |
87 |
90 |
91 |
92 |
--------------------------------------------------------------------------------
/AWCollectionViewDialLayoutDemo/photos.json:
--------------------------------------------------------------------------------
1 | [
2 | {
3 | "name": "New York, United States",
4 | "picture": "building.jpg",
5 | "url": "https://unsplash.com/photos/TZCehSn-T-o",
6 | "color": "#c39b77"
7 | },
8 | {
9 | "name": "Yuriria, Mexico",
10 | "picture": "hands.jpg",
11 | "url": "https://unsplash.com/photos/zFnk_bTLApo",
12 | "color": "#36cca7"
13 | },
14 | {
15 | "name": "Big Sur, United States",
16 | "picture": "beach.jpg",
17 | "url": "https://unsplash.com/photos/sYegwYtIqJg",
18 | "color": "#30b4da"
19 | },
20 | {
21 | "name": "Penrith, United Kingdom",
22 | "picture": "montain.jpg",
23 | "url": "https://unsplash.com/photos/v1bP6olgtx0",
24 | "color": "#bbbac2"
25 | } ,
26 | {
27 | "name": "New York, USA",
28 | "picture": "nyc.jpg",
29 | "url": "https://unsplash.com/photos/bITjK6W2Alw",
30 | "color": "#c1a78c"
31 | },
32 | {
33 | "name": "Indonesia",
34 | "picture": "indonesia.jpg",
35 | "url": "https://unsplash.com/photos/fwsvUxNgLRs",
36 | "color": "#abc1d9"
37 | },
38 | {
39 | "name": "Wye River, Australia",
40 | "picture": "australia.jpg",
41 | "url": "https://unsplash.com/photos/5Qwz2KyfIBE",
42 | "color": "#e6b421"
43 | },
44 | {
45 | "name": "Rotterdam, Netherlands",
46 | "picture": "rotterdam.jpg",
47 | "url": "https://unsplash.com/photos/sai-x7brics",
48 | "color": "#7fb774"
49 | },
50 | {
51 | "name": "Seattle, United States",
52 | "picture": "seattle.jpg",
53 | "url": "https://unsplash.com/photos/bIQiMWxX_WU",
54 | "color": "#aa8d6b"
55 | },
56 | {
57 | "name": "New York, United States",
58 | "picture": "building.jpg",
59 | "url": "https://unsplash.com/photos/TZCehSn-T-o",
60 | "color": "#c39b77"
61 | },
62 | {
63 | "name": "Yuriria, Mexico",
64 | "picture": "hands.jpg",
65 | "url": "https://unsplash.com/photos/zFnk_bTLApo",
66 | "color": "#36cca7"
67 | },
68 | {
69 | "name": "Big Sur, United States",
70 | "picture": "beach.jpg",
71 | "url": "https://unsplash.com/photos/sYegwYtIqJg",
72 | "color": "#30b4da"
73 | },
74 | {
75 | "name": "Penrith, United Kingdom",
76 | "picture": "montain.jpg",
77 | "url": "https://unsplash.com/photos/v1bP6olgtx0",
78 | "color": "#bbbac2"
79 | } ,
80 | {
81 | "name": "New York, USA",
82 | "picture": "nyc.jpg",
83 | "url": "https://unsplash.com/photos/bITjK6W2Alw",
84 | "color": "#c1a78c"
85 | },
86 | {
87 | "name": "Indonesia",
88 | "picture": "indonesia.jpg",
89 | "url": "https://unsplash.com/photos/fwsvUxNgLRs",
90 | "color": "#abc1d9"
91 | },
92 | {
93 | "name": "Wye River, Australia",
94 | "picture": "australia.jpg",
95 | "url": "https://unsplash.com/photos/5Qwz2KyfIBE",
96 | "color": "#e6b421"
97 | },
98 | {
99 | "name": "Rotterdam, Netherlands",
100 | "picture": "rotterdam.jpg",
101 | "url": "https://unsplash.com/photos/sai-x7brics",
102 | "color": "#7fb774"
103 | },
104 | {
105 | "name": "Seattle, United States",
106 | "picture": "seattle.jpg",
107 | "url": "https://unsplash.com/photos/bIQiMWxX_WU",
108 | "color": "#aa8d6b"
109 | },
110 | {
111 | "name": "New York, United States",
112 | "picture": "building.jpg",
113 | "url": "https://unsplash.com/photos/TZCehSn-T-o",
114 | "color": "#c39b77"
115 | },
116 | {
117 | "name": "Yuriria, Mexico",
118 | "picture": "hands.jpg",
119 | "url": "https://unsplash.com/photos/zFnk_bTLApo",
120 | "color": "#36cca7"
121 | },
122 | {
123 | "name": "Big Sur, United States",
124 | "picture": "beach.jpg",
125 | "url": "https://unsplash.com/photos/sYegwYtIqJg",
126 | "color": "#30b4da"
127 | },
128 | {
129 | "name": "Penrith, United Kingdom",
130 | "picture": "montain.jpg",
131 | "url": "https://unsplash.com/photos/v1bP6olgtx0",
132 | "color": "#bbbac2"
133 | } ,
134 | {
135 | "name": "New York, USA",
136 | "picture": "nyc.jpg",
137 | "url": "https://unsplash.com/photos/bITjK6W2Alw",
138 | "color": "#c1a78c"
139 | },
140 | {
141 | "name": "Indonesia",
142 | "picture": "indonesia.jpg",
143 | "url": "https://unsplash.com/photos/fwsvUxNgLRs",
144 | "color": "#abc1d9"
145 | },
146 | {
147 | "name": "Wye River, Australia",
148 | "picture": "australia.jpg",
149 | "url": "https://unsplash.com/photos/5Qwz2KyfIBE",
150 | "color": "#e6b421"
151 | },
152 | {
153 | "name": "Rotterdam, Netherlands",
154 | "picture": "rotterdam.jpg",
155 | "url": "https://unsplash.com/photos/sai-x7brics",
156 | "color": "#7fb774"
157 | },
158 | {
159 | "name": "Seattle, United States",
160 | "picture": "seattle.jpg",
161 | "url": "https://unsplash.com/photos/bIQiMWxX_WU",
162 | "color": "#aa8d6b"
163 | }
164 | ]
--------------------------------------------------------------------------------
/AWCollectionViewDialLayoutDemo/ViewController.swift:
--------------------------------------------------------------------------------
1 | //
2 | // ViewController.swift
3 | // AWCollectionViewDialLayoutDemo
4 | //
5 | // Created by Moayad on 5/29/16.
6 | // Copyright © 2016 Moayad. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | class ViewController: UIViewController,UICollectionViewDataSource, UICollectionViewDelegate {
12 |
13 | var thumbnailCache = [String: UIImage]()
14 | var dialLayout:AWCollectionViewDialLayout!
15 | var cell_height:CGFloat!
16 |
17 | var type:Int = 0
18 |
19 | @IBOutlet weak var collectionView:UICollectionView!
20 | @IBOutlet weak var segType:UISegmentedControl!
21 | var items = [[String: String]]()
22 |
23 |
24 | override func viewDidLoad() {
25 | super.viewDidLoad()
26 |
27 | type = 0
28 | let jsonPath = Bundle.main.path(forResource: "photos", ofType: "json")
29 | let jsonData = try? Data(contentsOf: URL(fileURLWithPath: jsonPath!))
30 |
31 |
32 | do{
33 | self.items = try JSONSerialization.jsonObject(with: jsonData!, options: JSONSerialization.ReadingOptions(rawValue: 0)) as! [[String : String]]
34 |
35 |
36 | let radius = CGFloat(0.39 * 1000)
37 | let angularSpacing = CGFloat(0.16 * 90)
38 | let xOffset = CGFloat(0.23 * 320)
39 | let cell_width = CGFloat(240)
40 | cell_height = 100
41 | print("Items :: ", self.items)
42 | dialLayout = AWCollectionViewDialLayout(raduis: radius, angularSpacing: angularSpacing, cellSize: CGSize(width: cell_width, height: cell_height) , alignment: WheelAlignmentType.center, itemHeight: cell_height, xOffset: xOffset)
43 | dialLayout.shouldSnap = true
44 | dialLayout.shouldFlip = true
45 | collectionView.collectionViewLayout = dialLayout
46 | dialLayout.scrollDirection = .horizontal
47 |
48 | self.switchExample()
49 | }catch let err{
50 | print("Err :: ", err)
51 | }
52 |
53 |
54 |
55 | // Do any additional setup after loading the view, typically from a nib.
56 | }
57 |
58 | override func didReceiveMemoryWarning() {
59 | super.didReceiveMemoryWarning()
60 | // Dispose of any resources that can be recreated.
61 | }
62 |
63 |
64 | func switchExample(){
65 |
66 | var radius:CGFloat = 0 ,angularSpacing:CGFloat = 0, xOffset:CGFloat = 0
67 |
68 | if(type == 0){
69 | dialLayout.cellSize = CGSize(width: 340, height: 100)
70 | dialLayout.wheelType = .left
71 | dialLayout.shouldFlip = false
72 |
73 | radius = 300
74 | angularSpacing = 18
75 | xOffset = 70
76 | }else if(type == 1){
77 | dialLayout.cellSize = CGSize(width: 260, height: 50)
78 | dialLayout.wheelType = .center
79 | dialLayout.shouldFlip = true
80 |
81 | radius = 320
82 | angularSpacing = 5
83 | xOffset = 124
84 | }
85 |
86 | dialLayout.dialRadius = radius
87 | dialLayout.angularSpacing = angularSpacing
88 | dialLayout.xOffset = xOffset
89 |
90 | collectionView.reloadData();
91 | }
92 |
93 |
94 | override var prefersStatusBarHidden : Bool {
95 | return true
96 | }
97 |
98 | func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
99 | return self.items.count
100 | }
101 |
102 | func numberOfSections(in collectionView: UICollectionView) -> Int {
103 | return 1
104 | }
105 |
106 | func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
107 | let cell:AWCollectionCell!
108 | if(type == 0){
109 | cell = collectionView.dequeueReusableCell(withReuseIdentifier: "Cell1", for: indexPath) as! AWCollectionCell
110 | }else{
111 | cell = collectionView.dequeueReusableCell(withReuseIdentifier: "Cell2", for: indexPath) as! AWCollectionCell
112 | }
113 |
114 | let item = self.items[indexPath.item]
115 | cell.label.text = item["name"]
116 |
117 |
118 |
119 | if(type == 0){
120 | let imgURL = item["picture"]!
121 | if let img = thumbnailCache[imgURL]
122 | {
123 | cell.icon.image = img
124 | }else{
125 | DispatchQueue.main.async {
126 | // update some UI
127 | let img = UIImage(named: imgURL)
128 | cell.icon.image = img
129 | self.thumbnailCache[imgURL] = img
130 | }
131 | }
132 | }
133 |
134 | if let hexStr = item["color"]{
135 |
136 | cell.label.textColor = hexStringToUIColor(hexStr)
137 | }
138 |
139 |
140 | return cell
141 | }
142 |
143 | func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
144 | print("Select Item :: ", indexPath.item)
145 |
146 | //collectionView.scrollToItemAtIndexPath(indexPath, atScrollPosition: UICollectionViewScrollPosition.Top, animated: true)
147 | }
148 | @IBAction func changeLayoutType(_ sender: AnyObject) {
149 | type = segType.selectedSegmentIndex
150 | print("TYPE :: ", type)
151 | switchExample()
152 | }
153 |
154 | }
155 |
156 |
--------------------------------------------------------------------------------
/AWCollectionViewDialLayoutDemo/AWCollectionViewDialLayout.swift:
--------------------------------------------------------------------------------
1 | //
2 | // AWCollectionViewDialLayout.swift
3 | // AWCollectionViewDialLayoutDemo
4 | //
5 | // Created by Moayad on 5/29/16.
6 | // Copyright © 2016 Moayad. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 |
12 | enum WheelAlignmentType{
13 | case left, center
14 | }
15 |
16 | class AWCollectionViewDialLayout: UICollectionViewFlowLayout {
17 | var cellCount:Int!
18 | var wheelType:WheelAlignmentType!
19 | var center:CGPoint!
20 | var offset:CGFloat!
21 | var itemHeight:CGFloat!
22 | var xOffset:CGFloat!
23 | var cellSize:CGSize!
24 | var angularSpacing:CGFloat!
25 | var dialRadius:CGFloat!
26 | var currentIndexPath:IndexPath!
27 |
28 | var shouldSnap = false
29 | var shouldFlip = false
30 |
31 | var lastVelocity:CGPoint!
32 |
33 | init(raduis: CGFloat, angularSpacing: CGFloat, cellSize:CGSize, alignment:WheelAlignmentType, itemHeight:CGFloat, xOffset:CGFloat) {
34 | super.init()
35 |
36 | self.dialRadius = raduis
37 | self.angularSpacing = angularSpacing
38 | self.wheelType = alignment
39 | self.itemHeight = itemHeight
40 | self.cellSize = cellSize
41 | self.itemSize = cellSize
42 |
43 | self.minimumInteritemSpacing = 0
44 | self.minimumLineSpacing = 0
45 | self.itemHeight = itemHeight
46 | self.angularSpacing = angularSpacing
47 | self.sectionInset = UIEdgeInsets.zero
48 | self.scrollDirection = .vertical
49 |
50 | self.setup()
51 | }
52 |
53 | required init?(coder aDecoder: NSCoder) {
54 | fatalError("init(coder:) has not been implemented")
55 | }
56 |
57 | func setup(){
58 | self.offset = 0.0;
59 | }
60 |
61 | override func prepare(){
62 | super.prepare()
63 | if self.collectionView!.numberOfSections > 0{
64 | self.cellCount = self.collectionView?.numberOfItems(inSection: 0)
65 | }else{
66 | self.cellCount = 0
67 | }
68 | self.offset = -self.collectionView!.contentOffset.y / self.itemHeight
69 | }
70 |
71 | override func shouldInvalidateLayout(forBoundsChange newBounds: CGRect) -> Bool {
72 | return true
73 | }
74 |
75 |
76 | func getRectForItem(_ itemIndex: Int) -> CGRect{
77 | let newIndex = CGFloat(itemIndex) + self.offset
78 | let scaleFactor = fmax(0.6, 1 - fabs( newIndex * 0.25))
79 | let deltaX = self.cellSize.width/2
80 |
81 | let temp = Float(self.angularSpacing)
82 | let dds = Float(self.dialRadius + (deltaX*scaleFactor))
83 |
84 | var rX = cosf(temp * Float(newIndex) * Float(M_PI/180)) * dds
85 |
86 | let rY = sinf(temp * Float(newIndex) * Float(M_PI/180)) * dds
87 | var oX = -self.dialRadius + self.xOffset - (0.5 * self.cellSize.width);
88 | let oY = self.collectionView!.bounds.size.height/2 + self.collectionView!.contentOffset.y - (0.5 * self.cellSize.height)
89 |
90 |
91 | if(shouldFlip){
92 | oX = self.collectionView!.frame.size.width + self.dialRadius - self.xOffset - (0.5 * self.cellSize.width)
93 | rX *= -1
94 | }
95 |
96 | let itemFrame = CGRect(x: oX + CGFloat(rX), y: oY + CGFloat(rY), width: self.cellSize.width, height: self.cellSize.height)
97 |
98 | return itemFrame
99 | }
100 |
101 |
102 | override func layoutAttributesForElements(in rect: CGRect) -> [UICollectionViewLayoutAttributes]? {
103 | var theLayoutAttributes = [UICollectionViewLayoutAttributes]()
104 |
105 | let maxVisiblesHalf:Int = 180 / Int(self.angularSpacing)
106 | //var lastIndex = -1
107 |
108 | for i in 0 ..< self.cellCount{
109 | let itemFrame = self.getRectForItem(i)
110 |
111 | if(rect.intersects(itemFrame) && i > (-1 * Int(self.offset) - maxVisiblesHalf) && i < (-1 * Int(self.offset) + maxVisiblesHalf)){
112 |
113 | let indexPath = IndexPath(item: i, section: 0)
114 | let theAttributes = self.layoutAttributesForItem(at: indexPath)
115 | theLayoutAttributes.append(theAttributes!)
116 | //lastIndex = i;
117 | }
118 | }
119 |
120 | return theLayoutAttributes;
121 | }
122 |
123 | override func targetContentOffset(forProposedContentOffset proposedContentOffset: CGPoint, withScrollingVelocity velocity: CGPoint) -> CGPoint {
124 | if(shouldSnap){
125 | let index = Int(floor(proposedContentOffset.y / self.itemHeight))
126 | let off = (Int(proposedContentOffset.y) % Int(self.itemHeight))
127 |
128 | let height = Int(self.itemHeight)
129 |
130 | var targetY = index * height
131 | if( off > Int((self.itemHeight * 0.5)) && index <= self.cellCount ){
132 | targetY = (index+1) * height
133 | }
134 |
135 | return CGPoint(x: proposedContentOffset.x, y: CGFloat(targetY))
136 | }else{
137 | return proposedContentOffset;
138 | }
139 | }
140 |
141 |
142 | override func targetIndexPath(forInteractivelyMovingItem previousIndexPath: IndexPath, withPosition position: CGPoint) -> IndexPath {
143 | return IndexPath(item: 0, section: 0)
144 | }
145 |
146 | override var collectionViewContentSize : CGSize {
147 | return CGSize(width: self.collectionView!.bounds.size.width, height: CGFloat(self.cellCount-1) * self.itemHeight + self.collectionView!.bounds.size.height)
148 | }
149 |
150 | override func layoutAttributesForItem(at indexPath: IndexPath) -> UICollectionViewLayoutAttributes? {
151 | let newIndex = CGFloat(indexPath.item) + self.offset
152 |
153 | let theAttributes = UICollectionViewLayoutAttributes(forCellWith: indexPath)
154 | theAttributes.size = self.cellSize
155 |
156 | var scaleFactor:CGFloat
157 | var deltaX:CGFloat
158 | var translationT:CGAffineTransform
159 |
160 |
161 | let rotationValue = self.angularSpacing * newIndex * CGFloat(M_PI/180)
162 | var rotationT = CGAffineTransform(rotationAngle: rotationValue)
163 |
164 | if(shouldFlip){
165 | rotationT = CGAffineTransform(rotationAngle: -rotationValue)
166 | }
167 |
168 | if( self.wheelType == .left){
169 | scaleFactor = fmax(0.6, 1 - fabs( CGFloat(newIndex) * 0.25))
170 | let newFrame = self.getRectForItem(indexPath.item)
171 | theAttributes.frame = CGRect(x: newFrame.origin.x , y: newFrame.origin.y, width: newFrame.size.width, height: newFrame.size.height)
172 |
173 | translationT = CGAffineTransform(translationX: 0 , y: 0)
174 | }else {
175 | scaleFactor = fmax(0.4, 1 - fabs( CGFloat(newIndex) * 0.50))
176 | deltaX = self.collectionView!.bounds.size.width / 2
177 |
178 | if(shouldFlip){
179 | theAttributes.center = CGPoint( x: self.collectionView!.frame.size.width + self.dialRadius - self.xOffset , y: self.collectionView!.bounds.size.height/2 + self.collectionView!.contentOffset.y)
180 |
181 | translationT = CGAffineTransform( translationX: -1 * (self.dialRadius + ((1 - scaleFactor) * -30)) , y: 0)
182 | print("should Flip ")
183 | }else{
184 | theAttributes.center = CGPoint(x: -self.dialRadius + self.xOffset , y: self.collectionView!.bounds.size.height/2 + self.collectionView!.contentOffset.y);
185 | translationT = CGAffineTransform(translationX: self.dialRadius + ((1 - scaleFactor) * -30) , y: 0);
186 | print("should not Flip ")
187 | }
188 | }
189 |
190 |
191 |
192 | let scaleT:CGAffineTransform = CGAffineTransform(scaleX: scaleFactor, y: scaleFactor)
193 | theAttributes.alpha = scaleFactor
194 | theAttributes.isHidden = false
195 |
196 | theAttributes.transform = scaleT.concatenating(translationT.concatenating(rotationT))
197 |
198 | return theAttributes
199 |
200 | }
201 | }
202 |
--------------------------------------------------------------------------------
/AWCollectionViewDialLayoutDemo/Base.lproj/Main.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
--------------------------------------------------------------------------------
/AWCollectionViewDialLayoutDemo.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 46;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | C75E254F1CFAD25D00E763D5 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = C75E254E1CFAD25D00E763D5 /* AppDelegate.swift */; };
11 | C75E25511CFAD25D00E763D5 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = C75E25501CFAD25D00E763D5 /* ViewController.swift */; };
12 | C75E25541CFAD25D00E763D5 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = C75E25521CFAD25D00E763D5 /* Main.storyboard */; };
13 | C75E25561CFAD25D00E763D5 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = C75E25551CFAD25D00E763D5 /* Assets.xcassets */; };
14 | C75E25591CFAD25D00E763D5 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = C75E25571CFAD25D00E763D5 /* LaunchScreen.storyboard */; };
15 | C75E25611CFAD29400E763D5 /* AWCollectionViewDialLayout.swift in Sources */ = {isa = PBXBuildFile; fileRef = C75E25601CFAD29400E763D5 /* AWCollectionViewDialLayout.swift */; };
16 | C75E25631CFAFFF500E763D5 /* AWCollectionCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = C75E25621CFAFFF500E763D5 /* AWCollectionCell.swift */; };
17 | C75E25661CFC191000E763D5 /* photos.json in Resources */ = {isa = PBXBuildFile; fileRef = C75E25651CFC191000E763D5 /* photos.json */; };
18 | C75E25731CFC192C00E763D5 /* awcollectionviewdiallayout_1.jpg in Resources */ = {isa = PBXBuildFile; fileRef = C75E25671CFC192C00E763D5 /* awcollectionviewdiallayout_1.jpg */; };
19 | C75E25741CFC192C00E763D5 /* awcollectionviewdiallayout_2.jpg in Resources */ = {isa = PBXBuildFile; fileRef = C75E25681CFC192C00E763D5 /* awcollectionviewdiallayout_2.jpg */; };
20 | C75E25751CFC192C00E763D5 /* australia.jpg in Resources */ = {isa = PBXBuildFile; fileRef = C75E25691CFC192C00E763D5 /* australia.jpg */; };
21 | C75E25761CFC192C00E763D5 /* beach.jpg in Resources */ = {isa = PBXBuildFile; fileRef = C75E256A1CFC192C00E763D5 /* beach.jpg */; };
22 | C75E25771CFC192C00E763D5 /* building.jpg in Resources */ = {isa = PBXBuildFile; fileRef = C75E256B1CFC192C00E763D5 /* building.jpg */; };
23 | C75E25781CFC192C00E763D5 /* hands.jpg in Resources */ = {isa = PBXBuildFile; fileRef = C75E256C1CFC192C00E763D5 /* hands.jpg */; };
24 | C75E25791CFC192C00E763D5 /* indonesia.jpg in Resources */ = {isa = PBXBuildFile; fileRef = C75E256D1CFC192C00E763D5 /* indonesia.jpg */; };
25 | C75E257A1CFC192C00E763D5 /* montain.jpg in Resources */ = {isa = PBXBuildFile; fileRef = C75E256E1CFC192C00E763D5 /* montain.jpg */; };
26 | C75E257B1CFC192C00E763D5 /* nyc.jpg in Resources */ = {isa = PBXBuildFile; fileRef = C75E256F1CFC192C00E763D5 /* nyc.jpg */; };
27 | C75E257C1CFC192C00E763D5 /* rotterdam.jpg in Resources */ = {isa = PBXBuildFile; fileRef = C75E25701CFC192C00E763D5 /* rotterdam.jpg */; };
28 | C75E257D1CFC192C00E763D5 /* seattle.jpg in Resources */ = {isa = PBXBuildFile; fileRef = C75E25711CFC192C00E763D5 /* seattle.jpg */; };
29 | C75E257E1CFC192C00E763D5 /* logo.png in Resources */ = {isa = PBXBuildFile; fileRef = C75E25721CFC192C00E763D5 /* logo.png */; };
30 | C75E25801CFC32FF00E763D5 /* UIColorExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = C75E257F1CFC32FF00E763D5 /* UIColorExtension.swift */; };
31 | /* End PBXBuildFile section */
32 |
33 | /* Begin PBXFileReference section */
34 | C75E254B1CFAD25D00E763D5 /* AWCollectionViewDialLayoutDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = AWCollectionViewDialLayoutDemo.app; sourceTree = BUILT_PRODUCTS_DIR; };
35 | C75E254E1CFAD25D00E763D5 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; };
36 | C75E25501CFAD25D00E763D5 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; };
37 | C75E25531CFAD25D00E763D5 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; };
38 | C75E25551CFAD25D00E763D5 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; };
39 | C75E25581CFAD25D00E763D5 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; };
40 | C75E255A1CFAD25D00E763D5 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
41 | C75E25601CFAD29400E763D5 /* AWCollectionViewDialLayout.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AWCollectionViewDialLayout.swift; sourceTree = ""; };
42 | C75E25621CFAFFF500E763D5 /* AWCollectionCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AWCollectionCell.swift; sourceTree = ""; };
43 | C75E25651CFC191000E763D5 /* photos.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = photos.json; sourceTree = ""; };
44 | C75E25671CFC192C00E763D5 /* awcollectionviewdiallayout_1.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = awcollectionviewdiallayout_1.jpg; sourceTree = ""; };
45 | C75E25681CFC192C00E763D5 /* awcollectionviewdiallayout_2.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = awcollectionviewdiallayout_2.jpg; sourceTree = ""; };
46 | C75E25691CFC192C00E763D5 /* australia.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = australia.jpg; sourceTree = ""; };
47 | C75E256A1CFC192C00E763D5 /* beach.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = beach.jpg; sourceTree = ""; };
48 | C75E256B1CFC192C00E763D5 /* building.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = building.jpg; sourceTree = ""; };
49 | C75E256C1CFC192C00E763D5 /* hands.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = hands.jpg; sourceTree = ""; };
50 | C75E256D1CFC192C00E763D5 /* indonesia.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = indonesia.jpg; sourceTree = ""; };
51 | C75E256E1CFC192C00E763D5 /* montain.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = montain.jpg; sourceTree = ""; };
52 | C75E256F1CFC192C00E763D5 /* nyc.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = nyc.jpg; sourceTree = ""; };
53 | C75E25701CFC192C00E763D5 /* rotterdam.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = rotterdam.jpg; sourceTree = ""; };
54 | C75E25711CFC192C00E763D5 /* seattle.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = seattle.jpg; sourceTree = ""; };
55 | C75E25721CFC192C00E763D5 /* logo.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = logo.png; sourceTree = ""; };
56 | C75E257F1CFC32FF00E763D5 /* UIColorExtension.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UIColorExtension.swift; sourceTree = ""; };
57 | /* End PBXFileReference section */
58 |
59 | /* Begin PBXFrameworksBuildPhase section */
60 | C75E25481CFAD25D00E763D5 /* Frameworks */ = {
61 | isa = PBXFrameworksBuildPhase;
62 | buildActionMask = 2147483647;
63 | files = (
64 | );
65 | runOnlyForDeploymentPostprocessing = 0;
66 | };
67 | /* End PBXFrameworksBuildPhase section */
68 |
69 | /* Begin PBXGroup section */
70 | C75E25421CFAD25D00E763D5 = {
71 | isa = PBXGroup;
72 | children = (
73 | C75E254D1CFAD25D00E763D5 /* AWCollectionViewDialLayoutDemo */,
74 | C75E254C1CFAD25D00E763D5 /* Products */,
75 | );
76 | sourceTree = "";
77 | };
78 | C75E254C1CFAD25D00E763D5 /* Products */ = {
79 | isa = PBXGroup;
80 | children = (
81 | C75E254B1CFAD25D00E763D5 /* AWCollectionViewDialLayoutDemo.app */,
82 | );
83 | name = Products;
84 | sourceTree = "";
85 | };
86 | C75E254D1CFAD25D00E763D5 /* AWCollectionViewDialLayoutDemo */ = {
87 | isa = PBXGroup;
88 | children = (
89 | C75E25641CFC18FF00E763D5 /* Assets */,
90 | C75E254E1CFAD25D00E763D5 /* AppDelegate.swift */,
91 | C75E25501CFAD25D00E763D5 /* ViewController.swift */,
92 | C75E25521CFAD25D00E763D5 /* Main.storyboard */,
93 | C75E25551CFAD25D00E763D5 /* Assets.xcassets */,
94 | C75E25571CFAD25D00E763D5 /* LaunchScreen.storyboard */,
95 | C75E255A1CFAD25D00E763D5 /* Info.plist */,
96 | C75E25601CFAD29400E763D5 /* AWCollectionViewDialLayout.swift */,
97 | C75E25621CFAFFF500E763D5 /* AWCollectionCell.swift */,
98 | C75E257F1CFC32FF00E763D5 /* UIColorExtension.swift */,
99 | );
100 | path = AWCollectionViewDialLayoutDemo;
101 | sourceTree = "";
102 | };
103 | C75E25641CFC18FF00E763D5 /* Assets */ = {
104 | isa = PBXGroup;
105 | children = (
106 | C75E25671CFC192C00E763D5 /* awcollectionviewdiallayout_1.jpg */,
107 | C75E25681CFC192C00E763D5 /* awcollectionviewdiallayout_2.jpg */,
108 | C75E25691CFC192C00E763D5 /* australia.jpg */,
109 | C75E256A1CFC192C00E763D5 /* beach.jpg */,
110 | C75E256B1CFC192C00E763D5 /* building.jpg */,
111 | C75E256C1CFC192C00E763D5 /* hands.jpg */,
112 | C75E256D1CFC192C00E763D5 /* indonesia.jpg */,
113 | C75E256E1CFC192C00E763D5 /* montain.jpg */,
114 | C75E256F1CFC192C00E763D5 /* nyc.jpg */,
115 | C75E25701CFC192C00E763D5 /* rotterdam.jpg */,
116 | C75E25711CFC192C00E763D5 /* seattle.jpg */,
117 | C75E25721CFC192C00E763D5 /* logo.png */,
118 | C75E25651CFC191000E763D5 /* photos.json */,
119 | );
120 | name = Assets;
121 | sourceTree = "";
122 | };
123 | /* End PBXGroup section */
124 |
125 | /* Begin PBXNativeTarget section */
126 | C75E254A1CFAD25D00E763D5 /* AWCollectionViewDialLayoutDemo */ = {
127 | isa = PBXNativeTarget;
128 | buildConfigurationList = C75E255D1CFAD25D00E763D5 /* Build configuration list for PBXNativeTarget "AWCollectionViewDialLayoutDemo" */;
129 | buildPhases = (
130 | C75E25471CFAD25D00E763D5 /* Sources */,
131 | C75E25481CFAD25D00E763D5 /* Frameworks */,
132 | C75E25491CFAD25D00E763D5 /* Resources */,
133 | );
134 | buildRules = (
135 | );
136 | dependencies = (
137 | );
138 | name = AWCollectionViewDialLayoutDemo;
139 | productName = AWCollectionViewDialLayoutDemo;
140 | productReference = C75E254B1CFAD25D00E763D5 /* AWCollectionViewDialLayoutDemo.app */;
141 | productType = "com.apple.product-type.application";
142 | };
143 | /* End PBXNativeTarget section */
144 |
145 | /* Begin PBXProject section */
146 | C75E25431CFAD25D00E763D5 /* Project object */ = {
147 | isa = PBXProject;
148 | attributes = {
149 | LastSwiftUpdateCheck = 0730;
150 | LastUpgradeCheck = 0820;
151 | ORGANIZATIONNAME = Moayad;
152 | TargetAttributes = {
153 | C75E254A1CFAD25D00E763D5 = {
154 | CreatedOnToolsVersion = 7.3;
155 | LastSwiftMigration = 0820;
156 | };
157 | };
158 | };
159 | buildConfigurationList = C75E25461CFAD25D00E763D5 /* Build configuration list for PBXProject "AWCollectionViewDialLayoutDemo" */;
160 | compatibilityVersion = "Xcode 3.2";
161 | developmentRegion = English;
162 | hasScannedForEncodings = 0;
163 | knownRegions = (
164 | en,
165 | Base,
166 | );
167 | mainGroup = C75E25421CFAD25D00E763D5;
168 | productRefGroup = C75E254C1CFAD25D00E763D5 /* Products */;
169 | projectDirPath = "";
170 | projectRoot = "";
171 | targets = (
172 | C75E254A1CFAD25D00E763D5 /* AWCollectionViewDialLayoutDemo */,
173 | );
174 | };
175 | /* End PBXProject section */
176 |
177 | /* Begin PBXResourcesBuildPhase section */
178 | C75E25491CFAD25D00E763D5 /* Resources */ = {
179 | isa = PBXResourcesBuildPhase;
180 | buildActionMask = 2147483647;
181 | files = (
182 | C75E25781CFC192C00E763D5 /* hands.jpg in Resources */,
183 | C75E25771CFC192C00E763D5 /* building.jpg in Resources */,
184 | C75E25751CFC192C00E763D5 /* australia.jpg in Resources */,
185 | C75E25741CFC192C00E763D5 /* awcollectionviewdiallayout_2.jpg in Resources */,
186 | C75E257B1CFC192C00E763D5 /* nyc.jpg in Resources */,
187 | C75E25661CFC191000E763D5 /* photos.json in Resources */,
188 | C75E257C1CFC192C00E763D5 /* rotterdam.jpg in Resources */,
189 | C75E25761CFC192C00E763D5 /* beach.jpg in Resources */,
190 | C75E25591CFAD25D00E763D5 /* LaunchScreen.storyboard in Resources */,
191 | C75E25561CFAD25D00E763D5 /* Assets.xcassets in Resources */,
192 | C75E257A1CFC192C00E763D5 /* montain.jpg in Resources */,
193 | C75E257D1CFC192C00E763D5 /* seattle.jpg in Resources */,
194 | C75E257E1CFC192C00E763D5 /* logo.png in Resources */,
195 | C75E25791CFC192C00E763D5 /* indonesia.jpg in Resources */,
196 | C75E25731CFC192C00E763D5 /* awcollectionviewdiallayout_1.jpg in Resources */,
197 | C75E25541CFAD25D00E763D5 /* Main.storyboard in Resources */,
198 | );
199 | runOnlyForDeploymentPostprocessing = 0;
200 | };
201 | /* End PBXResourcesBuildPhase section */
202 |
203 | /* Begin PBXSourcesBuildPhase section */
204 | C75E25471CFAD25D00E763D5 /* Sources */ = {
205 | isa = PBXSourcesBuildPhase;
206 | buildActionMask = 2147483647;
207 | files = (
208 | C75E25511CFAD25D00E763D5 /* ViewController.swift in Sources */,
209 | C75E254F1CFAD25D00E763D5 /* AppDelegate.swift in Sources */,
210 | C75E25801CFC32FF00E763D5 /* UIColorExtension.swift in Sources */,
211 | C75E25631CFAFFF500E763D5 /* AWCollectionCell.swift in Sources */,
212 | C75E25611CFAD29400E763D5 /* AWCollectionViewDialLayout.swift in Sources */,
213 | );
214 | runOnlyForDeploymentPostprocessing = 0;
215 | };
216 | /* End PBXSourcesBuildPhase section */
217 |
218 | /* Begin PBXVariantGroup section */
219 | C75E25521CFAD25D00E763D5 /* Main.storyboard */ = {
220 | isa = PBXVariantGroup;
221 | children = (
222 | C75E25531CFAD25D00E763D5 /* Base */,
223 | );
224 | name = Main.storyboard;
225 | sourceTree = "";
226 | };
227 | C75E25571CFAD25D00E763D5 /* LaunchScreen.storyboard */ = {
228 | isa = PBXVariantGroup;
229 | children = (
230 | C75E25581CFAD25D00E763D5 /* Base */,
231 | );
232 | name = LaunchScreen.storyboard;
233 | sourceTree = "";
234 | };
235 | /* End PBXVariantGroup section */
236 |
237 | /* Begin XCBuildConfiguration section */
238 | C75E255B1CFAD25D00E763D5 /* Debug */ = {
239 | isa = XCBuildConfiguration;
240 | buildSettings = {
241 | ALWAYS_SEARCH_USER_PATHS = NO;
242 | CLANG_ANALYZER_NONNULL = YES;
243 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
244 | CLANG_CXX_LIBRARY = "libc++";
245 | CLANG_ENABLE_MODULES = YES;
246 | CLANG_ENABLE_OBJC_ARC = YES;
247 | CLANG_WARN_BOOL_CONVERSION = YES;
248 | CLANG_WARN_CONSTANT_CONVERSION = YES;
249 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
250 | CLANG_WARN_EMPTY_BODY = YES;
251 | CLANG_WARN_ENUM_CONVERSION = YES;
252 | CLANG_WARN_INFINITE_RECURSION = YES;
253 | CLANG_WARN_INT_CONVERSION = YES;
254 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
255 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
256 | CLANG_WARN_UNREACHABLE_CODE = YES;
257 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
258 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
259 | COPY_PHASE_STRIP = NO;
260 | DEBUG_INFORMATION_FORMAT = dwarf;
261 | ENABLE_STRICT_OBJC_MSGSEND = YES;
262 | ENABLE_TESTABILITY = YES;
263 | GCC_C_LANGUAGE_STANDARD = gnu99;
264 | GCC_DYNAMIC_NO_PIC = NO;
265 | GCC_NO_COMMON_BLOCKS = YES;
266 | GCC_OPTIMIZATION_LEVEL = 0;
267 | GCC_PREPROCESSOR_DEFINITIONS = (
268 | "DEBUG=1",
269 | "$(inherited)",
270 | );
271 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
272 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
273 | GCC_WARN_UNDECLARED_SELECTOR = YES;
274 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
275 | GCC_WARN_UNUSED_FUNCTION = YES;
276 | GCC_WARN_UNUSED_VARIABLE = YES;
277 | IPHONEOS_DEPLOYMENT_TARGET = 9.3;
278 | MTL_ENABLE_DEBUG_INFO = YES;
279 | ONLY_ACTIVE_ARCH = YES;
280 | SDKROOT = iphoneos;
281 | SWIFT_OPTIMIZATION_LEVEL = "-Onone";
282 | TARGETED_DEVICE_FAMILY = "1,2";
283 | };
284 | name = Debug;
285 | };
286 | C75E255C1CFAD25D00E763D5 /* Release */ = {
287 | isa = XCBuildConfiguration;
288 | buildSettings = {
289 | ALWAYS_SEARCH_USER_PATHS = NO;
290 | CLANG_ANALYZER_NONNULL = YES;
291 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
292 | CLANG_CXX_LIBRARY = "libc++";
293 | CLANG_ENABLE_MODULES = YES;
294 | CLANG_ENABLE_OBJC_ARC = YES;
295 | CLANG_WARN_BOOL_CONVERSION = YES;
296 | CLANG_WARN_CONSTANT_CONVERSION = YES;
297 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
298 | CLANG_WARN_EMPTY_BODY = YES;
299 | CLANG_WARN_ENUM_CONVERSION = YES;
300 | CLANG_WARN_INFINITE_RECURSION = YES;
301 | CLANG_WARN_INT_CONVERSION = YES;
302 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
303 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
304 | CLANG_WARN_UNREACHABLE_CODE = YES;
305 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
306 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
307 | COPY_PHASE_STRIP = NO;
308 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
309 | ENABLE_NS_ASSERTIONS = NO;
310 | ENABLE_STRICT_OBJC_MSGSEND = YES;
311 | GCC_C_LANGUAGE_STANDARD = gnu99;
312 | GCC_NO_COMMON_BLOCKS = YES;
313 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
314 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
315 | GCC_WARN_UNDECLARED_SELECTOR = YES;
316 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
317 | GCC_WARN_UNUSED_FUNCTION = YES;
318 | GCC_WARN_UNUSED_VARIABLE = YES;
319 | IPHONEOS_DEPLOYMENT_TARGET = 9.3;
320 | MTL_ENABLE_DEBUG_INFO = NO;
321 | SDKROOT = iphoneos;
322 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
323 | TARGETED_DEVICE_FAMILY = "1,2";
324 | VALIDATE_PRODUCT = YES;
325 | };
326 | name = Release;
327 | };
328 | C75E255E1CFAD25D00E763D5 /* Debug */ = {
329 | isa = XCBuildConfiguration;
330 | buildSettings = {
331 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
332 | INFOPLIST_FILE = AWCollectionViewDialLayoutDemo/Info.plist;
333 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
334 | PRODUCT_BUNDLE_IDENTIFIER = com.moayad.AWCollectionViewDialLayoutDemo;
335 | PRODUCT_NAME = "$(TARGET_NAME)";
336 | SWIFT_VERSION = 3.0;
337 | };
338 | name = Debug;
339 | };
340 | C75E255F1CFAD25D00E763D5 /* Release */ = {
341 | isa = XCBuildConfiguration;
342 | buildSettings = {
343 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
344 | INFOPLIST_FILE = AWCollectionViewDialLayoutDemo/Info.plist;
345 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
346 | PRODUCT_BUNDLE_IDENTIFIER = com.moayad.AWCollectionViewDialLayoutDemo;
347 | PRODUCT_NAME = "$(TARGET_NAME)";
348 | SWIFT_VERSION = 3.0;
349 | };
350 | name = Release;
351 | };
352 | /* End XCBuildConfiguration section */
353 |
354 | /* Begin XCConfigurationList section */
355 | C75E25461CFAD25D00E763D5 /* Build configuration list for PBXProject "AWCollectionViewDialLayoutDemo" */ = {
356 | isa = XCConfigurationList;
357 | buildConfigurations = (
358 | C75E255B1CFAD25D00E763D5 /* Debug */,
359 | C75E255C1CFAD25D00E763D5 /* Release */,
360 | );
361 | defaultConfigurationIsVisible = 0;
362 | defaultConfigurationName = Release;
363 | };
364 | C75E255D1CFAD25D00E763D5 /* Build configuration list for PBXNativeTarget "AWCollectionViewDialLayoutDemo" */ = {
365 | isa = XCConfigurationList;
366 | buildConfigurations = (
367 | C75E255E1CFAD25D00E763D5 /* Debug */,
368 | C75E255F1CFAD25D00E763D5 /* Release */,
369 | );
370 | defaultConfigurationIsVisible = 0;
371 | defaultConfigurationName = Release;
372 | };
373 | /* End XCConfigurationList section */
374 | };
375 | rootObject = C75E25431CFAD25D00E763D5 /* Project object */;
376 | }
377 |
--------------------------------------------------------------------------------