Skip to content

Commit f422c56

Browse files
committed
version 0.1.0
1 parent 964624e commit f422c56

File tree

10 files changed

+284
-64
lines changed

10 files changed

+284
-64
lines changed

Example/MHSoftUI.xcodeproj/project.pbxproj

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -207,26 +207,25 @@
207207
isa = PBXProject;
208208
attributes = {
209209
LastSwiftUpdateCheck = 0830;
210-
LastUpgradeCheck = 0830;
210+
LastUpgradeCheck = 1130;
211211
ORGANIZATIONNAME = CocoaPods;
212212
TargetAttributes = {
213213
607FACCF1AFB9204008FA782 = {
214214
CreatedOnToolsVersion = 6.3.1;
215-
LastSwiftMigration = 0900;
215+
LastSwiftMigration = 1130;
216216
};
217217
607FACE41AFB9204008FA782 = {
218218
CreatedOnToolsVersion = 6.3.1;
219-
LastSwiftMigration = 0900;
219+
LastSwiftMigration = 1130;
220220
TestTargetID = 607FACCF1AFB9204008FA782;
221221
};
222222
};
223223
};
224224
buildConfigurationList = 607FACCB1AFB9204008FA782 /* Build configuration list for PBXProject "MHSoftUI" */;
225225
compatibilityVersion = "Xcode 3.2";
226-
developmentRegion = English;
226+
developmentRegion = en;
227227
hasScannedForEncodings = 0;
228228
knownRegions = (
229-
English,
230229
en,
231230
Base,
232231
);
@@ -378,6 +377,7 @@
378377
isa = XCBuildConfiguration;
379378
buildSettings = {
380379
ALWAYS_SEARCH_USER_PATHS = NO;
380+
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
381381
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
382382
CLANG_CXX_LIBRARY = "libc++";
383383
CLANG_ENABLE_MODULES = YES;
@@ -386,12 +386,14 @@
386386
CLANG_WARN_BOOL_CONVERSION = YES;
387387
CLANG_WARN_COMMA = YES;
388388
CLANG_WARN_CONSTANT_CONVERSION = YES;
389+
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
389390
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
390391
CLANG_WARN_EMPTY_BODY = YES;
391392
CLANG_WARN_ENUM_CONVERSION = YES;
392393
CLANG_WARN_INFINITE_RECURSION = YES;
393394
CLANG_WARN_INT_CONVERSION = YES;
394395
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
396+
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
395397
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
396398
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
397399
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
@@ -419,7 +421,7 @@
419421
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
420422
GCC_WARN_UNUSED_FUNCTION = YES;
421423
GCC_WARN_UNUSED_VARIABLE = YES;
422-
IPHONEOS_DEPLOYMENT_TARGET = 9.3;
424+
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
423425
MTL_ENABLE_DEBUG_INFO = YES;
424426
ONLY_ACTIVE_ARCH = YES;
425427
SDKROOT = iphoneos;
@@ -431,6 +433,7 @@
431433
isa = XCBuildConfiguration;
432434
buildSettings = {
433435
ALWAYS_SEARCH_USER_PATHS = NO;
436+
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
434437
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
435438
CLANG_CXX_LIBRARY = "libc++";
436439
CLANG_ENABLE_MODULES = YES;
@@ -439,12 +442,14 @@
439442
CLANG_WARN_BOOL_CONVERSION = YES;
440443
CLANG_WARN_COMMA = YES;
441444
CLANG_WARN_CONSTANT_CONVERSION = YES;
445+
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
442446
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
443447
CLANG_WARN_EMPTY_BODY = YES;
444448
CLANG_WARN_ENUM_CONVERSION = YES;
445449
CLANG_WARN_INFINITE_RECURSION = YES;
446450
CLANG_WARN_INT_CONVERSION = YES;
447451
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
452+
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
448453
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
449454
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
450455
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
@@ -465,7 +470,7 @@
465470
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
466471
GCC_WARN_UNUSED_FUNCTION = YES;
467472
GCC_WARN_UNUSED_VARIABLE = YES;
468-
IPHONEOS_DEPLOYMENT_TARGET = 9.3;
473+
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
469474
MTL_ENABLE_DEBUG_INFO = NO;
470475
SDKROOT = iphoneos;
471476
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
@@ -484,7 +489,7 @@
484489
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.$(PRODUCT_NAME:rfc1034identifier)";
485490
PRODUCT_NAME = "$(TARGET_NAME)";
486491
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
487-
SWIFT_VERSION = 4.0;
492+
SWIFT_VERSION = 5.0;
488493
};
489494
name = Debug;
490495
};
@@ -499,7 +504,7 @@
499504
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.$(PRODUCT_NAME:rfc1034identifier)";
500505
PRODUCT_NAME = "$(TARGET_NAME)";
501506
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
502-
SWIFT_VERSION = 4.0;
507+
SWIFT_VERSION = 5.0;
503508
};
504509
name = Release;
505510
};
@@ -520,7 +525,7 @@
520525
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.$(PRODUCT_NAME:rfc1034identifier)";
521526
PRODUCT_NAME = "$(TARGET_NAME)";
522527
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
523-
SWIFT_VERSION = 4.0;
528+
SWIFT_VERSION = 5.0;
524529
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/MHSoftUI_Example.app/MHSoftUI_Example";
525530
};
526531
name = Debug;
@@ -538,7 +543,7 @@
538543
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.$(PRODUCT_NAME:rfc1034identifier)";
539544
PRODUCT_NAME = "$(TARGET_NAME)";
540545
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
541-
SWIFT_VERSION = 4.0;
546+
SWIFT_VERSION = 5.0;
542547
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/MHSoftUI_Example.app/MHSoftUI_Example";
543548
};
544549
name = Release;

