Skip to content
This repository was archived by the owner on May 8, 2025. It is now read-only.

Commit 5829eaa

Browse files
author
Oscar Apeland
committed
Added correctly named files
1 parent 5d056f4 commit 5829eaa

19 files changed

+1313
-0
lines changed

SwipeableViewController.podspec

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
Pod::Spec.new do |s|
2+
s.name = 'SwipeableViewController'
3+
s.version = '0.1.0'
4+
s.summary = 'A small UI component to build UIPageViewController-y views in your app.'
5+
6+
s.description = <<-DESC
7+
A segmented header and a UIPageViewController all in one convenient package.
8+
DESC
9+
10+
s.homepage = 'https://github.com/tiseoslo/SwipeableViewController'
11+
s.license = { :type => 'MIT', :file => 'LICENSE' }
12+
s.author = { 'Oscar Apeland' => '[email protected]' }
13+
s.source = { :git => 'https://github.com/tiseoslo/SwipeableViewController.git', :tag => s.version.to_s }
14+
15+
s.ios.deployment_target = '10.0'
16+
s.source_files = 'SwipeableViewController/Source/*.swift'
17+
18+
end

SwipeableViewController.xcodeproj/project.pbxproj

+363
Large diffs are not rendered by default.

SwipeableViewController.xcodeproj/project.xcworkspace/contents.xcworkspacedata

