Skip to content

Commit 302b706

Browse files
committed
init 2
1 parent d4dd089 commit 302b706

20 files changed

+2728
-0
lines changed

Diff for: LICENSE

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
Copyright (c) 2020 rustamburger@gmail.com <rustamburger@gmail.com>
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a copy
4+
of this software and associated documentation files (the "Software"), to deal
5+
in the Software without restriction, including without limitation the rights
6+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7+
copies of the Software, and to permit persons to whom the Software is
8+
furnished to do so, subject to the following conditions:
9+
10+
The above copyright notice and this permission notice shall be included in
11+
all copies or substantial portions of the Software.
12+
13+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19+
THE SOFTWARE.

Diff for: Package.swift

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
// swift-tools-version:5.2
2+
// The swift-tools-version declares the minimum version of Swift required to build this package.
3+
4+
import PackageDescription
5+
6+
let package = Package(
7+
name: "ContainerController",
8+
platforms: [
9+
.iOS(.v13),
10+
],
11+
products: [
12+
// Products define the executables and libraries produced by a package, and make them visible to other packages.
13+
.library(
14+
name: "ContainerController",
15+
targets: ["ContainerController"]),
16+
],
17+
dependencies: [
18+
// Dependencies declare other packages that this package depends on.
19+
// .package(url: /* package url */, from: "1.0.0"),
20+
],
21+
targets: [
22+
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
23+
// Targets can depend on other targets in this package, and on products in packages which this package depends on.
24+
.target(
25+
name: "ContainerController",
26+
dependencies: []),
27+
.testTarget(
28+
name: "ContainerControllerTests",
29+
dependencies: ["ContainerController"]),
30+
]
31+
)

Diff for: README.md