Example/MHSoftUI.xcodeproj/xcshareddata/xcschemes/MHSoftUI-Example.xcscheme

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "0900"
3+
LastUpgradeVersion = "1130"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"
@@ -40,8 +40,16 @@
4040
buildConfiguration = "Debug"
4141
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
4242
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
43-
language = ""
4443
shouldUseLaunchSchemeArgsEnv = "YES">
44+
<MacroExpansion>
45+
<BuildableReference
46+
BuildableIdentifier = "primary"
47+
BlueprintIdentifier = "607FACCF1AFB9204008FA782"
48+
BuildableName = "MHSoftUI_Example.app"
49+
BlueprintName = "MHSoftUI_Example"
50+
ReferencedContainer = "container:MHSoftUI.xcodeproj">
51+
</BuildableReference>
52+
</MacroExpansion>
4553
<Testables>
4654
<TestableReference
4755
skipped = "NO">
@@ -54,23 +62,11 @@
5462
</BuildableReference>
5563
</TestableReference>
5664
</Testables>
57-
<MacroExpansion>
58-
<BuildableReference
59-
BuildableIdentifier = "primary"
60-
BlueprintIdentifier = "607FACCF1AFB9204008FA782"
61-
BuildableName = "MHSoftUI_Example.app"
62-
BlueprintName = "MHSoftUI_Example"
63-
ReferencedContainer = "container:MHSoftUI.xcodeproj">
64-
</BuildableReference>
65-
</MacroExpansion>
66-
<AdditionalOptions>
67-
</AdditionalOptions>
6865
</TestAction>
6966
<LaunchAction
7067
buildConfiguration = "Debug"
7168
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
7269
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
73-
language = ""
7470
launchStyle = "0"
7571
useCustomWorkingDirectory = "NO"
7672
ignoresPersistentStateOnLaunch = "NO"
@@ -87,8 +83,6 @@
8783
ReferencedContainer = "container:MHSoftUI.xcodeproj">
8884
</BuildableReference>
8985
</BuildableProductRunnable>
90-
<AdditionalOptions>
91-
</AdditionalOptions>
9286
</LaunchAction>
9387
<ProfileAction
9488
buildConfiguration = "Release"

Example/MHSoftUI/AppDelegate.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
1414
var window: UIWindow?
1515

1616

17-
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
17+
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
1818
// Override point for customization after application launch.
1919
return true
2020
}

Example/MHSoftUI/Base.lproj/Main.storyboard