+7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<Bucket
3+
type = "1"
4+
version = "2.0">
5+
<Breakpoints>
6+
<BreakpointProxy
7+
BreakpointExtensionID = "Xcode.Breakpoint.SwiftErrorBreakpoint">
8+
<BreakpointContent
9+
shouldBeEnabled = "Yes"
10+
ignoreCount = "0"
11+
continueAfterRunningActions = "No">
12+
</BreakpointContent>
13+
</BreakpointProxy>
14+
<BreakpointProxy
15+
BreakpointExtensionID = "Xcode.Breakpoint.ExceptionBreakpoint">
16+
<BreakpointContent
17+
shouldBeEnabled = "Yes"
18+
ignoreCount = "0"
19+
continueAfterRunningActions = "No"
20+
scope = "0"
21+
stopOnStyle = "0">
22+
</BreakpointContent>
23+
</BreakpointProxy>
24+
</Breakpoints>
25+
</Bucket>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>SchemeUserState</key>
6+
<dict>
7+
<key>SwipingViewController.xcscheme</key>
8+
<dict>
9+
<key>orderHint</key>
10+
<integer>0</integer>
11+
</dict>
12+
</dict>
13+
</dict>
14+
</plist>
+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
2+
//
3+
// AppDelegate.swift
4+
// SwipingViewController
5+
//
6+
// Created by Oscar Apeland on 11.10.2017.
7+
// Copyright © 2017 Tise. All rights reserved.
8+
//
9+
10+
import UIKit
11+
12+
@UIApplicationMain
13+
class AppDelegate: UIResponder, UIApplicationDelegate {
14+
var window: UIWindow?
15+
16+
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
17+
window = UIWindow(frame: UIScreen.main.bounds)
18+
19+
let navigationController = SwipeableNavigationController(navigationBarClass: SwipeableNavigationBar.self, toolbarClass: nil)
20+
let viewController = ExampleSwipeableViewController()
21+
viewController.swipeableItems = [SwipeableItem(title: "Recent", viewController: ExampleViewController()),
22+
SwipeableItem(title: "Explore", viewController: ExampleViewController()),
23+
SwipeableItem(title: "Browse", viewController: ExampleViewController())]
24+
viewController.selectedIndex = 1
25+
navigationController.setViewControllers([viewController], animated: false)
26+
27+
window?.rootViewController = navigationController
28+
window?.makeKeyAndVisible()
29+
30+
return true
31+
}
32+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
{
2+
"images" : [
3+
{
4+
"idiom" : "iphone",
5+
"size" : "20x20",
6+
"scale" : "2x"
7+
},
8+
{
9+
"idiom" : "iphone",
10+
"size" : "20x20",
11+
"scale" : "3x"
12+
},
13+
{
14+
"idiom" : "iphone",
15+
"size" : "29x29",
16+
"scale" : "2x"
17+
},
18+
{
19+
"idiom" : "iphone",
20+
"size" : "29x29",
21+
"scale" : "3x"
22+
},
23+
{
24+
"idiom" : "iphone",
25+
"size" : "40x40",
26+
"scale" : "2x"
27+
},
28+
{
29+
"idiom" : "iphone",
30+
"size" : "40x40",
31+
"scale" : "3x"
32+
},
33+
{
34+
"idiom" : "iphone",
35+
"size" : "60x60",
36+
"scale" : "2x"
37+
},
38+
{
39+
"idiom" : "iphone",
40+
"size" : "60x60",
41+
"scale" : "3x"
42+
},
43+
{
44+
"idiom" : "ipad",
45+
"size" : "20x20",
46+
"scale" : "1x"
47+
},
48+
{
49+
"idiom" : "ipad",
50+
"size" : "20x20",
51+
"scale" : "2x"
52+
},
53+
{
54+
"idiom" : "ipad",
55+
"size" : "29x29",
56+
"scale" : "1x"
57+
},
58+
{
59+
"idiom" : "ipad",
60+
"size" : "29x29",
61+
"scale" : "2x"
62+
},
63+
{
64+
"idiom" : "ipad",
65+
"size" : "40x40",
66+
"scale" : "1x"
67+
},
68+
{
69+
"idiom" : "ipad",
70+
"size" : "40x40",
71+
"scale" : "2x"
72+
},
73+
{
74+
"idiom" : "ipad",
75+
"size" : "76x76",
76+
"scale" : "1x"
77+
},
78+
{
79+
"idiom" : "ipad",
80+
"size" : "76x76",
81+
"scale" : "2x"
82+
},
83+
{
84+
"idiom" : "ipad",
85+
"size" : "83.5x83.5",
86+
"scale" : "2x"
87+
},
88+
{
89+
"idiom" : "ios-marketing",
90+
"size" : "1024x1024",
91+
"scale" : "1x"
92+
}
93+
],
94+
"info" : {
95+
"version" : 1,
96+
"author" : "xcode"
97+
}
98+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2+
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13122.16" systemVersion="17A277" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
3+
<dependencies>
4+
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13104.12"/>
5+
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
6+
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
7+
</dependencies>
8+
<scenes>
9+
<!--View Controller-->
10+
<scene sceneID="EHf-IW-A2E">
11+
<objects>
12+
<viewController id="01J-lp-oVM" sceneMemberID="viewController">
13+
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
14+
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
15+
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
16+
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
17+
<viewLayoutGuide key="safeArea" id="6Tk-OE-BBY"/>
18+
</view>
19+
</viewController>
20+
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
21+
</objects>
22+
<point key="canvasLocation" x="53" y="375"/>
23+
</scene>
24+
</scenes>
25+
</document>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
//
2+
// ExampleSwipeableViewController.swift
3+
// SwipingViewController
4+
//
5+
// Created by Oscar Apeland on 13.10.2017.
6+
// Copyright © 2017 Tise. All rights reserved.
7+
//
8+
9+
import UIKit
10+
11+
class ExampleSwipeableViewController: SwipeableViewController {
12+
lazy var searchController = UISearchController(searchResultsController: {
13+
$0.view.backgroundColor = .red
14+
return $0
15+
}(UIViewController()))
16+
17+
override func viewDidLoad() {
18+
super.viewDidLoad()
19+
if #available(iOS 11.0, *) {
20+
navigationItem.searchController = searchController
21+
} else {
22+
navigationItem.titleView = searchController.searchBar
23+
}
24+
definesPresentationContext = true
25+
}
26+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
//
2+
// ExampleViewController.swift
3+
// SwipingViewController
4+
//
5+
// Created by Oscar Apeland on 12.10.2017.
6+
// Copyright © 2017 Tise. All rights reserved.
7+
//
8+
9+
import UIKit
10+
11+
class ExampleViewController: UIViewController {
12+
lazy var collectionView: UICollectionView = {
13+
$0.backgroundColor = .white
14+
$0.alwaysBounceVertical = true
15+
$0.delegate = self
16+
$0.dataSource = self
17+
$0.autoresizingMask = [.flexibleHeight, .flexibleWidth]
18+
($0.collectionViewLayout as? UICollectionViewFlowLayout)?.sectionInset = UIEdgeInsets(top: 20, left: 0, bottom: 0, right: 0)
19+
20+
return $0
21+
}(UICollectionView(frame: view.bounds, collectionViewLayout: UICollectionViewFlowLayout()))
22+
23+
let cellColor = UIColor.random
24+
25+
override func viewDidLoad() {
26+
super.viewDidLoad()
27+
view.addSubview(collectionView)
28+
if #available(iOS 11.0, *) {
29+
collectionView.contentInsetAdjustmentBehavior = .always
30+
}
31+
}
32+
}
33+
34+
extension ExampleViewController: UICollectionViewDataSource, UICollectionViewDelegate {
35+
func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
36+
return 100
37+
}
38+
39+
func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
40+
collectionView.register(UICollectionViewCell.self, forCellWithReuseIdentifier: "cell")
41+
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "cell", for: indexPath)
42+
cell.backgroundColor = cellColor
43+
44+
return cell
45+
}
46+
47+
func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
48+
let vc = UICollectionViewController(collectionViewLayout: UICollectionViewFlowLayout())
49+
50+
vc.collectionView?.backgroundColor = .white
51+
vc.collectionView?.dataSource = self
52+
vc.collectionView?.delegate = self
53+
54+
navigationController?.pushViewController(vc, animated: true)
55+
}
56+
}
57+
58+
extension UIColor {
59+
class var random: UIColor {
60+
func random() -> CGFloat {
61+
return CGFloat(arc4random()) / CGFloat(UInt32.max)
62+
}
63+
64+
return UIColor(red: random(), green: random(), blue: random(), alpha: 1.0)
65+
}
66+
}

