Skip to content
This repository was archived by the owner on Jul 17, 2025. It is now read-only.

Commit 8f8291c

Browse files
committed
Merge branch 'refs/heads/develop'
2 parents c075f44 + 6051d00 commit 8f8291c

File tree

87 files changed

+2024
-498
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

87 files changed

+2024
-498
lines changed

.github/workflows/ci.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: CI
2+
3+
on:
4+
pull_request:
5+
workflow_dispatch:
6+
7+
jobs:
8+
build:
9+
name: Run PR-CI
10+
runs-on: macOS-latest
11+
12+
steps:
13+
- name: Checkout the Git repository
14+
uses: actions/checkout@v2
15+
16+
- name: Install Ruby Dependencies
17+
run: |
18+
bundle install
19+
20+
- name: Pod Install
21+
run: |
22+
bundle exec pod install --project-directory=Example
23+
24+
- name: Build and Test
25+
run: |
26+
cd ./Example
27+
bundle exec fastlane ios execute_pull_request_ci_test
28+
cd ..
29+
30+
- name: Codecov
31+
uses: codecov/codecov-action@v2.1.0

Example/KarrotFlex.xcodeproj/project.pbxproj

Lines changed: 96 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,24 @@
99
/* Begin PBXBuildFile section */
1010
15DC938BEEECF5820A159FA3 /* Pods_KarrotFlex_Tests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C44CEDF38C003BCB3B2D8F43 /* Pods_KarrotFlex_Tests.framework */; };
1111
607FACD61AFB9204008FA782 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 607FACD51AFB9204008FA782 /* AppDelegate.swift */; };
12-
607FACD81AFB9204008FA782 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 607FACD71AFB9204008FA782 /* ViewController.swift */; };
12+
607FACD81AFB9204008FA782 /* ShowCaseViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 607FACD71AFB9204008FA782 /* ShowCaseViewController.swift */; };
1313
607FACDB1AFB9204008FA782 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 607FACD91AFB9204008FA782 /* Main.storyboard */; };
1414
607FACDD1AFB9204008FA782 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 607FACDC1AFB9204008FA782 /* Images.xcassets */; };
1515
607FACE01AFB9204008FA782 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 607FACDE1AFB9204008FA782 /* LaunchScreen.xib */; };
1616
607FACEC1AFB9204008FA782 /* FlexCenterTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 607FACEB1AFB9204008FA782 /* FlexCenterTests.swift */; };
1717
D1EA29224B9896237BAE7DCF /* Pods_KarrotFlex_Example.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A65B2533B5820E9298057444 /* Pods_KarrotFlex_Example.framework */; };
1818
DA33A1E12732D0EB00C5D8BB /* KarrotFlexSnapshotTestCase.swift in Sources */ = {isa = PBXBuildFile; fileRef = DA33A1E02732D0EB00C5D8BB /* KarrotFlexSnapshotTestCase.swift */; };
19-
DAE346562733DEF000FCA037 /* FlexInsetTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = DAE346552733DEF000FCA037 /* FlexInsetTests.swift */; };
19+
DA89B74F2765BC06003777D8 /* FlexVStackCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = DA89B74E2765BC06003777D8 /* FlexVStackCell.swift */; };
20+
DA89B7532765CFEE003777D8 /* FlexVStackTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = DA89B7522765CFEE003777D8 /* FlexVStackTests.swift */; };
21+
DA89B7572765D85D003777D8 /* FlexCenterCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = DA89B7562765D85D003777D8 /* FlexCenterCell.swift */; };
22+
DA89B75F2765DC45003777D8 /* FlexHStackTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = DA89B75E2765DC45003777D8 /* FlexHStackTests.swift */; };
23+
DA89B7672765DFCD003777D8 /* FlexOverlayTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = DA89B7662765DFCD003777D8 /* FlexOverlayTests.swift */; };
24+
DA89B76A2765E5AE003777D8 /* FlexAnimationCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = DA89B7682765E4FE003777D8 /* FlexAnimationCell.swift */; };
25+
DA89B7712765E6D6003777D8 /* FlexAnimationViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = DA89B76C2765E5DE003777D8 /* FlexAnimationViewController.swift */; };
26+
DA89B7722765E6E1003777D8 /* BaseViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = DA89B76F2765E5FC003777D8 /* BaseViewController.swift */; };
27+
DA9391352771EF86005C5F56 /* FlexWrapCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = DA9391342771EF86005C5F56 /* FlexWrapCell.swift */; };
28+
DAB1324A276782CA002B9394 /* ShowCaseCellKind.swift in Sources */ = {isa = PBXBuildFile; fileRef = DAB13249276782CA002B9394 /* ShowCaseCellKind.swift */; };
29+
DAC1D92F278C2C9C000D3E07 /* FlexWrapTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = DAC1D92E278C2C9C000D3E07 /* FlexWrapTests.swift */; };
2030
/* End PBXBuildFile section */
2131

