Skip to content

Commit 7a53a7a

Browse files
author
Martin Barreto
committed
convert example source code to swift 4.2
1 parent a097688 commit 7a53a7a

File tree

9 files changed

+31
-19
lines changed

9 files changed

+31
-19
lines changed

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
language: objective-c
2-
osx_image: xcode10
2+
osx_image: xcode10.1
33
env:
4-
- DESTINATION="OS=12,name=iPhone 8" SCHEME="XLPagerTabStrip" SDK=iphonesimulator
4+
- DESTINATION="OS=12.1,name=iPhone 8" SCHEME="XLPagerTabStrip" SDK=iphonesimulator
55
before_install:
66
- brew update
77
#- brew outdated carthage || brew upgrade carthage

Example.xcodeproj/project.pbxproj

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@
9898
28F828CF1C4B714D00330CF4 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = AppDelegate.swift; path = Example/AppDelegate.swift; sourceTree = "<group>"; };
9999
28F828DB1C4B714D00330CF4 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = Info.plist; path = Example/Info.plist; sourceTree = "<group>"; };
100100
28F828E01C4B714D00330CF4 /* ExampleUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ExampleUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
101-
28F828E61C4B714D00330CF4 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist; name = Info.plist; path = Example/ExampleUITests/Info.plist; sourceTree = "<group>"; };
101+
28F828E61C4B714D00330CF4 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
102102
CB2125DD1C52A80E002DAF42 /* TwitterExampleViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = TwitterExampleViewController.swift; path = Example/TwitterExampleViewController.swift; sourceTree = "<group>"; };
103103
CB3697BE1C5177B4001FC5F8 /* ButtonBarExampleViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = ButtonBarExampleViewController.swift; path = Example/Example/ButtonBarExampleViewController.swift; sourceTree = SOURCE_ROOT; };
104104
CB71C6EA1C4EB964008EC806 /* SegmentedExampleViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = SegmentedExampleViewController.swift; path = Example/SegmentedExampleViewController.swift; sourceTree = "<group>"; };
@@ -232,7 +232,8 @@
232232
28F828E61C4B714D00330CF4 /* Info.plist */,
233233
287D0A711C4B7877004566D6 /* ExampleUITests.swift */,
234234
);
235-
path = ExampleUITests;
235+
name = ExampleUITests;
236+
path = Example/ExampleUITests;
236237
sourceTree = "<group>";
237238
};
238239
CB86ED6C1C4D6ED400DA463B /* Demo */ = {
@@ -560,13 +561,14 @@
560561
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
561562
CLANG_ENABLE_MODULES = YES;
562563
INFOPLIST_FILE = "$(SRCROOT)/Example/Example/Info.plist";
564+
IPHONEOS_DEPLOYMENT_TARGET = 9.3;
563565
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
564566
PRODUCT_BUNDLE_IDENTIFIER = com.xmartlabs.Example;
565567
PRODUCT_NAME = "$(TARGET_NAME)";
566568
SWIFT_OBJC_BRIDGING_HEADER = "";
567569
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
568570
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
569-
SWIFT_VERSION = 4.0;
571+
SWIFT_VERSION = 4.2;
570572
};
571573
name = Debug;
572574
};
@@ -577,12 +579,13 @@
577579
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
578580
CLANG_ENABLE_MODULES = YES;
579581
INFOPLIST_FILE = "$(SRCROOT)/Example/Example/Info.plist";
582+
IPHONEOS_DEPLOYMENT_TARGET = 9.3;
580583
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
581584
PRODUCT_BUNDLE_IDENTIFIER = com.xmartlabs.Example;
582585
PRODUCT_NAME = "$(TARGET_NAME)";
583586
SWIFT_OBJC_BRIDGING_HEADER = "";
584587
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
585-
SWIFT_VERSION = 4.0;
588+
SWIFT_VERSION = 4.2;
586589
};
587590
name = Release;
588591
};

Example/Example/AppDelegate.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,10 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
1212