SwipeableViewController/Info.plist

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>CFBundleDevelopmentRegion</key>
6+
<string>$(DEVELOPMENT_LANGUAGE)</string>
7+
<key>CFBundleExecutable</key>
8+
<string>$(EXECUTABLE_NAME)</string>
9+
<key>CFBundleIdentifier</key>
10+
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
11+
<key>CFBundleInfoDictionaryVersion</key>
12+
<string>6.0</string>
13+
<key>CFBundleName</key>
14+
<string>$(PRODUCT_NAME)</string>
15+
<key>CFBundlePackageType</key>
16+
<string>APPL</string>
17+
<key>CFBundleShortVersionString</key>
18+
<string>1.0</string>
19+
<key>CFBundleVersion</key>
20+
<string>1</string>
21+
<key>LSRequiresIPhoneOS</key>
22+
<true/>
23+
<key>UILaunchStoryboardName</key>
24+
<string>LaunchScreen</string>
25+
<key>UIRequiredDeviceCapabilities</key>
26+
<array>
27+
<string>armv7</string>
28+
</array>
29+
<key>UISupportedInterfaceOrientations</key>
30+
<array>
31+
<string>UIInterfaceOrientationPortrait</string>
32+
<string>UIInterfaceOrientationLandscapeLeft</string>
33+
<string>UIInterfaceOrientationLandscapeRight</string>
34+
</array>
35+
<key>UISupportedInterfaceOrientations~ipad</key>
36+
<array>
37+
<string>UIInterfaceOrientationPortrait</string>
38+
<string>UIInterfaceOrientationPortraitUpsideDown</string>
39+
<string>UIInterfaceOrientationLandscapeLeft</string>
40+
<string>UIInterfaceOrientationLandscapeRight</string>
41+
</array>
42+
</dict>
43+
</plist>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
//
2+
// SwiperCell.swift
3+
// SwiperNavigationBar
4+
//
5+
// Created by Oscar Apeland on 11.10.2017.
6+
// Copyright © 2017 Tise. All rights reserved.
7+
//
8+
9+
import UIKit
10+
11+
class SwipeableCell: UICollectionViewCell {
12+
static let id = "SwipeableCell"
13+
14+
@IBOutlet weak var label: UILabel!
15+
}

0 commit comments

Comments
 (0)