Skip to content

Commit dccbc4e

Browse files
committed
Swift4.2
1 parent 4b079a5 commit dccbc4e

File tree

7 files changed

+47
-39
lines changed

7 files changed

+47
-39
lines changed

StackScrollView-Demo/AppDelegate.swift

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -10,37 +10,37 @@ import UIKit
1010

1111
@UIApplicationMain
1212
class AppDelegate: UIResponder, UIApplicationDelegate {
13-
14-
var window: UIWindow?
15-
16-
17-
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
18-
// Override point for customization after application launch.
19-
return true
20-
}
21-
22-
func applicationWillResignActive(_ application: UIApplication) {
23-
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
24-
// Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game.
25-
}
26-
27-
func applicationDidEnterBackground(_ application: UIApplication) {
28-
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
29-
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
30-
}
31-
32-
func applicationWillEnterForeground(_ application: UIApplication) {
33-
// Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background.
34-
}
35-
36-
func applicationDidBecomeActive(_ application: UIApplication) {
37-
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
38-
}
39-
40-
func applicationWillTerminate(_ application: UIApplication) {
41-
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
42-
}
43-
44-
13+
14+
var window: UIWindow?
15+
16+
17+
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
18+
// Override point for customization after application launch.
19+
return true
20+
}
21+
22+
func applicationWillResignActive(_ application: UIApplication) {
23+
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
24+
// Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game.
25+
}
26+
27+
func applicationDidEnterBackground(_ application: UIApplication) {
28+
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
29+
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
30+
}
31+
32+
func applicationWillEnterForeground(_ application: UIApplication) {
33+
// Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background.
34+
}
35+
36+
func applicationDidBecomeActive(_ application: UIApplication) {
37+
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
38+
}
39+
40+
func applicationWillTerminate(_ application: UIApplication) {
41+
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
42+
}
43+
44+
4545
}
4646

StackScrollView-Demo/MarginStackCell.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@ final class MarginStackCell: StackCellBase {
2121
}
2222

2323
override var intrinsicContentSize: CGSize {
24-
return CGSize(width: UIViewNoIntrinsicMetric, height: height)
24+
return CGSize(width: UIView.noIntrinsicMetric, height: height)
2525
}
2626
}

StackScrollView-Demo/SeparatorStackCell.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ final class SeparatorStackCell: StackCellBase {
1515
private let borderView = UIView()
1616

1717
public override var intrinsicContentSize: CGSize {
18-
return CGSize(width: UIViewNoIntrinsicMetric, height: 1 / UIScreen.main.scale)
18+
return CGSize(width: UIView.noIntrinsicMetric, height: 1 / UIScreen.main.scale)
1919
}
2020

2121
public init(

StackScrollView.xcodeproj/project.pbxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -468,7 +468,7 @@
468468
SDKROOT = iphoneos;
469469
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
470470
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
471-
SWIFT_VERSION = 4.0;
471+
SWIFT_VERSION = 4.2;
472472
TARGETED_DEVICE_FAMILY = "1,2";
473473
VERSIONING_SYSTEM = "apple-generic";
474474
VERSION_INFO_PREFIX = "";
@@ -514,7 +514,7 @@
514514
MTL_ENABLE_DEBUG_INFO = NO;
515515
SDKROOT = iphoneos;
516516
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
517-
SWIFT_VERSION = 4.0;
517+
SWIFT_VERSION = 4.2;
518518
TARGETED_DEVICE_FAMILY = "1,2";
519519
VALIDATE_PRODUCT = YES;
520520
VERSIONING_SYSTEM = "apple-generic";
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
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>IDEDidComputeMac32BitWarning</key>
6+
<true/>
7+
</dict>
8+
</plist>

StackScrollView/StackCellType.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ extension StackCellType where Self : UIView {
4848
stackScrollView?.scroll(to: self, animated: animated)
4949
}
5050

51-
public func scrollToSelf(at position: UICollectionViewScrollPosition, animated: Bool) {
51+
public func scrollToSelf(at position: UICollectionView.ScrollPosition, animated: Bool) {
5252
stackScrollView?.scroll(to: self, at: position, animated: animated)
5353
}
5454

StackScrollView/StackScrollView.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ open class StackScrollView: UICollectionView, UICollectionViewDataSource, UIColl
198198
scrollRectToVisible(targetRect, animated: true)
199199
}
200200

201-
open func scroll(to view: UIView, at position: UICollectionViewScrollPosition, animated: Bool) {
201+
open func scroll(to view: UIView, at position: UICollectionView.ScrollPosition, animated: Bool) {
202202
if let index = views.index(of: view) {
203203
scrollToItem(at: IndexPath(item: index, section: 0), at: position, animated: animated)
204204
}
@@ -281,7 +281,7 @@ open class StackScrollView: UICollectionView, UICollectionViewDataSource, UIColl
281281

282282
width.constant = collectionView.bounds.width
283283

284-
let size = view.superview?.systemLayoutSizeFitting(UILayoutFittingCompressedSize) ?? view.systemLayoutSizeFitting(UILayoutFittingCompressedSize)
284+
let size = view.superview?.systemLayoutSizeFitting(UIView.layoutFittingCompressedSize) ?? view.systemLayoutSizeFitting(UIView.layoutFittingCompressedSize)
285285

286286
assert(size.width == collectionView.bounds.width)
287287
return size

0 commit comments

Comments
 (0)