Skip to content

Commit 6650866

Browse files
committed
update readme
1 parent 2039f81 commit 6650866

File tree

4 files changed

+139
-39
lines changed

4 files changed

+139
-39
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<Scheme
3+
LastUpgradeVersion = "1120"
4+
version = "1.3">
5+
<BuildAction
6+
parallelizeBuildables = "YES"
7+
buildImplicitDependencies = "YES">
8+
<BuildActionEntries>
9+
<BuildActionEntry
10+
buildForTesting = "YES"
11+
buildForRunning = "YES"
12+
buildForProfiling = "YES"
13+
buildForArchiving = "YES"
14+
buildForAnalyzing = "YES">
15+
<BuildableReference
16+
BuildableIdentifier = "primary"
17+
BlueprintIdentifier = "FA3BB2722008B41B00E06F8F"
18+
BuildableName = "Alerts&amp;Pickers.app"
19+
BlueprintName = "Alerts&amp;Pickers"
20+
ReferencedContainer = "container:AlertsAndPickers.xcodeproj">
21+
</BuildableReference>
22+
</BuildActionEntry>
23+
</BuildActionEntries>
24+
</BuildAction>
25+
<TestAction
26+
buildConfiguration = "Debug"
27+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
28+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
29+
shouldUseLaunchSchemeArgsEnv = "YES">
30+
<Testables>
31+
</Testables>
32+
</TestAction>
33+
<LaunchAction
34+
buildConfiguration = "Debug"
35+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
36+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
37+
launchStyle = "0"
38+
useCustomWorkingDirectory = "NO"
39+
ignoresPersistentStateOnLaunch = "NO"
40+
debugDocumentVersioning = "YES"
41+
debugServiceExtension = "internal"
42+
allowLocationSimulation = "YES">
43+
<BuildableProductRunnable
44+
runnableDebuggingMode = "0">
45+
<BuildableReference
46+
BuildableIdentifier = "primary"
47+
BlueprintIdentifier = "FA3BB2722008B41B00E06F8F"
48+
BuildableName = "Alerts&amp;Pickers.app"
49+
BlueprintName = "Alerts&amp;Pickers"
50+
ReferencedContainer = "container:AlertsAndPickers.xcodeproj">
51+
</BuildableReference>
52+
</BuildableProductRunnable>
53+
</LaunchAction>
54+
<ProfileAction
55+
buildConfiguration = "Release"
56+
shouldUseLaunchSchemeArgsEnv = "YES"
57+
savedToolIdentifier = ""
58+
useCustomWorkingDirectory = "NO"
59+
debugDocumentVersioning = "YES">
60+
<BuildableProductRunnable
61+
runnableDebuggingMode = "0">
62+
<BuildableReference
63+
BuildableIdentifier = "primary"
64+
BlueprintIdentifier = "FA3BB2722008B41B00E06F8F"
65+
BuildableName = "Alerts&amp;Pickers.app"
66+
BlueprintName = "Alerts&amp;Pickers"
67+
ReferencedContainer = "container:AlertsAndPickers.xcodeproj">
68+
</BuildableReference>
69+
</BuildableProductRunnable>
70+
</ProfileAction>
71+
<AnalyzeAction
72+
buildConfiguration = "Debug">
73+
</AnalyzeAction>
74+
<ArchiveAction
75+
buildConfiguration = "Release"
76+
revealArchiveInOrganizer = "YES">
77+
</ArchiveAction>
78+
</Scheme>

README.md

+32-32
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<div align = "center">
2-
<img src="Assets/Logo.png" width="700" />
2+
<img src="Source/Assets/Logo.png" width="700" />
33
</div>
44

55
<p align="center">
@@ -28,15 +28,15 @@ Advanced usage of native UIAlertController with TextField, TextView, DatePicker,
2828
- [x] Pure Swift 4.
2929

3030
<div align = "center">
31-
<img src="Assets/gifs/actionSheet-.gif" width="400" />
32-
<img src="Assets/gifs/alert-.gif" width="400" />
31+
<img src="Source/Assets/gifs/actionSheet-.gif" width="400" />
32+
<img src="Source/Assets/gifs/alert-.gif" width="400" />
3333
</div>
3434

3535
## Usage
3636

3737
<div align = "center">
38-
<img src="Assets/gifs/actionSheet-simple.gif" width="350" />
39-
<img src="Assets/gifs/alert-simple.gif" width="350" />
38+
<img src="Source/Assets/gifs/actionSheet-simple.gif" width="350" />
39+
<img src="Source/Assets/gifs/alert-simple.gif" width="350" />
4040
</div>
4141