2232
/* Begin PBXContainerItemProxy section */
@@ -34,7 +44,7 @@
3444
607FACD01AFB9204008FA782 /* KarrotFlex_Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = KarrotFlex_Example.app; sourceTree = BUILT_PRODUCTS_DIR; };
3545
607FACD41AFB9204008FA782 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
3646
607FACD51AFB9204008FA782 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
37-
607FACD71AFB9204008FA782 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = "<group>"; };
47+
607FACD71AFB9204008FA782 /* ShowCaseViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ShowCaseViewController.swift; sourceTree = "<group>"; };
3848
607FACDA1AFB9204008FA782 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
3949
607FACDC1AFB9204008FA782 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = "<group>"; };
4050
607FACDF1AFB9204008FA782 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = "<group>"; };
@@ -48,7 +58,17 @@
4858
A65B2533B5820E9298057444 /* Pods_KarrotFlex_Example.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_KarrotFlex_Example.framework; sourceTree = BUILT_PRODUCTS_DIR; };
4959
C44CEDF38C003BCB3B2D8F43 /* Pods_KarrotFlex_Tests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_KarrotFlex_Tests.framework; sourceTree = BUILT_PRODUCTS_DIR; };
5060
DA33A1E02732D0EB00C5D8BB /* KarrotFlexSnapshotTestCase.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KarrotFlexSnapshotTestCase.swift; sourceTree = "<group>"; };
51-
DAE346552733DEF000FCA037 /* FlexInsetTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FlexInsetTests.swift; sourceTree = "<group>"; };
61+
DA89B74E2765BC06003777D8 /* FlexVStackCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FlexVStackCell.swift; sourceTree = "<group>"; };
62+
DA89B7522765CFEE003777D8 /* FlexVStackTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FlexVStackTests.swift; sourceTree = "<group>"; };
63+
DA89B7562765D85D003777D8 /* FlexCenterCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FlexCenterCell.swift; sourceTree = "<group>"; };
64+
DA89B75E2765DC45003777D8 /* FlexHStackTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FlexHStackTests.swift; sourceTree = "<group>"; };
65+
DA89B7662765DFCD003777D8 /* FlexOverlayTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FlexOverlayTests.swift; sourceTree = "<group>"; };
66+
DA89B7682765E4FE003777D8 /* FlexAnimationCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FlexAnimationCell.swift; sourceTree = "<group>"; };
67+
DA89B76C2765E5DE003777D8 /* FlexAnimationViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FlexAnimationViewController.swift; sourceTree = "<group>"; };
68+
DA89B76F2765E5FC003777D8 /* BaseViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BaseViewController.swift; sourceTree = "<group>"; };
69+
DA9391342771EF86005C5F56 /* FlexWrapCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FlexWrapCell.swift; sourceTree = "<group>"; };
70+
DAB13249276782CA002B9394 /* ShowCaseCellKind.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ShowCaseCellKind.swift; sourceTree = "<group>"; };
71+
DAC1D92E278C2C9C000D3E07 /* FlexWrapTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FlexWrapTests.swift; sourceTree = "<group>"; };
5272
EBBEC18237886BF5EA343DA9 /* Pods-KarrotFlex_Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-KarrotFlex_Example.debug.xcconfig"; path = "Target Support Files/Pods-KarrotFlex_Example/Pods-KarrotFlex_Example.debug.xcconfig"; sourceTree = "<group>"; };
5373
FFF992CA592387B13D32BB4B /* LICENSE */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = LICENSE; path = ../LICENSE; sourceTree = "<group>"; };
5474
/* End PBXFileReference section */
@@ -108,8 +128,10 @@
108128
607FACD21AFB9204008FA782 /* Example for KarrotFlex */ = {
109129
isa = PBXGroup;
110130
children = (
131+
DAB132462767829A002B9394 /* Cell */,
132+
DAB1324327678289002B9394 /* Scene */,
133+
DAB1324227678280002B9394 /* Base */,
111134
607FACD51AFB9204008FA782 /* AppDelegate.swift */,
112-
607FACD71AFB9204008FA782 /* ViewController.swift */,
113135
607FACD91AFB9204008FA782 /* Main.storyboard */,
114136
607FACDC1AFB9204008FA782 /* Images.xcassets */,
115137
607FACDE1AFB9204008FA782 /* LaunchScreen.xib */,
@@ -131,9 +153,12 @@
131153
isa = PBXGroup;
132154
children = (
133155
607FACEB1AFB9204008FA782 /* FlexCenterTests.swift */,
134-
DAE346552733DEF000FCA037 /* FlexInsetTests.swift */,
156+
DA89B7522765CFEE003777D8 /* FlexVStackTests.swift */,
157+
DA89B75E2765DC45003777D8 /* FlexHStackTests.swift */,
158+
DAC1D92E278C2C9C000D3E07 /* FlexWrapTests.swift */,
135159
DA33A1E02732D0EB00C5D8BB /* KarrotFlexSnapshotTestCase.swift */,
136160
607FACE91AFB9204008FA782 /* Supporting Files */,
161+
DA89B7662765DFCD003777D8 /* FlexOverlayTests.swift */,
137162
);
138163
path = Tests;
139164
sourceTree = "<group>";
@@ -165,6 +190,51 @@
165190
name = Frameworks;
166191
sourceTree = "<group>";
167192
};
193+
DAB1324227678280002B9394 /* Base */ = {
194+
isa = PBXGroup;
195+
children = (
196+
DA89B76F2765E5FC003777D8 /* BaseViewController.swift */,
197+
);
198+
path = Base;
199+
sourceTree = "<group>";
200+
};
201+
DAB1324327678289002B9394 /* Scene */ = {
202+
isa = PBXGroup;
203+
children = (
204+
DAB13248276782B8002B9394 /* FlexAnimation */,
205+
DAB13247276782B3002B9394 /* ShowCase */,
206+
);
207+
path = Scene;
208+
sourceTree = "<group>";
209+
};
210+
DAB132462767829A002B9394 /* Cell */ = {
211+
isa = PBXGroup;
212+
children = (
213+
DA89B74E2765BC06003777D8 /* FlexVStackCell.swift */,
214+
DA89B7682765E4FE003777D8 /* FlexAnimationCell.swift */,
215+
DA89B7562765D85D003777D8 /* FlexCenterCell.swift */,
216+
DA9391342771EF86005C5F56 /* FlexWrapCell.swift */,
217+
);
218+
path = Cell;
219+
sourceTree = "<group>";
220+
};
221+
DAB13247276782B3002B9394 /* ShowCase */ = {
222+
isa = PBXGroup;
223+
children = (
224+
607FACD71AFB9204008FA782 /* ShowCaseViewController.swift */,
225+
DAB13249276782CA002B9394 /* ShowCaseCellKind.swift */,
226+
);
227+
path = ShowCase;
228+
sourceTree = "<group>";
229+
};
230+
DAB13248276782B8002B9394 /* FlexAnimation */ = {
231+
isa = PBXGroup;
232+
children = (
233+
DA89B76C2765E5DE003777D8 /* FlexAnimationViewController.swift */,
234+
);
235+
path = FlexAnimation;
236+
sourceTree = "<group>";
237+
};
168238
/* End PBXGroup section */
169239

170240
/* Begin PBXNativeTarget section */
@@ -278,11 +348,13 @@
278348
"${PODS_ROOT}/Target Support Files/Pods-KarrotFlex_Example/Pods-KarrotFlex_Example-frameworks.sh",
279349
"${BUILT_PRODUCTS_DIR}/FlexLayout/FlexLayout.framework",
280350
"${BUILT_PRODUCTS_DIR}/KarrotFlex/KarrotFlex.framework",
351+
"${BUILT_PRODUCTS_DIR}/PinLayout/PinLayout.framework",
281352
);
282353
name = "[CP] Embed Pods Frameworks";
283354
outputPaths = (
284355
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FlexLayout.framework",
285356
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/KarrotFlex.framework",
357+
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/PinLayout.framework",
286358
);
287359
runOnlyForDeploymentPostprocessing = 0;
288360
shellPath = /bin/sh;
@@ -358,18 +430,28 @@
358430
isa = PBXSourcesBuildPhase;
359431
buildActionMask = 2147483647;
360432
files = (
361-
607FACD81AFB9204008FA782 /* ViewController.swift in Sources */,
433+
DA89B7712765E6D6003777D8 /* FlexAnimationViewController.swift in Sources */,
434+
DA9391352771EF86005C5F56 /* FlexWrapCell.swift in Sources */,
435+
DA89B76A2765E5AE003777D8 /* FlexAnimationCell.swift in Sources */,
436+
607FACD81AFB9204008FA782 /* ShowCaseViewController.swift in Sources */,
362437
607FACD61AFB9204008FA782 /* AppDelegate.swift in Sources */,
438+
DAB1324A276782CA002B9394 /* ShowCaseCellKind.swift in Sources */,
439+
DA89B74F2765BC06003777D8 /* FlexVStackCell.swift in Sources */,
440+
DA89B7722765E6E1003777D8 /* BaseViewController.swift in Sources */,
441+
DA89B7572765D85D003777D8 /* FlexCenterCell.swift in Sources */,
363442
);
364443
runOnlyForDeploymentPostprocessing = 0;
365444
};
366445
607FACE11AFB9204008FA782 /* Sources */ = {
367446
isa = PBXSourcesBuildPhase;
368447
buildActionMask = 2147483647;
369448
files = (
449+
DA89B7672765DFCD003777D8 /* FlexOverlayTests.swift in Sources */,
450+
DA89B75F2765DC45003777D8 /* FlexHStackTests.swift in Sources */,
451+
DAC1D92F278C2C9C000D3E07 /* FlexWrapTests.swift in Sources */,
370452
607FACEC1AFB9204008FA782 /* FlexCenterTests.swift in Sources */,
371453
DA33A1E12732D0EB00C5D8BB /* KarrotFlexSnapshotTestCase.swift in Sources */,
372-
DAE346562733DEF000FCA037 /* FlexInsetTests.swift in Sources */,
454+
DA89B7532765CFEE003777D8 /* FlexVStackTests.swift in Sources */,
373455
);
374456
runOnlyForDeploymentPostprocessing = 0;
375457
};
@@ -448,7 +530,7 @@
448530
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
449531
GCC_WARN_UNUSED_FUNCTION = YES;
450532
GCC_WARN_UNUSED_VARIABLE = YES;
451-
IPHONEOS_DEPLOYMENT_TARGET = 9.3;
533+
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
452534
MTL_ENABLE_DEBUG_INFO = YES;
453535
ONLY_ACTIVE_ARCH = YES;
454536
SDKROOT = iphoneos;
@@ -494,7 +576,7 @@
494576
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
495577
GCC_WARN_UNUSED_FUNCTION = YES;
496578
GCC_WARN_UNUSED_VARIABLE = YES;
497-
IPHONEOS_DEPLOYMENT_TARGET = 9.3;
579+
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
498580
MTL_ENABLE_DEBUG_INFO = NO;
499581
SDKROOT = iphoneos;
500582
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
@@ -508,6 +590,7 @@
508590
buildSettings = {
509591
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
510592
INFOPLIST_FILE = KarrotFlex/Info.plist;
593+
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
511594
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
512595
MODULE_NAME = ExampleApp;
513596
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.$(PRODUCT_NAME:rfc1034identifier)";
@@ -523,6 +606,7 @@
523606
buildSettings = {
524607
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
525608
INFOPLIST_FILE = KarrotFlex/Info.plist;
609+
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
526610
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
527611
MODULE_NAME = ExampleApp;
528612
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.$(PRODUCT_NAME:rfc1034identifier)";
@@ -545,6 +629,7 @@
545629
"$(inherited)",
546630
);
547631
INFOPLIST_FILE = Tests/Info.plist;
632+
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
548633
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
549634
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.$(PRODUCT_NAME:rfc1034identifier)";
550635
PRODUCT_NAME = "$(TARGET_NAME)";
@@ -563,6 +648,7 @@
563648
"$(inherited)",
564649
);
565650
INFOPLIST_FILE = Tests/Info.plist;
651+
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
566652
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
567653
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.$(PRODUCT_NAME:rfc1034identifier)";
568654
PRODUCT_NAME = "$(TARGET_NAME)";
Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,16 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13771" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="vXZ-lx-hvc">
3-
<device id="retina4_7" orientation="portrait">
4-
<adaptation id="fullscreen"/>
5-
</device>
2+
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="19162" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="vXZ-lx-hvc">
3+
<device id="retina4_7" orientation="portrait" appearance="light"/>
64
<dependencies>
75
<deployment identifier="iOS"/>
8-
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13772"/>
6+
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="19144"/>
97
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
108
</dependencies>
119
<scenes>
12-
<!--View Controller-->
10+
<!--Show Case View Controller-->
1311
<scene sceneID="ufC-wZ-h7g">
1412
<objects>
15-
<viewController id="vXZ-lx-hvc" customClass="ViewController" customModule="KarrotFlex_Example" customModuleProvider="target" sceneMemberID="viewController">
13+
<viewController id="vXZ-lx-hvc" customClass="ShowCaseViewController" customModule="KarrotFlex_Example" customModuleProvider="target" sceneMemberID="viewController">
1614
<layoutGuides>
1715
<viewControllerLayoutGuide type="top" id="jyV-Pf-zRb"/>
1816
<viewControllerLayoutGuide type="bottom" id="2fi-mo-0CV"/>
@@ -25,6 +23,7 @@
2523
</viewController>
2624
<placeholder placeholderIdentifier="IBFirstResponder" id="x5A-6p-PRh" sceneMemberID="firstResponder"/>
2725
</objects>
26+
<point key="canvasLocation" x="140" y="133"/>
2827
</scene>
2928
</scenes>
3029
</document>
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
//
2+
// BaseViewController.swift
3+
// KarrotFlex
4+
//
5+
// Created by Geektree0101 on 2021/12/12.
6+
// Copyright © 2021 CocoaPods. All rights reserved.
7+
//
8+
9+
import Foundation
10+
import UIKit
11+
12+
class BaseViewController<View: UIView>: UIViewController {
13+
14+
let body: View
15+
16+
convenience init() {
17+
self.init(view: View())
18+
}
19+
20+
init(view: View) {
21+
self.body = view
22+
super.init(nibName: nil, bundle: nil)
23+
}
24+
25+
required init?(coder: NSCoder) {
26+
fatalError("init(coder:) has not been implemented")
27+
}
28+
29+
override func loadView() {
30+
self.view = self.body
31+
}
32+
33+
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
//
2+
// FlexAnimationCell.swift
3+
// KarrotFlex
4+
//
5+
// Created by Geektree0101 on 2021/12/12.
6+
// Copyright © 2021 CocoaPods. All rights reserved.
7+
//
8+
9+
import Foundation
10+
import UIKit
11+
import KarrotFlex
12+
13+
final class FlexAnimationCell: UITableViewCell {
14+
15+
private let labelView = UILabel()
16+
17+
override init(style: UITableViewCellStyle, reuseIdentifier: String?) {
18+
super.init(style: style, reuseIdentifier: reuseIdentifier)
19+
self.accessoryType = .disclosureIndicator
20+
self.labelView.text = "Go to animation example"
21+
self.labelView.numberOfLines = 0
22+
self.contentView.flex.define {
23+
FlexItem($0, view: self.labelView).margin(24.0)
24+
}
25+
}
26+
27+
required init?(coder: NSCoder) {
28+
fatalError("init(coder:) has not been implemented")
29+
}
30+
31+
override func sizeThatFits(_ size: CGSize) -> CGSize {
32+
self.contentView.bounds.size.width = size.width
33+
self.contentView.flex.layout(mode: .adjustHeight)
34+
return self.contentView.bounds.size
35+
}
36+
37+
}

0 commit comments

Comments
 (0)