1313
var window: UIWindow?
1414

15-
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
15+
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
1616
// Override point for customization after application launch.
1717

1818
UITabBar.appearance().tintColor = UIColor.init(red: 0.027, green: 0.725, blue: 0.608, alpha: 1)
19-
UIApplication.shared.statusBarStyle = .lightContent
2019

2120
_ = YoutubeExampleViewController(nibName: nil, bundle: nil)
2221

Example/Example/ChildControllers/TableChildExampleViewController.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class TableChildExampleViewController: UITableViewController, IndicatorInfoProvi
3131
var blackTheme = false
3232
var itemInfo = IndicatorInfo(title: "View")
3333

34-
init(style: UITableViewStyle, itemInfo: IndicatorInfo) {
34+
init(style: UITableView.Style, itemInfo: IndicatorInfo) {
3535
self.itemInfo = itemInfo
3636
super.init(style: style)
3737
}
@@ -44,7 +44,7 @@ class TableChildExampleViewController: UITableViewController, IndicatorInfoProvi
4444
super.viewDidLoad()
4545
tableView.register(UINib(nibName: "PostCell", bundle: Bundle.main), forCellReuseIdentifier: cellIdentifier)
4646
tableView.estimatedRowHeight = 60.0
47-
tableView.rowHeight = UITableViewAutomaticDimension
47+
tableView.rowHeight = UITableView.automaticDimension
4848
tableView.allowsSelection = false
4949
if blackTheme {
5050
tableView.backgroundColor = UIColor(red: 15/255.0, green: 16/255.0, blue: 16/255.0, alpha: 1.0)

Example/Example/ReloadExampleViewController.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,13 @@ class ReloadExampleViewController: UIViewController {
4949
bigLabel.sizeToFit()
5050
}
5151

52-
if let pagerViewController = childViewControllers.first as? PagerTabStripViewController {
52+
if let pagerViewController = children.first as? PagerTabStripViewController {
5353
updateTitle(of: pagerViewController)
5454
}
5555
}
5656

5757
@IBAction func reloadTapped(_ sender: UIBarButtonItem) {
58-
for childViewController in childViewControllers {
58+
for childViewController in children {
5959
guard let child = childViewController as? PagerTabStripViewController else {
6060
continue
6161
}

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2017 Xmartlabs SRL
3+
Copyright (c) 2019 Xmartlabs SRL
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

XLPagerTabStrip.podspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
Pod::Spec.new do |s|
22
s.name = "XLPagerTabStrip"
3-
s.version = "8.1.0"
3+
s.version = "8.1.1"
44
s.summary = "Android PagerTabStrip for iOS and much more."
55
s.homepage = "https://github.com/xmartlabs/XLPagerTabStrip"
66
s.license = { type: 'MIT', file: 'LICENSE' }
77
s.author = { "Martin Barreto" => "[email protected]" }
88
s.source = { git: "https://github.com/xmartlabs/XLPagerTabStrip.git", tag: s.version.to_s }
99
s.social_media_url = 'https://twitter.com/xmartlabs'
10-
s.ios.deployment_target = '8.0'
10+
s.ios.deployment_target = '9.3'
1111
s.requires_arc = true
1212
s.ios.source_files = 'Sources/**/*.{h,m,swift}'
1313
s.ios.frameworks = 'UIKit', 'Foundation'

XLPagerTabStrip.xcodeproj/project.pbxproj

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
28F828801C494B2C00330CF4 /* XLPagerTabStrip.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XLPagerTabStrip.h; sourceTree = "<group>"; };
5050
28F828821C494B2C00330CF4 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
5151
28F828871C494B2C00330CF4 /* XLPagerTabStripTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = XLPagerTabStripTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
52-
28F8288E1C494B2C00330CF4 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist; name = Info.plist; path = Tests/Info.plist; sourceTree = "<group>"; };
52+
28F8288E1C494B2C00330CF4 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
5353
28F8289B1C494BF100330CF4 /* Playground.playground */ = {isa = PBXFileReference; lastKnownFileType = file.playground; path = Playground.playground; sourceTree = "<group>"; };
5454
CB0986C31C51391600DF7087 /* ButtonBarPagerTabStripViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ButtonBarPagerTabStripViewController.swift; sourceTree = "<group>"; };
5555
CB0986C51C51395E00DF7087 /* ButtonBarView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ButtonBarView.swift; sourceTree = "<group>"; };
@@ -143,8 +143,7 @@
143143
28F8288E1C494B2C00330CF4 /* Info.plist */,
144144
287D0A6D1C4B73BD004566D6 /* XLPagerTabStripTests.swift */,
145145
);
146-
name = Tests;
147-
path = XLPagerTabStripTests;
146+
path = Tests;
148147
sourceTree = "<group>";
149148
};
150149
28F828971C494B4200330CF4 /* Sources */ = {
@@ -233,6 +232,7 @@
233232
28F8287C1C494B2C00330CF4 = {
234233
CreatedOnToolsVersion = 7.2;
235234
LastSwiftMigration = 0900;
235+
ProvisioningStyle = Manual;
236236
};
237237
28F828861C494B2C00330CF4 = {
238238
CreatedOnToolsVersion = 7.2;
@@ -450,16 +450,21 @@
450450
buildSettings = {
451451
BITCODE_GENERATION_MODE = marker;
452452
CLANG_ENABLE_MODULES = YES;
453+
CODE_SIGN_IDENTITY = "iPhone Developer";
453454
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
455+
CODE_SIGN_STYLE = Manual;
454456
DEFINES_MODULE = YES;
457+
DEVELOPMENT_TEAM = "";
455458
DYLIB_COMPATIBILITY_VERSION = 1;
456459
DYLIB_CURRENT_VERSION = 1;
457460
DYLIB_INSTALL_NAME_BASE = "@rpath";
458461
INFOPLIST_FILE = XLPagerTabStrip/Info.plist;
459462
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
463+
IPHONEOS_DEPLOYMENT_TARGET = 9.3;
460464
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
461465
PRODUCT_BUNDLE_IDENTIFIER = com.xmartlabs.XLPagerTabStrip;
462466
PRODUCT_NAME = "$(TARGET_NAME)";
467+
PROVISIONING_PROFILE_SPECIFIER = "";
463468
SKIP_INSTALL = YES;
464469
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
465470
SWIFT_VERSION = 4.2;
@@ -471,16 +476,21 @@
471476
buildSettings = {
472477
BITCODE_GENERATION_MODE = bitcode;
473478
CLANG_ENABLE_MODULES = YES;
479+
CODE_SIGN_IDENTITY = "iPhone Developer";
474480
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
481+
CODE_SIGN_STYLE = Manual;
475482
DEFINES_MODULE = YES;
483+
DEVELOPMENT_TEAM = "";
476484
DYLIB_COMPATIBILITY_VERSION = 1;
477485
DYLIB_CURRENT_VERSION = 1;
478486
DYLIB_INSTALL_NAME_BASE = "@rpath";
479487
INFOPLIST_FILE = XLPagerTabStrip/Info.plist;
480488
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
489+
IPHONEOS_DEPLOYMENT_TARGET = 9.3;
481490
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
482491
PRODUCT_BUNDLE_IDENTIFIER = com.xmartlabs.XLPagerTabStrip;
483492
PRODUCT_NAME = "$(TARGET_NAME)";
493+
PROVISIONING_PROFILE_SPECIFIER = "";
484494
SKIP_INSTALL = YES;
485495
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
486496
SWIFT_VERSION = 4.2;

XLPagerTabStrip/Info.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<key>CFBundlePackageType</key>
1616
<string>FMWK</string>
1717
<key>CFBundleShortVersionString</key>
18-
<string>8.1.0</string>
18+
<string>8.1.1</string>
1919
<key>CFBundleSignature</key>
2020
<string>????</string>
2121
<key>CFBundleVersion</key>

0 commit comments

Comments
 (0)