Lines changed: 88 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
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="15702" 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="15704"/>
97
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
108
</dependencies>
119
<scenes>
@@ -20,11 +18,96 @@
2018
<view key="view" contentMode="scaleToFill" id="kh9-bI-dsS">
2119
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
2220
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
21+
<subviews>
22+
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="axm-Y8-F1I">
23+
<rect key="frame" x="77.5" y="183.5" width="220" height="300"/>
24+
<subviews>
25+
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="tkB-hB-DDJ">
26+
<rect key="frame" x="60" y="22" width="100" height="50"/>
27+
<subviews>
28+
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Soft UI" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="aOC-HD-qt7">
29+
<rect key="frame" x="17" y="10" width="66.5" height="30"/>
30+
<fontDescription key="fontDescription" type="system" weight="ultraLight" pointSize="25"/>
31+
<nil key="textColor"/>
32+
<nil key="highlightedColor"/>
33+
</label>
34+
</subviews>
35+
<color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
36+
<constraints>
37+
<constraint firstAttribute="width" constant="100" id="H5o-lL-Q5O"/>
38+
<constraint firstAttribute="height" constant="50" id="SCc-f2-RRm"/>
39+
<constraint firstItem="aOC-HD-qt7" firstAttribute="centerY" secondItem="tkB-hB-DDJ" secondAttribute="centerY" id="pLh-Nw-qyv"/>
40+
<constraint firstItem="aOC-HD-qt7" firstAttribute="centerX" secondItem="tkB-hB-DDJ" secondAttribute="centerX" id="pwZ-Ec-D0S"/>
41+
</constraints>
42+
</view>
43+
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="SyE-3f-lNA">
44+
<rect key="frame" x="20" y="120" width="60" height="60"/>
45+
<constraints>
46+
<constraint firstAttribute="height" constant="60" id="ank-Xk-vcv"/>
47+
<constraint firstAttribute="width" constant="60" id="lqA-5Z-86R"/>
48+
</constraints>
49+
<fontDescription key="fontDescription" type="system" pointSize="12"/>
50+
<color key="tintColor" systemColor="systemIndigoColor" red="0.34509803919999998" green="0.33725490200000002" blue="0.83921568629999999" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
51+
<state key="normal" title=" Play" image="play.fill" catalog="system">
52+
<color key="titleColor" systemColor="systemIndigoColor" red="0.34509803919999998" green="0.33725490200000002" blue="0.83921568629999999" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
53+
</state>
54+
</button>
55+
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="6Oa-LC-iTV">
56+
<rect key="frame" x="138" y="120" width="60" height="60"/>
57+
<constraints>
58+
<constraint firstAttribute="height" constant="60" id="UYX-17-gIj"/>
59+
<constraint firstAttribute="width" constant="60" id="ugo-3M-0KJ"/>
60+
</constraints>
61+
<color key="tintColor" systemColor="systemOrangeColor" red="1" green="0.58431372550000005" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
62+
<state key="normal" image="stop.fill" catalog="system"/>
63+
</button>
64+
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="y1t-pW-mKM">
65+
<rect key="frame" x="80" y="218" width="60" height="60"/>
66+
<constraints>
67+
<constraint firstAttribute="height" constant="60" id="LSx-ur-FeV"/>
68+
<constraint firstAttribute="width" constant="60" id="Spj-AK-xUF"/>
69+
</constraints>
70+
<color key="tintColor" systemColor="systemPinkColor" red="1" green="0.1764705882" blue="0.33333333329999998" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
71+
<state key="normal" image="heart.fill" catalog="system"/>
72+
</button>
73+
</subviews>
74+
<color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
75+
<constraints>
76+
<constraint firstItem="tkB-hB-DDJ" firstAttribute="top" secondItem="axm-Y8-F1I" secondAttribute="top" constant="22" id="941-oo-F6g"/>
77+
<constraint firstItem="SyE-3f-lNA" firstAttribute="centerY" secondItem="axm-Y8-F1I" secondAttribute="centerY" id="Py4-Dt-le1"/>
78+
<constraint firstAttribute="bottom" secondItem="y1t-pW-mKM" secondAttribute="bottom" constant="22" id="TL6-Rj-yT1"/>
79+
<constraint firstAttribute="trailing" secondItem="6Oa-LC-iTV" secondAttribute="trailing" constant="22" id="YHb-Uf-32B"/>
80+
<constraint firstItem="6Oa-LC-iTV" firstAttribute="centerY" secondItem="axm-Y8-F1I" secondAttribute="centerY" id="ei5-9H-2g1"/>
81+
<constraint firstItem="y1t-pW-mKM" firstAttribute="centerX" secondItem="axm-Y8-F1I" secondAttribute="centerX" id="lad-AO-UhC"/>
82+
<constraint firstAttribute="width" constant="220" id="of2-fQ-cQ7"/>
83+
<constraint firstAttribute="height" constant="300" id="t1H-Mx-NR9"/>
84+
<constraint firstItem="SyE-3f-lNA" firstAttribute="leading" secondItem="axm-Y8-F1I" secondAttribute="leading" constant="20" id="vyO-1a-qCF"/>
85+
<constraint firstItem="tkB-hB-DDJ" firstAttribute="centerX" secondItem="axm-Y8-F1I" secondAttribute="centerX" id="ybB-RM-zo7"/>
86+
</constraints>
87+
</view>
88+
</subviews>
2389
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
90+
<constraints>
91+
<constraint firstItem="axm-Y8-F1I" firstAttribute="centerX" secondItem="kh9-bI-dsS" secondAttribute="centerX" id="BsC-CO-JYR"/>
92+
<constraint firstItem="axm-Y8-F1I" firstAttribute="centerY" secondItem="kh9-bI-dsS" secondAttribute="centerY" id="KIk-99-hcq"/>
93+
</constraints>
2494
</view>
95+
<connections>
96+
<outlet property="backgroundView" destination="axm-Y8-F1I" id="r5a-r5-hH8"/>
97+
<outlet property="labelBackView" destination="tkB-hB-DDJ" id="1hq-2X-j9n"/>
98+
<outlet property="likeButton" destination="y1t-pW-mKM" id="lRk-Er-sYI"/>
99+
<outlet property="playButton" destination="SyE-3f-lNA" id="FTd-8b-m9q"/>
100+
<outlet property="stopButton" destination="6Oa-LC-iTV" id="yk5-KB-d01"/>
101+
</connections>
25102
</viewController>
26103
<placeholder placeholderIdentifier="IBFirstResponder" id="x5A-6p-PRh" sceneMemberID="firstResponder"/>
27104
</objects>
105+
<point key="canvasLocation" x="138" y="134"/>
28106
</scene>
29107
</scenes>
108+
<resources>
109+
<image name="heart.fill" catalog="system" width="64" height="54"/>
110+
<image name="play.fill" catalog="system" width="58" height="64"/>
111+
<image name="stop.fill" catalog="system" width="64" height="56"/>
112+
</resources>
30113
</document>

