Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update for Swift 5.0 & Adding iphone x support for notch #14

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Update for Swift 5.0 version
Rico237 committed Jun 23, 2019
commit 5f6099e322612afe4356a83040506b35f17e50ec
2 changes: 1 addition & 1 deletion .swift-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.0
5.0
2 changes: 1 addition & 1 deletion SwiftMultiSelect/CustomTableCell.swift
Original file line number Diff line number Diff line change
@@ -86,7 +86,7 @@ class CustomTableCell: UITableViewCell
/// - Parameters:
/// - style: style for cell
/// - reuseIdentifier: string for reuse
override init(style: UITableViewCellStyle, reuseIdentifier: String!)
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String!)
{
//First Call Super
super.init(style: style, reuseIdentifier: reuseIdentifier)
2 changes: 1 addition & 1 deletion SwiftMultiSelect/MultiSelectionCollectionView.swift
Original file line number Diff line number Diff line change
@@ -137,7 +137,7 @@ extension MultiSelecetionViewController:UICollectionViewDelegate,UICollectionVie
if remove {

//For remove from collection view and create IndexPath, i need the index posistion in the array
let id = selectedItems.index { (itm) -> Bool in
let id = selectedItems.firstIndex { (itm) -> Bool in
itm.row == idp
}

12 changes: 6 additions & 6 deletions SwiftMultiSelect/MultiSelectionTableView.swift
Original file line number Diff line number Diff line change
@@ -109,13 +109,13 @@ extension MultiSelecetionViewController:UITableViewDelegate,UITableViewDataSourc


//Set initial state
if let itm_pre = self.selectedItems.index(where: { (itm) -> Bool in
if let itm_pre = self.selectedItems.firstIndex(where: { (itm) -> Bool in
itm == item
}){
self.selectedItems[itm_pre].color = cell.initials.backgroundColor!
cell.accessoryType = UITableViewCellAccessoryType.checkmark
cell.accessoryType = UITableViewCell.AccessoryType.checkmark
}else{
cell.accessoryType = UITableViewCellAccessoryType.none
cell.accessoryType = UITableViewCell.AccessoryType.none
}


@@ -169,11 +169,11 @@ extension MultiSelecetionViewController:UITableViewDelegate,UITableViewDataSourc
item.color = cell.initials.backgroundColor!

//Check if cell is already selected or not
if cell.accessoryType == UITableViewCellAccessoryType.checkmark
if cell.accessoryType == UITableViewCell.AccessoryType.checkmark
{

//Set accessory type
cell.accessoryType = UITableViewCellAccessoryType.none
cell.accessoryType = UITableViewCell.AccessoryType.none

//Comunicate deselection to delegate
SwiftMultiSelect.delegate?.swiftMultiSelect(didUnselectItem: item)
@@ -185,7 +185,7 @@ extension MultiSelecetionViewController:UITableViewDelegate,UITableViewDataSourc
else{

//Set accessory type
cell.accessoryType = UITableViewCellAccessoryType.checkmark
cell.accessoryType = UITableViewCell.AccessoryType.checkmark

//Add current item to selected
selectedItems.append(item)
6 changes: 3 additions & 3 deletions SwiftMultiSelect/MultiSelectionViewController.swift
Original file line number Diff line number Diff line change
@@ -40,7 +40,7 @@ class MultiSelecetionViewController: UIViewController,UIGestureRecognizerDelegat
//Build layout
let layout = UICollectionViewFlowLayout()
layout.sectionInset = UIEdgeInsets(top: 0, left: 0, bottom: 0, right: 0)
layout.scrollDirection = UICollectionViewScrollDirection.horizontal
layout.scrollDirection = UICollectionView.ScrollDirection.horizontal
layout.minimumInteritemSpacing = 0
layout.minimumLineSpacing = 0

@@ -149,14 +149,14 @@ class MultiSelecetionViewController: UIViewController,UIGestureRecognizerDelegat
//constraint for stackview
let stackView_H = NSLayoutConstraint.constraints(
withVisualFormat: "H:|-0-[stackView]-0-|",
options: NSLayoutFormatOptions(rawValue: 0),
options: NSLayoutConstraint.FormatOptions(rawValue: 0),
metrics: nil,
views: viewsDictionary
)
//constraint for stackview
let stackView_V = NSLayoutConstraint.constraints(
withVisualFormat: "V:|-\(navBarHeight)-[stackView]-0-|",
options: NSLayoutFormatOptions(rawValue:0),
options: NSLayoutConstraint.FormatOptions(rawValue:0),
metrics: nil,
views: viewsDictionary
)
48 changes: 34 additions & 14 deletions SwiftMultiSelectExample/Pods/Pods.xcodeproj/project.pbxproj

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -118,19 +118,18 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0830;
LastUpgradeCheck = 0830;
LastUpgradeCheck = 1020;
ORGANIZATIONNAME = "Luca Becchetti";
TargetAttributes = {
B1C3BCC71F2B2B2600904FA3 = {
CreatedOnToolsVersion = 8.3.2;
DevelopmentTeam = 3NJYMZCH8Y;
ProvisioningStyle = Automatic;
};
};
};
buildConfigurationList = B1C3BCC31F2B2B2600904FA3 /* Build configuration list for PBXProject "SwiftMultiSelectExample" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
en,
@@ -243,21 +242,30 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
@@ -286,29 +294,38 @@
SDKROOT = iphoneos;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 5.0;
};
name = Debug;
};
B1C3BCD91F2B2B2600904FA3 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
@@ -329,7 +346,7 @@
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 5.0;
VALIDATE_PRODUCT = YES;
};
name = Release;
@@ -339,13 +356,13 @@
baseConfigurationReference = A8F4428936230C1B080F6F03 /* Pods-SwiftMultiSelectExample.debug.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
DEVELOPMENT_TEAM = 3NJYMZCH8Y;
DEVELOPMENT_TEAM = "";
INFOPLIST_FILE = SwiftMultiSelectExample/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = it.brokenice.SwiftMultiSelectExample;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 5.0;
};
name = Debug;
};
@@ -354,13 +371,13 @@
baseConfigurationReference = 82EE9FC18253E00CEA25297C /* Pods-SwiftMultiSelectExample.release.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
DEVELOPMENT_TEAM = 3NJYMZCH8Y;
DEVELOPMENT_TEAM = "";
INFOPLIST_FILE = SwiftMultiSelectExample/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = it.brokenice.SwiftMultiSelectExample;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 5.0;
};
name = Release;
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>SchemeUserState</key>
<dict>
<key>SwiftMultiSelectExample.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>0</integer>
</dict>
</dict>
</dict>
</plist>
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
Original file line number Diff line number Diff line change
@@ -14,7 +14,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?


func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
internal func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
return true
}
Original file line number Diff line number Diff line change
@@ -92,6 +92,11 @@
"idiom" : "ipad",
"size" : "83.5x83.5",
"scale" : "2x"
},
{
"idiom" : "ios-marketing",
"size" : "1024x1024",
"scale" : "1x"
}
],
"info" : {