4242
- New Alert
@@ -82,8 +82,8 @@ alert.show(animated: true, vibrate: true) {
8282
}
8383
```
8484
<div align = "center">
85-
<img src="Assets/gifs/actionSheet-simple-image.gif" width="350" />
86-
<img src="Assets/gifs/alert-simple-image.gif" width="350" />
85+
<img src="Source/Assets/gifs/actionSheet-simple-image.gif" width="350" />
86+
<img src="Source/Assets/gifs/alert-simple-image.gif" width="350" />
8787
</div>
8888

8989

@@ -116,8 +116,8 @@ In native UIAlertController you can only add `UITextField` to `.alert` style wit
116116
You can use both styles `.alert` and `.actionSheet` of `UIAlertController`.
117117

118118
<div align = "center">
119-
<img src="Assets/gifs/actionSheet-textField-1.gif" width="350" />
120-
<img src="Assets/gifs/alert-textField-1.gif" width="350" />
119+
<img src="Source/Assets/gifs/actionSheet-textField-1.gif" width="350" />
120+
<img src="Source/Assets/gifs/alert-textField-1.gif" width="350" />
121121
</div>
122122

123123
```swift
@@ -150,8 +150,8 @@ alert.show()
150150
You can use both styles `.alert` and `.actionSheet` of `UIAlertController`.
151151

152152
<div align = "center">
153-
<img src="Assets/gifs/actionSheet-textField-2.gif" width="350" />
154-
<img src="Assets/gifs/alert-textField-2.gif" width="350" />
153+
<img src="Source/Assets/gifs/actionSheet-textField-2.gif" width="350" />
154+
<img src="Source/Assets/gifs/alert-textField-2.gif" width="350" />
155155
</div>
156156

157157
```swift
@@ -203,8 +203,8 @@ alert.show()
203203
`UIDatePicker` does not look very much in `.alert` style.
204204

205205
<div align = "center">
206-
<img src="Assets/gifs/actionSheet-datePicker.gif" width="350" />
207-
<img src="Assets/gifs/alert-datePicker.gif" width="350" />
206+
<img src="Source/Assets/gifs/actionSheet-datePicker.gif" width="350" />
207+
<img src="Source/Assets/gifs/alert-datePicker.gif" width="350" />
208208
</div>
209209

210210
```swift
@@ -221,8 +221,8 @@ alert.show()
221221
Example how to use `UIPickerView` as `contentViewController` and change height of the `UIAlertController`.
222222

223223
<div align = "center">
224-
<img src="Assets/gifs/actionSheet-pickerView.gif" width="350" />
225-
<img src="Assets/gifs/alert-pickerView.gif" width="350" />
224+
<img src="Source/Assets/gifs/actionSheet-pickerView.gif" width="350" />
225+
<img src="Source/Assets/gifs/alert-pickerView.gif" width="350" />
226226
</div>
227227

228228
```swift
@@ -248,8 +248,8 @@ alert.show()
248248
* #### Country Picker
249249

250250
<div align = "center">
251-
<img src="Assets/gifs/actionSheet-countryPicker.gif" width="350" />
252-
<img src="Assets/gifs/alert-countryPicker.gif" width="350" />
251+
<img src="Source/Assets/gifs/actionSheet-countryPicker.gif" width="350" />
252+
<img src="Source/Assets/gifs/alert-countryPicker.gif" width="350" />
253253
</div>
254254

255255
```swift
@@ -264,8 +264,8 @@ alert.show()
264264
* #### Phone Code Picker
265265

266266
<div align = "center">
267-
<img src="Assets/gifs/actionSheet-phoneCodePicker.gif" width="350" />
268-
<img src="Assets/gifs/alert-phoneCodePicker.gif" width="350" />
267+
<img src="Source/Assets/gifs/actionSheet-phoneCodePicker.gif" width="350" />
268+
<img src="Source/Assets/gifs/alert-phoneCodePicker.gif" width="350" />
269269
</div>
270270

271271
```swift
@@ -280,8 +280,8 @@ alert.show()
280280
* #### Currency Picker
281281

282282
<div align = "center">
283-
<img src="Assets/gifs/actionSheet-currencyPicker.gif" width="350" />
284-
<img src="Assets/gifs/alert-currencyPicker.gif" width="350" />
283+
<img src="Source/Assets/gifs/actionSheet-currencyPicker.gif" width="350" />
284+
<img src="Source/Assets/gifs/alert-currencyPicker.gif" width="350" />
285285
</div>
286286

287287
```swift
@@ -298,8 +298,8 @@ alert.show()
298298
## Image Picker
299299

300300
<div align = "center">
301-
<img src="Assets/gifs/actionSheet-imagePicker-h.gif" width="350" />
302-
<img src="Assets/gifs/actionSheet-imagePicker-v.gif" width="350" />
301+
<img src="Source/Assets/gifs/actionSheet-imagePicker-h.gif" width="350" />
302+
<img src="Source/Assets/gifs/actionSheet-imagePicker-v.gif" width="350" />
303303
</div>
304304

305305
* Horizontal Image Picker with paging and single selection:
@@ -338,7 +338,7 @@ alert.show()
338338
## PhotoLibrary Picker
339339