+65
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
2+
3+
# ContainerController Desing Examples
4+
5+
[![Version](https://img.shields.io/cocoapods/v/ContainerControllerSwift.svg?style=flat)](https://cocoapods.org/pods/ContainerControllerSwift)
6+
[![License](https://img.shields.io/cocoapods/l/ContainerControllerSwift.svg?style=flat)](https://cocoapods.org/pods/ContainerControllerSwift)
7+
[![Platform](https://img.shields.io/cocoapods/p/ContainerControllerSwift.svg?style=flat)](https://cocoapods.org/pods/ContainerControllerSwift)
8+
[![Swift 5.0](https://img.shields.io/badge/Swift-5.0-orange.svg?style=flat)](https://swift.org/)
9+
[![Swift 5.1](https://img.shields.io/badge/Swift-5.1-orange.svg?style=flat)](https://swift.org/)
10+
[![Swift 5.2](https://img.shields.io/badge/Swift-5.2-orange.svg?style=flat)](https://swift.org/)
11+
12+
UI Component. Swipe scroll panel
13+
14+
#### For more information (create usage and settings), please follow this link to the main repository
15+
### 👉 [mrustaa/ContainerController](https://github.com/mrustaa/ContainerController)
16+
17+
## About the project
18+
19+
Examples of use (ui swipe component ContainerController) in popular design applications.
20+
21+
It is used in different categories apps:
22+
- Maps / Menu / Player Music / Market / Sports News / Taxi / Finance Banks Stock / Wallets / Analytics / Notes
23+
- Alerts / Popups / Notifications
24+
25+
### Designs Screen are borrowed from Dribbble.com
26+
27+
urls:
28+
29+
- 🎧 Play Music https://dribbble.com/shots/15381326-Move-Multipurpose-HTML-Template-I
30+
- 💳 Sallets https://dribbble.com/shots/18054638-Sowallet-Mobile-Appp
31+
- 💲 Crypto https://dribbble.com/shots/24353177-Crypto-Loan-Mobile-App
32+
- 💹 Buy Stock https://dribbble.com/shots/14364583-Online-Banking-Mobile-App
33+
- 💪 Sport https://dribbble.com/shots/15544535-Sneakers-Shopping-App
34+
- 🚕 Taxi https://dribbble.com/shots/23691282-Taxi-Booking-App-Design
35+
- 🗺 Map Parking https://dribbble.com/shots/15034854-AirGarage-Mobile-App-Redesign
36+
- 🃏 Custom Card https://dribbble.com/shots/20629590-Business-Card-Mobile-IOS-App
37+
- 📍 Apple.Maps App https://apps.apple.com/us/app/apple-maps/id915056765
38+
39+
gif previews:
40+
41+
![image](https://github.com/mrustaa/gif_presentation/blob/master/ContainerControllerSwift/screen_play_music.gif)
42+
![image](https://github.com/mrustaa/gif_presentation/blob/master/ContainerControllerSwift/screen_wallets.gif)
43+
![image](https://github.com/mrustaa/gif_presentation/blob/master/ContainerControllerSwift/screen_crypto.gif)
44+
![image](https://github.com/mrustaa/gif_presentation/blob/master/ContainerControllerSwift/screen_sport.gif)
45+
![image](https://github.com/mrustaa/gif_presentation/blob/master/ContainerControllerSwift/screen_taxi.gif)
46+
![image](https://github.com/mrustaa/gif_presentation/blob/master/ContainerControllerSwift/screen_map_parking.gif)
47+
![image](https://github.com/mrustaa/gif_presentation/blob/master/ContainerControllerSwift/screen_custom_card.gif)
48+
![image](https://github.com/mrustaa/gif_presentation/blob/master/ContainerControllerSwift/screen_buy_stock.gif)
49+
50+
### More info 👉 [ContainerController](https://github.com/mrustaa/ContainerController)
51+
52+
<!--![image](https://github.com/mrustaa/gif_presentation/blob/master/ContainerControllerSwift/maps.gif)-->
53+
<!--![image](https://github.com/mrustaa/gif_presentation/blob/master/ContainerControllerSwift/examples.gif)-->
54+
<!--![image(Landscape)](https://github.com/mrustaa/gif_presentation/blob/master/ContainerControllerSwift/mapsLandscape.gif)-->
55+
56+
<!-- TOC -->
57+
58+
## Author
59+
60+
<motionrustam@gmail.com> 📩| [mrustaa](https://github.com/mrustaa/) JUNE 2020
61+
62+
## License
63+
64+
ContainerController is available under the MIT license. See the LICENSE file for more info.
65+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,147 @@
1+
//
2+
// CollectionAdapterCell.swift
3+
// PatternsSwift
4+
//
5+
// Created by mrustaa on 01/05/2020.
6+
// Copyright © 2020 mrustaa. All rights reserved.
7+
//
8+
9+
import UIKit
10+
11+
open class CollectionAdapterInsets: NSObject {
12+
public var minSpacing: CollectionAdapterMinSpacing = CollectionAdapterMinSpacing(cell: 0, line: 0)
13+
public var insets: UIEdgeInsets = .zero
14+
public var scrollDirection: UICollectionView.ScrollDirection = .horizontal
15+
16+
public init(minSpacing: CollectionAdapterMinSpacing, insets: UIEdgeInsets, scrollDirection: UICollectionView.ScrollDirection = .horizontal) {
17+
self.minSpacing = minSpacing
18+
self.insets = insets
19+
self.scrollDirection = scrollDirection
20+
}
21+
22+
}
23+
24+
open class CollectionAdapterMinSpacing: NSObject {
25+
public var cell: CGFloat = 0
26+
public var line: CGFloat = 0
27+
28+
public init(cell: CGFloat, line: CGFloat) {
29+
self.cell = cell
30+
self.line = line
31+
}
32+
}
33+
34+
open class CollectionAdapterCell: UICollectionViewCell {
35+
36+
@IBInspectable var hideAnimation: Bool = false
37+
var selectedView: UIView?
38+
39+
public var cellData: CollectionAdapterCellData?
40+
41+
open func fill(data: Any?) {
42+
43+
}
44+
45+
override init(frame: CGRect) {
46+
super.init(frame: frame)
47+
setupCommonProperties()
48+
}
49+
50+
required public init?(coder: NSCoder) {
51+
super.init(coder: coder)
52+
setupCommonProperties()
53+
}
54+
55+
private func setupCommonProperties() {
56+
57+
}
58+
59+
// public func notifyDidTap() {
60+
// guard let cellData = cellData else { return }
61+
// let cellDataIdentifier = cellData.cellIdentifier
62+
//
63+
// let action = CollectionViewAdapterCellAction(
64+
// cell: self,
65+
// cellIdentifier: cellDataIdentifier,
66+
// actionIdentifier: CollectionsActionCellsIdentifiers.cellDidTap.rawValue,
67+
// data: cellData)
68+
//
69+
// delegate?.handle(action: action)
70+
// }
71+
72+
let selAlpha: CGFloat = 0.2 // 0.15
73+
74+
75+
open override var isSelected: Bool {
76+
set {
77+
super.isSelected = newValue
78+
79+
if hideAnimation {
80+
81+
if newValue {
82+
alpha = 0.5
83+
UIView.animate(withDuration: 0.45) {
84+
self.alpha = 1
85+
}
86+
} else {
87+
self.alpha = 1
88+
}
89+
90+
} else {
91+
92+
if let selectedView = selectedView {
93+
if newValue {
94+
selectedView.alpha = selAlpha
95+
UIView.animate(withDuration: 0.45) {
96+
selectedView.alpha = 0.0
97+
}
98+
} else {
99+
selectedView.alpha = 0.0
100+
}
101+
} else {
102+
// super.setSelected(selected, animated: animated)
103+
}
104+
}
105+
}
106+
get {
107+
return super.isSelected
108+
}
109+
}
110+
111+
open override var isHighlighted: Bool {
112+
set {
113+
super.isHighlighted = newValue
114+
115+
if hideAnimation {
116+
if newValue {
117+
UIView.animate(withDuration: 0.1) {
118+
self.alpha = 0.5
119+
}
120+
} else {
121+
UIView.animate(withDuration: 0.45) {
122+
self.alpha = 1
123+
}
124+
}
125+
} else {
126+
if let selectedView = selectedView {
127+
if newValue {
128+
UIView.animate(withDuration: 0.1) {
129+
selectedView.alpha = self.selAlpha
130+
}
131+
} else {
132+
UIView.animate(withDuration: 0.45) {
133+
selectedView.alpha = 0.0
134+
}
135+
}
136+
} else {
137+
// super.setHighlighted(highlighted, animated: animated)
138+
}
139+
}
140+
141+
}
142+
get {
143+
return super.isHighlighted
144+
}
145+
}
146+
147+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
//
2+
// CollectionAdapterCellData.swift
3+
// PatternsSwift
4+
//
5+
// Created by mrustaa on 01/05/2020.
6+
// Copyright © 2020 mrustaa. All rights reserved.
7+
//
8+
9+
import UIKit
10+
11+
open class CollectionAdapterCellData: NSObject {
12+
13+
public var selectCallback: (() -> Void)?
14+
15+
open func size() -> CGSize {
16+
return CGSize.zero
17+
}
18+
19+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
//
2+
// CollectionAdapterItem.swift
3+
// PatternsSwift
4+
//
5+
// Created by mrustaa on 01/05/2020.
6+
// Copyright © 2020 mrustaa. All rights reserved.
7+
//
8+
9+
import UIKit
10+
11+
open class CollectionAdapterItem: NSObject {
12+
13+
public let cellClass: AnyClass
14+
public let cellData: CollectionAdapterCellData?
15+
16+
public var cellReuseIdentifier: String {
17+
return String(describing: cellClass)
18+
}
19+
20+
public init(cellClass: AnyClass, cellData: CollectionAdapterCellData? = nil) {
21+
self.cellClass = cellClass
22+
self.cellData = cellData
23+
}
24+
25+
public func size() -> CGSize {
26+
return cellData?.size() ?? CGSize.zero
27+
}
28+
29+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
//
2+
// CollectionAdapterTypes.swift
3+
// PatternsSwift
4+
//
5+
// Created by mrustaa on 01/05/2020.
6+
// Copyright © 2020 mrustaa. All rights reserved.
7+
//
8+
9+
import UIKit
10+
11+
enum CollectionAdapterToEndTypes {
12+
case top
13+
case bottom
14+
case right
15+
case left
16+
}
17+
18+
public typealias CollectionAdapterCountCallback = () -> Int
19+
public typealias CollectionAdapterCellIndexCallback = (_ index: Int) -> UICollectionViewCell
20+
public typealias CollectionAdapterSizeIndexCallback = (_ index: Int) -> CGSize
21+
public typealias CollectionAdapterSelectIndexCallback = (_ index: Int) -> ()

0 commit comments

Comments
 (0)