Skip to content

Commit e0d1173

Browse files
authored
Swift4 (#5)
* Compatible Xcode9-beta.1 Swift4 * Bit change * 🌲 Update * Remove deprecated * Swift4 Settings
1 parent 6bc7a6b commit e0d1173

File tree

9 files changed

+23
-22
lines changed

9 files changed

+23
-22
lines changed

.swift-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.0
1+
4

StackScrollView-Demo/ButtonStackCell.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import EasyPeasy
1212

1313
final class ButtonStackCell: StackCellBase {
1414

15-
var tapped: () -> Void = { _ in }
15+
var tapped: () -> Void = {}
1616

1717
private let button = UIButton(type: .system)
1818

StackScrollView-Demo/DatePickerStackCell.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ final class DatePickerStackCell: TapStackCell {
3131

3232
pickerContainerView.clipsToBounds = true
3333

34-
pickerView.setContentHuggingPriority(100, for: .horizontal)
34+
pickerView.setContentHuggingPriority(.init(100), for: .horizontal)
3535

3636
pickerContainerView.addSubview(pickerView)
3737

StackScrollView-Demo/LabelStackCell.swift

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,18 @@ final class LabelStackCell: StackCellBase {
2020
super.init()
2121

2222
addSubview(label)
23-
label.translatesAutoresizingMaskIntoConstraints = false
23+
24+
label <- [
25+
Top(>=8),
26+
Left(8),
27+
Right(8),
28+
Bottom(<=8),
29+
CenterY(),
30+
]
2431

25-
label.topAnchor.constraint(greaterThanOrEqualTo: topAnchor, constant: 8).isActive = true
26-
label.bottomAnchor.constraint(lessThanOrEqualTo: bottomAnchor, constant: 8).isActive = true
27-
label.rightAnchor.constraint(equalTo: rightAnchor, constant: 8).isActive = true
28-
label.leftAnchor.constraint(equalTo: leftAnchor, constant: 8).isActive = true
29-
label.centerYAnchor.constraint(equalTo: centerYAnchor).isActive = true
30-
heightAnchor.constraint(greaterThanOrEqualToConstant: 40).isActive = true
32+
self <- [
33+
Height(>=40),
34+
]
3135

3236
label.font = UIFont.preferredFont(forTextStyle: .body)
3337
label.text = title

StackScrollView-Demo/NibStackCell.xib

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="12120" systemVersion="16E195" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
2+
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="13122.17" systemVersion="16F73" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
33
<device id="retina4_7" orientation="portrait">
44
<adaptation id="fullscreen"/>
55
</device>
66
<dependencies>
7-
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="12088"/>
7+
<deployment identifier="iOS"/>
8+
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13104.14"/>
89
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
910
</dependencies>
1011
<objects>
@@ -32,7 +33,7 @@
3233
<connections>
3334
<outlet property="slider" destination="Oxa-dM-rc7" id="yCB-2c-yPU"/>
3435
</connections>
35-
<point key="canvasLocation" x="32" y="153"/>
36+
<point key="canvasLocation" x="-121" y="108"/>
3637
</view>
3738
</objects>
3839
</document>

StackScrollView-Demo/ViewController.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import EasyPeasy
1313

1414
class ViewController: UIViewController {
1515

16-
private var stackScrollView = StackScrollView()
16+
private let stackScrollView = StackScrollView()
1717

1818
override func viewDidLoad() {
1919
super.viewDidLoad()

StackScrollView.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = 'StackScrollView'
3-
s.version = '1.0.0'
3+
s.version = '1.1.0'
44
s.summary = 'Scalable form builder with UICollectionView'
55
s.homepage = 'https://github.com/muukii/StackScrollView'
66
s.license = { :type => 'MIT', :file => 'LICENSE' }

StackScrollView.xcodeproj/project.pbxproj

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -468,6 +468,7 @@
468468
SDKROOT = iphoneos;
469469
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
470470
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
471+
SWIFT_VERSION = 4.0;
471472
TARGETED_DEVICE_FAMILY = "1,2";
472473
VERSIONING_SYSTEM = "apple-generic";
473474
VERSION_INFO_PREFIX = "";
@@ -513,6 +514,7 @@
513514
MTL_ENABLE_DEBUG_INFO = NO;
514515
SDKROOT = iphoneos;
515516
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
517+
SWIFT_VERSION = 4.0;
516518
TARGETED_DEVICE_FAMILY = "1,2";
517519
VALIDATE_PRODUCT = YES;
518520
VERSIONING_SYSTEM = "apple-generic";
@@ -541,13 +543,13 @@
541543
PRODUCT_NAME = "$(TARGET_NAME)";
542544
SKIP_INSTALL = YES;
543545
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
544-
SWIFT_VERSION = 3.0;
545546
};
546547
name = Debug;
547548
};
548549
4B6C2DA31D8DA3FB003D3A46 /* Release */ = {
549550
isa = XCBuildConfiguration;
550551
buildSettings = {
552+
CLANG_ENABLE_CODE_COVERAGE = NO;
551553
CLANG_ENABLE_MODULES = YES;
552554
CODE_SIGN_IDENTITY = "";
553555
DEFINES_MODULE = YES;
@@ -565,7 +567,6 @@
565567
PRODUCT_BUNDLE_IDENTIFIER = me.muukii.StackScrollView;
566568
PRODUCT_NAME = "$(TARGET_NAME)";
567569
SKIP_INSTALL = YES;
568-
SWIFT_VERSION = 3.0;
569570
};
570571
name = Release;
571572
};
@@ -585,7 +586,6 @@
585586
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
586587
PRODUCT_BUNDLE_IDENTIFIER = "me.muukii.StackScrollView-Demo";
587588
PRODUCT_NAME = "$(TARGET_NAME)";
588-
SWIFT_VERSION = 3.0;
589589
};
590590
name = Debug;
591591
};
@@ -605,7 +605,6 @@
605605
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
606606
PRODUCT_BUNDLE_IDENTIFIER = "me.muukii.StackScrollView-Demo";
607607
PRODUCT_NAME = "$(TARGET_NAME)";
608-
SWIFT_VERSION = 3.0;
609608
};
610609
name = Release;
611610
};

StackScrollView/StackCellType.swift

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,6 @@
2222

2323
import UIKit
2424

25-
@available(*, deprecated: 1.0.0, renamed: "StackCellType")
26-
public typealias StackScrollViewCellType = StackCellType
27-
2825
public protocol StackCellType: class {
2926

3027
}

0 commit comments

Comments
 (0)