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

Swift 4.2 #11

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
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
9 changes: 5 additions & 4 deletions PinterestLayout.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,7 @@
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
English,
en,
Base,
);
Expand Down Expand Up @@ -482,7 +483,7 @@
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 3.0;
SWIFT_VERSION = 4.2;
};
name = Debug;
};
Expand All @@ -503,7 +504,7 @@
PRODUCT_BUNDLE_IDENTIFIER = com.magiclab.PinterestLayout;
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_VERSION = 3.0;
SWIFT_VERSION = 4.2;
};
name = Release;
};
Expand All @@ -518,7 +519,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.magiclab.PinterestLayoutExample;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
SWIFT_VERSION = 4.2;
};
name = Debug;
};
Expand All @@ -533,7 +534,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.magiclab.PinterestLayoutExample;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
SWIFT_VERSION = 4.2;
};
name = Release;
};
Expand Down
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>
2 changes: 1 addition & 1 deletion PinterestLayout/Help.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public extension String {
let rect = NSString(string: self).boundingRect(
with: CGSize(width: width, height: CGFloat(MAXFLOAT)),
options: .usesLineFragmentOrigin,
attributes: [NSFontAttributeName: font],
attributes: [NSAttributedString.Key.font: font],
context: nil
)
return ceil(rect.height)
Expand Down
4 changes: 2 additions & 2 deletions PinterestLayout/PinterestCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ extension PinterestCell {
attribute: .top,
relatedBy: .equal,
toItem: roundedCornersView,
attribute: NSLayoutAttribute.top,
attribute: NSLayoutConstraint.Attribute.top,
multiplier: 1,
constant: 0
)
Expand Down Expand Up @@ -188,7 +188,7 @@ extension PinterestCell {
multiplier: 1,
constant: PinterestCell.annotationPadding
)
bottomConstraint.priority = 750
bottomConstraint.priority = UILayoutPriority(rawValue: 750)
roundedCornersView.addConstraint(bottomConstraint)
}
}
4 changes: 2 additions & 2 deletions PinterestLayout/PinterestLayout.swift
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public class PinterestLayout: UICollectionViewLayout {
size: headerSize
)
let headerAttributes = PinterestLayoutAttributes(
forSupplementaryViewOfKind: UICollectionElementKindSectionHeader,
forSupplementaryViewOfKind: UICollectionView.elementKindSectionHeader,
with: IndexPath(item: 0, section: section)
)
headerAttributes.frame = headerFrame
Expand Down Expand Up @@ -163,7 +163,7 @@ public class PinterestLayout: UICollectionViewLayout {
size: footerSize
)
let footerAttributes = PinterestLayoutAttributes(
forSupplementaryViewOfKind: UICollectionElementKindSectionFooter,
forSupplementaryViewOfKind: UICollectionView.elementKindSectionFooter,
with: IndexPath(item: 0, section: section)
)
footerAttributes.frame = footerFrame
Expand Down
2 changes: 1 addition & 1 deletion PinterestLayoutExample/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ 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.
return true
}
Expand Down