Skip to content

Commit 26e89f1

Browse files
committed
Fixed tints.
1 parent 54ac54f commit 26e89f1

File tree

5 files changed

+44
-37
lines changed

5 files changed

+44
-37
lines changed

Example App/NativeUIKit.xcodeproj/xcshareddata/xcschemes/watchOS Example.xcscheme

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,33 +54,46 @@
5454
debugDocumentVersioning = "YES"
5555
debugServiceExtension = "internal"
5656
allowLocationSimulation = "YES">
57-
<BuildableProductRunnable
58-
runnableDebuggingMode = "0">
57+
<RemoteRunnable
58+
runnableDebuggingMode = "2"
59+
BundleIdentifier = "com.apple.Carousel"
60+
RemotePath = "/(null)">
5961
<BuildableReference
6062
BuildableIdentifier = "primary"
6163
BlueprintIdentifier = "F4C33E2F26C932C8001A28B1"
6264
BuildableName = "watchOS Example.app"
6365
BlueprintName = "watchOS Example"
6466
ReferencedContainer = "container:NativeUIKit.xcodeproj">
6567
</BuildableReference>
66-
</BuildableProductRunnable>
68+
</RemoteRunnable>
6769
</LaunchAction>
6870
<ProfileAction
6971
buildConfiguration = "Release"
7072
shouldUseLaunchSchemeArgsEnv = "YES"
7173
savedToolIdentifier = ""
7274
useCustomWorkingDirectory = "NO"
7375
debugDocumentVersioning = "YES">
74-
<BuildableProductRunnable
75-
runnableDebuggingMode = "0">
76+
<RemoteRunnable
77+
runnableDebuggingMode = "2"
78+
BundleIdentifier = "com.apple.Carousel"
79+
RemotePath = "/(null)">
7680
<BuildableReference
7781
BuildableIdentifier = "primary"
7882
BlueprintIdentifier = "F4C33E2F26C932C8001A28B1"
7983
BuildableName = "watchOS Example.app"
8084
BlueprintName = "watchOS Example"
8185
ReferencedContainer = "container:NativeUIKit.xcodeproj">
8286
</BuildableReference>
83-
</BuildableProductRunnable>
87+
</RemoteRunnable>
88+
<MacroExpansion>
89+
<BuildableReference
90+
BuildableIdentifier = "primary"
91+
BlueprintIdentifier = "F4C33E2F26C932C8001A28B1"
92+
BuildableName = "watchOS Example.app"
93+
BlueprintName = "watchOS Example"
94+
ReferencedContainer = "container:NativeUIKit.xcodeproj">
95+
</BuildableReference>
96+
</MacroExpansion>
8497
</ProfileAction>
8598
<AnalyzeAction
8699
buildConfiguration = "Debug">

Example App/iOS Example/Scenes/RootController.swift

Lines changed: 21 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -25,42 +25,36 @@ import NativeUIKit
2525

2626
class RootController: SPController {
2727

28-
let largeButton = NativeLargeActionButton()
28+
29+
let promoView = NativePromoView()
2930

3031
override func viewDidLoad() {
3132
super.viewDidLoad()
32-
view.backgroundColor = .systemBackground
33-
view.addSubview(largeButton)
34-
largeButton.applyDefaultAppearance(with: .init(content: .custom(.white), background: .tint))
35-
largeButton.setTitle("Title")
33+
view.backgroundColor = .secondarySystemBackground
3634

37-
largeButton.addAction(.init(handler: { _ in
38-
let controller = Native2HeaderController(image: nil, title: "Title", subtitle: "Subtitle")
39-
let toolBarView = NativeSkipableLargeActionToolBarView()
40-
toolBarView.actionButton.setTitle("Action Button")
41-
toolBarView.skipButton.setTitle("Skip")
42-
controller.toolBarView = toolBarView
43-
let navController = controller.wrapToNavigationController(prefersLargeTitles: false)
44-
controller.navigationItem.title = "Navigation Item"
45-
self.present(navController)
46-
}), for: .touchUpInside)
35+
promoView.button.setTitle("Example")
36+
promoView.descriptionLabel.text = "fdsfs"
37+
promoView.titleLabel.text = "fsdfdsfs"
38+
view.addSubview(promoView)
4739

48-
}
49-
50-
override func viewDidLayoutSubviews() {
51-
super.viewDidLayoutSubviews()
52-
largeButton.sizeToFit()
53-
largeButton.frame.setWidth(view.layoutWidth)
54-
largeButton.setXCenter()
55-
largeButton.frame.origin.y = 200
40+
delay(2, closure: {
41+
print("call")
42+
UIApplication.shared.windows.forEach({ $0.tintColor = UIColor.systemColorfulColors.randomElement()! })
43+
})
44+
45+
delay(4, closure: {
46+
print("call")
47+
UIApplication.shared.windows.forEach({ $0.tintColor = UIColor.systemColorfulColors.randomElement()! })
48+
})
5649

50+
delay(6, closure: {
51+
print("call")
52+
UIApplication.shared.windows.forEach({ $0.tintColor = UIColor.systemColorfulColors.randomElement()! })
53+
})
5754
}
58-
}
59-
60-
class Native2HeaderController: NativeHeaderController {
6155

6256
override func viewDidLayoutSubviews() {
6357
super.viewDidLayoutSubviews()
64-
scrollView.contentSize = .init(width: view.frame.width, height: 1400)
58+
promoView.layout(y: 100)
6559
}
6660
}

NativeUIKit.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Pod::Spec.new do |s|
22

33
s.name = 'NativeUIKit'
4-
s.version = '1.0.5'
4+
s.version = '1.0.6'
55
s.summary = 'Mimicrated views and controls to native Apple appearance.'
66
s.homepage = 'https://github.com/ivanvorobei/NativeUIKit'
77
s.source = { :git => 'https://github.com/ivanvorobei/NativeUIKit.git', :tag => s.version }

Sources/NativeUIKit/Views/NativePromoView.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ open class NativePromoView: SPView {
5555
}
5656

5757
public let button = SPDimmedButton().do {
58-
$0.applyDefaultAppearance(with: .init(content: .tint, background: .clear))
58+
$0.applyDefaultAppearance(with: .init(content: .tint, background: .custom(.clear)))
5959
$0.titleLabel?.font = UIFont.preferredFont(forTextStyle: .body, weight: .semibold, addPoints: 2)
6060
}
6161

@@ -94,7 +94,7 @@ open class NativePromoView: SPView {
9494
open override func layoutSubviews() {
9595
super.layoutSubviews()
9696
areaView.frame = .init(x: layoutMargins.left, y: layoutMargins.top, width: layoutWidth, height: areaView.frame.height)
97-
97+
9898
let labelsWidth = areaView.layoutWidth
9999

100100
titleLabel.layoutDynamicHeight(width: labelsWidth)
@@ -131,7 +131,7 @@ open class NativePromoContainerView: SPView {
131131
public let promoView = NativePromoView()
132132

133133
// MARK: - Init
134-
134+
135135
open override func commonInit() {
136136
super.commonInit()
137137
layoutMargins = .zero

0 commit comments

Comments
 (0)