340340
<div align = "center">
341-
<img src="Assets/gifs/actionSheet-photoLibraryPicker.gif" width="350" />
341+
<img src="Source/Assets/gifs/actionSheet-photoLibraryPicker.gif" width="350" />
342342
</div>
343343

344344
```swift
@@ -358,8 +358,8 @@ alert.show()
358358
Example how to use UIViewController instantiated from Storyboard with Autolayout as `contentViewController` in the `UIAlertController`.
359359

360360
<div align = "center">
361-
<img src="Assets/gifs/actionSheet-colorPicker.gif" width="350" />
362-
<img src="Assets/gifs/alert-colorPicker.gif" width="350" />
361+
<img src="Source/Assets/gifs/actionSheet-colorPicker.gif" width="350" />
362+
<img src="Source/Assets/gifs/alert-colorPicker.gif" width="350" />
363363
</div>
364364

365365
```swift
@@ -374,8 +374,8 @@ alert.show()
374374
## Contacts Picker
375375

376376
<div align = "center">
377-
<img src="Assets/gifs/actionSheet-contactsPicker.gif" width="350" />
378-
<img src="Assets/gifs/alert-contactsPicker.gif" width="350" />
377+
<img src="Source/Assets/gifs/actionSheet-contactsPicker.gif" width="350" />
378+
<img src="Source/Assets/gifs/alert-contactsPicker.gif" width="350" />
379379
</div>
380380

381381
```swift
@@ -390,7 +390,7 @@ alert.show()
390390
## Location Picker
391391

392392
<div align = "center">
393-
<img src="Assets/gifs/actionSheet-locationPicker.gif" width="350" />
393+
<img src="Source/Assets/gifs/actionSheet-locationPicker.gif" width="350" />
394394
</div>
395395

396396
```swift
@@ -405,7 +405,7 @@ alert.show()
405405
## Telegram Picker
406406

407407
<div align = "center">
408-
<img src="Assets/gifs/actionSheet-telegramPicker.gif" width="350" />
408+
<img src="Source/Assets/gifs/actionSheet-telegramPicker.gif" width="350" />
409409
</div>
410410

411411
```swift
@@ -427,8 +427,8 @@ alert.show()
427427
## TextViewer
428428

429429
<div align = "center">
430-
<img src="Assets/gifs/actionSheet-textViewer.gif" width="350" />
431-
<img src="Assets/gifs/alert-textViewer.gif" width="350" />
430+
<img src="Source/Assets/gifs/actionSheet-textViewer.gif" width="350" />
431+
<img src="Source/Assets/gifs/alert-textViewer.gif" width="350" />
432432
</div>
433433

434434
```swift

Source/Info.plist

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
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>CFBundleDevelopmentRegion</key>
6+
<string>$(DEVELOPMENT_LANGUAGE)</string>
7+
<key>CFBundleExecutable</key>
8+
<string>$(EXECUTABLE_NAME)</string>
9+
<key>CFBundleIdentifier</key>
10+
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
11+
<key>CFBundleInfoDictionaryVersion</key>
12+
<string>6.0</string>
13+
<key>CFBundleName</key>
14+
<string>$(PRODUCT_NAME)</string>
15+
<key>CFBundlePackageType</key>
16+
<string>FMWK</string>
17+
<key>CFBundleShortVersionString</key>
18+
<string>1.0</string>
19+
<key>CFBundleVersion</key>
20+
<string>$(CURRENT_PROJECT_VERSION)</string>
21+
</dict>
22+
</plist>

Source/Viewers/TextViewController.swift

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import UIKit
22

3-
extension UIAlertController {
3+
public extension UIAlertController {
44

55
/// Add a Text Viewer
66
///
@@ -13,9 +13,9 @@ extension UIAlertController {
1313
}
1414
}
1515

16-
final class TextViewerViewController: UIViewController {
16+
public final class TextViewerViewController: UIViewController {
1717

18-
enum Kind {
18+
public enum Kind {
1919

2020
case text(String?)
2121
case attributedText([AttributedTextBlock])
@@ -58,24 +58,24 @@ final class TextViewerViewController: UIViewController {
5858
Log("has deinitialized")
5959
}
6060

61-
override func loadView() {
61+
override public func loadView() {
6262
view = textView
6363
}
6464

65-
override func viewDidLoad() {
65+
override public func viewDidLoad() {
6666
super.viewDidLoad()
6767

6868
if UIDevice.current.userInterfaceIdiom == .pad {
6969
preferredContentSize.width = UIScreen.main.bounds.width * 0.618
7070
}
7171
}
7272

73-
override func viewDidAppear(_ animated: Bool) {
73+
override public func viewDidAppear(_ animated: Bool) {
7474
super.viewDidAppear(animated)
7575
textView.scrollToTop()
7676
}
7777

78-
override func viewDidLayoutSubviews() {
78+
override public func viewDidLayoutSubviews() {
7979
super.viewDidLayoutSubviews()
8080
preferredContentSize.height = textView.contentSize.height
8181

0 commit comments

Comments
 (0)