From 7a53a7af66eaa64a2d6edc17ae74db5dfcbf9133 Mon Sep 17 00:00:00 2001 From: Martin Barreto Date: Thu, 20 Dec 2018 17:06:45 -0300 Subject: [PATCH 1/3] convert example source code to swift 4.2 --- .travis.yml | 4 ++-- Example.xcodeproj/project.pbxproj | 11 +++++++---- Example/Example/AppDelegate.swift | 3 +-- .../TableChildExampleViewController.swift | 4 ++-- .../Example/ReloadExampleViewController.swift | 4 ++-- LICENSE | 2 +- XLPagerTabStrip.podspec | 4 ++-- XLPagerTabStrip.xcodeproj/project.pbxproj | 16 +++++++++++++--- XLPagerTabStrip/Info.plist | 2 +- 9 files changed, 31 insertions(+), 19 deletions(-) diff --git a/.travis.yml b/.travis.yml index 1410babc..39a62ced 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,7 @@ language: objective-c -osx_image: xcode10 +osx_image: xcode10.1 env: - - DESTINATION="OS=12,name=iPhone 8" SCHEME="XLPagerTabStrip" SDK=iphonesimulator + - DESTINATION="OS=12.1,name=iPhone 8" SCHEME="XLPagerTabStrip" SDK=iphonesimulator before_install: - brew update #- brew outdated carthage || brew upgrade carthage diff --git a/Example.xcodeproj/project.pbxproj b/Example.xcodeproj/project.pbxproj index 1a8de222..2731472e 100644 --- a/Example.xcodeproj/project.pbxproj +++ b/Example.xcodeproj/project.pbxproj @@ -98,7 +98,7 @@ 28F828CF1C4B714D00330CF4 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = AppDelegate.swift; path = Example/AppDelegate.swift; sourceTree = ""; }; 28F828DB1C4B714D00330CF4 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = Info.plist; path = Example/Info.plist; sourceTree = ""; }; 28F828E01C4B714D00330CF4 /* ExampleUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ExampleUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; - 28F828E61C4B714D00330CF4 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist; name = Info.plist; path = Example/ExampleUITests/Info.plist; sourceTree = ""; }; + 28F828E61C4B714D00330CF4 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; CB2125DD1C52A80E002DAF42 /* TwitterExampleViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = TwitterExampleViewController.swift; path = Example/TwitterExampleViewController.swift; sourceTree = ""; }; CB3697BE1C5177B4001FC5F8 /* ButtonBarExampleViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = ButtonBarExampleViewController.swift; path = Example/Example/ButtonBarExampleViewController.swift; sourceTree = SOURCE_ROOT; }; CB71C6EA1C4EB964008EC806 /* SegmentedExampleViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = SegmentedExampleViewController.swift; path = Example/SegmentedExampleViewController.swift; sourceTree = ""; }; @@ -232,7 +232,8 @@ 28F828E61C4B714D00330CF4 /* Info.plist */, 287D0A711C4B7877004566D6 /* ExampleUITests.swift */, ); - path = ExampleUITests; + name = ExampleUITests; + path = Example/ExampleUITests; sourceTree = ""; }; CB86ED6C1C4D6ED400DA463B /* Demo */ = { @@ -560,13 +561,14 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; INFOPLIST_FILE = "$(SRCROOT)/Example/Example/Info.plist"; + IPHONEOS_DEPLOYMENT_TARGET = 9.3; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.xmartlabs.Example; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = ""; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_SWIFT3_OBJC_INFERENCE = Default; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 4.2; }; name = Debug; }; @@ -577,12 +579,13 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; INFOPLIST_FILE = "$(SRCROOT)/Example/Example/Info.plist"; + IPHONEOS_DEPLOYMENT_TARGET = 9.3; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.xmartlabs.Example; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = ""; SWIFT_SWIFT3_OBJC_INFERENCE = Default; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 4.2; }; name = Release; }; diff --git a/Example/Example/AppDelegate.swift b/Example/Example/AppDelegate.swift index 2b1cd0b4..57de2d71 100644 --- a/Example/Example/AppDelegate.swift +++ b/Example/Example/AppDelegate.swift @@ -12,11 +12,10 @@ class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? - func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { // Override point for customization after application launch. UITabBar.appearance().tintColor = UIColor.init(red: 0.027, green: 0.725, blue: 0.608, alpha: 1) - UIApplication.shared.statusBarStyle = .lightContent _ = YoutubeExampleViewController(nibName: nil, bundle: nil) diff --git a/Example/Example/ChildControllers/TableChildExampleViewController.swift b/Example/Example/ChildControllers/TableChildExampleViewController.swift index 35ffd392..6abaf5a3 100644 --- a/Example/Example/ChildControllers/TableChildExampleViewController.swift +++ b/Example/Example/ChildControllers/TableChildExampleViewController.swift @@ -31,7 +31,7 @@ class TableChildExampleViewController: UITableViewController, IndicatorInfoProvi var blackTheme = false var itemInfo = IndicatorInfo(title: "View") - init(style: UITableViewStyle, itemInfo: IndicatorInfo) { + init(style: UITableView.Style, itemInfo: IndicatorInfo) { self.itemInfo = itemInfo super.init(style: style) } @@ -44,7 +44,7 @@ class TableChildExampleViewController: UITableViewController, IndicatorInfoProvi super.viewDidLoad() tableView.register(UINib(nibName: "PostCell", bundle: Bundle.main), forCellReuseIdentifier: cellIdentifier) tableView.estimatedRowHeight = 60.0 - tableView.rowHeight = UITableViewAutomaticDimension + tableView.rowHeight = UITableView.automaticDimension tableView.allowsSelection = false if blackTheme { tableView.backgroundColor = UIColor(red: 15/255.0, green: 16/255.0, blue: 16/255.0, alpha: 1.0) diff --git a/Example/Example/ReloadExampleViewController.swift b/Example/Example/ReloadExampleViewController.swift index 51cdfc3c..19357780 100644 --- a/Example/Example/ReloadExampleViewController.swift +++ b/Example/Example/ReloadExampleViewController.swift @@ -49,13 +49,13 @@ class ReloadExampleViewController: UIViewController { bigLabel.sizeToFit() } - if let pagerViewController = childViewControllers.first as? PagerTabStripViewController { + if let pagerViewController = children.first as? PagerTabStripViewController { updateTitle(of: pagerViewController) } } @IBAction func reloadTapped(_ sender: UIBarButtonItem) { - for childViewController in childViewControllers { + for childViewController in children { guard let child = childViewController as? PagerTabStripViewController else { continue } diff --git a/LICENSE b/LICENSE index f4c03b67..fb6581a0 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2017 Xmartlabs SRL +Copyright (c) 2019 Xmartlabs SRL Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/XLPagerTabStrip.podspec b/XLPagerTabStrip.podspec index 8998456a..7b88c311 100644 --- a/XLPagerTabStrip.podspec +++ b/XLPagerTabStrip.podspec @@ -1,13 +1,13 @@ Pod::Spec.new do |s| s.name = "XLPagerTabStrip" - s.version = "8.1.0" + s.version = "8.1.1" s.summary = "Android PagerTabStrip for iOS and much more." s.homepage = "https://github.com/xmartlabs/XLPagerTabStrip" s.license = { type: 'MIT', file: 'LICENSE' } s.author = { "Martin Barreto" => "martin@xmartlabs.com" } s.source = { git: "https://github.com/xmartlabs/XLPagerTabStrip.git", tag: s.version.to_s } s.social_media_url = 'https://twitter.com/xmartlabs' - s.ios.deployment_target = '8.0' + s.ios.deployment_target = '9.3' s.requires_arc = true s.ios.source_files = 'Sources/**/*.{h,m,swift}' s.ios.frameworks = 'UIKit', 'Foundation' diff --git a/XLPagerTabStrip.xcodeproj/project.pbxproj b/XLPagerTabStrip.xcodeproj/project.pbxproj index 7254a01c..197e8170 100644 --- a/XLPagerTabStrip.xcodeproj/project.pbxproj +++ b/XLPagerTabStrip.xcodeproj/project.pbxproj @@ -49,7 +49,7 @@ 28F828801C494B2C00330CF4 /* XLPagerTabStrip.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XLPagerTabStrip.h; sourceTree = ""; }; 28F828821C494B2C00330CF4 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 28F828871C494B2C00330CF4 /* XLPagerTabStripTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = XLPagerTabStripTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; - 28F8288E1C494B2C00330CF4 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist; name = Info.plist; path = Tests/Info.plist; sourceTree = ""; }; + 28F8288E1C494B2C00330CF4 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 28F8289B1C494BF100330CF4 /* Playground.playground */ = {isa = PBXFileReference; lastKnownFileType = file.playground; path = Playground.playground; sourceTree = ""; }; CB0986C31C51391600DF7087 /* ButtonBarPagerTabStripViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ButtonBarPagerTabStripViewController.swift; sourceTree = ""; }; CB0986C51C51395E00DF7087 /* ButtonBarView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ButtonBarView.swift; sourceTree = ""; }; @@ -143,8 +143,7 @@ 28F8288E1C494B2C00330CF4 /* Info.plist */, 287D0A6D1C4B73BD004566D6 /* XLPagerTabStripTests.swift */, ); - name = Tests; - path = XLPagerTabStripTests; + path = Tests; sourceTree = ""; }; 28F828971C494B4200330CF4 /* Sources */ = { @@ -233,6 +232,7 @@ 28F8287C1C494B2C00330CF4 = { CreatedOnToolsVersion = 7.2; LastSwiftMigration = 0900; + ProvisioningStyle = Manual; }; 28F828861C494B2C00330CF4 = { CreatedOnToolsVersion = 7.2; @@ -450,16 +450,21 @@ buildSettings = { BITCODE_GENERATION_MODE = marker; CLANG_ENABLE_MODULES = YES; + CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + CODE_SIGN_STYLE = Manual; DEFINES_MODULE = YES; + DEVELOPMENT_TEAM = ""; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; INFOPLIST_FILE = XLPagerTabStrip/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 9.3; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.xmartlabs.XLPagerTabStrip; PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; SKIP_INSTALL = YES; SWIFT_SWIFT3_OBJC_INFERENCE = Default; SWIFT_VERSION = 4.2; @@ -471,16 +476,21 @@ buildSettings = { BITCODE_GENERATION_MODE = bitcode; CLANG_ENABLE_MODULES = YES; + CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + CODE_SIGN_STYLE = Manual; DEFINES_MODULE = YES; + DEVELOPMENT_TEAM = ""; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; INFOPLIST_FILE = XLPagerTabStrip/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 9.3; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.xmartlabs.XLPagerTabStrip; PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; SKIP_INSTALL = YES; SWIFT_SWIFT3_OBJC_INFERENCE = Default; SWIFT_VERSION = 4.2; diff --git a/XLPagerTabStrip/Info.plist b/XLPagerTabStrip/Info.plist index e4370ca6..b1093fb0 100644 --- a/XLPagerTabStrip/Info.plist +++ b/XLPagerTabStrip/Info.plist @@ -15,7 +15,7 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 8.1.0 + 8.1.1 CFBundleSignature ???? CFBundleVersion From 7338dc0a2e5cbf4f23e620ae605d62c97f268a9d Mon Sep 17 00:00:00 2001 From: Martin Barreto Date: Thu, 20 Dec 2018 18:29:10 -0300 Subject: [PATCH 2/3] remove unused line --- Sources/ButtonBarPagerTabStripViewController.swift | 1 - 1 file changed, 1 deletion(-) diff --git a/Sources/ButtonBarPagerTabStripViewController.swift b/Sources/ButtonBarPagerTabStripViewController.swift index 8cb6786d..34d64b0f 100644 --- a/Sources/ButtonBarPagerTabStripViewController.swift +++ b/Sources/ButtonBarPagerTabStripViewController.swift @@ -324,7 +324,6 @@ open class ButtonBarPagerTabStripViewController: PagerTabStripViewController, Pa let indicatorInfo = childController.indicatorInfo(for: self) cell.label.text = indicatorInfo.title - cell.accessibilityLabel = indicatorInfo.accessibilityLabel cell.label.font = settings.style.buttonBarItemFont cell.label.textColor = settings.style.buttonBarItemTitleColor ?? cell.label.textColor cell.contentView.backgroundColor = settings.style.buttonBarItemBackgroundColor ?? cell.contentView.backgroundColor From 43d42028c42d6b1bf85651e06816f600051e850c Mon Sep 17 00:00:00 2001 From: Martin Barreto Date: Fri, 21 Dec 2018 12:13:05 -0300 Subject: [PATCH 3/3] minor fixes --- .../Example/Base.lproj/Storyboard.storyboard | 59 ++++++++----------- .../TableChildExampleViewController.swift | 2 +- Example/Example/Helpers/PostCell.xib | 22 +++---- Sources/ButtonBarViewCell.swift | 1 + 4 files changed, 37 insertions(+), 47 deletions(-) diff --git a/Example/Example/Base.lproj/Storyboard.storyboard b/Example/Example/Base.lproj/Storyboard.storyboard index 94e103bd..d91e9050 100644 --- a/Example/Example/Base.lproj/Storyboard.storyboard +++ b/Example/Example/Base.lproj/Storyboard.storyboard @@ -1,13 +1,11 @@ - + - - - + @@ -84,7 +82,7 @@ - + + - - + - + - - - + + + + + - - + - - - - - - - - - - - - @@ -146,7 +133,7 @@ - + @@ -437,7 +424,7 @@ - + @@ -886,7 +873,7 @@ - + @@ -990,7 +977,7 @@ - + diff --git a/Example/Example/ChildControllers/TableChildExampleViewController.swift b/Example/Example/ChildControllers/TableChildExampleViewController.swift index 6abaf5a3..b0395bc1 100644 --- a/Example/Example/ChildControllers/TableChildExampleViewController.swift +++ b/Example/Example/ChildControllers/TableChildExampleViewController.swift @@ -43,7 +43,7 @@ class TableChildExampleViewController: UITableViewController, IndicatorInfoProvi override func viewDidLoad() { super.viewDidLoad() tableView.register(UINib(nibName: "PostCell", bundle: Bundle.main), forCellReuseIdentifier: cellIdentifier) - tableView.estimatedRowHeight = 60.0 + tableView.estimatedRowHeight = 600.0 tableView.rowHeight = UITableView.automaticDimension tableView.allowsSelection = false if blackTheme { diff --git a/Example/Example/Helpers/PostCell.xib b/Example/Example/Helpers/PostCell.xib index 5234c22f..a2eba45c 100644 --- a/Example/Example/Helpers/PostCell.xib +++ b/Example/Example/Helpers/PostCell.xib @@ -1,11 +1,11 @@ - + - + @@ -25,14 +25,17 @@ -