Example/MHSoftUI/ViewController.swift

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,31 @@
77
//
88

99
import UIKit
10+
import MHSoftUI
1011

1112
class ViewController: UIViewController {
1213

14+
@IBOutlet weak var labelBackView: UIView!
15+
@IBOutlet weak var backgroundView: UIView!
16+
@IBOutlet weak var playButton: UIButton!
17+
@IBOutlet weak var stopButton: UIButton!
18+
@IBOutlet weak var likeButton: UIButton!
19+
1320
override func viewDidLoad() {
1421
super.viewDidLoad()
15-
// Do any additional setup after loading the view, typically from a nib.
22+
23+
//It's important to have the same color (preferably lighter one) for both background and UI components
24+
self.view.backgroundColor = UIColor(red: 241/255, green: 243/255, blue: 246/255, alpha: 1.0)
25+
26+
//Adding SoftUI effect to UIViews
27+
backgroundView.addSoftUIEffectForView()
28+
labelBackView.addSoftUIEffectForView()
29+
30+
//Adding SoftUI effect to UIButtons
31+
stopButton.addSoftUIEffectForButton()
32+
likeButton.addSoftUIEffectForButton(cornerRadius: 0)
33+
playButton.addSoftUIEffectForButton(cornerRadius: playButton.bounds.height/2)
34+
1635
}
1736

1837
override func didReceiveMemoryWarning() {

0 commit comments

Comments
 (0)