Skip to content

Commit 5225921

Browse files
author
Andreas Wulf
committed
Improve documentation
1 parent dad4a69 commit 5225921

4 files changed

Lines changed: 34 additions & 19 deletions

File tree

Example/iStatusView.xcodeproj/project.pbxproj

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@
207207
isa = PBXProject;
208208
attributes = {
209209
LastSwiftUpdateCheck = 0830;
210-
LastUpgradeCheck = 0830;
210+
LastUpgradeCheck = 0930;
211211
ORGANIZATIONNAME = CocoaPods;
212212
TargetAttributes = {
213213
607FACCF1AFB9204008FA782 = {
@@ -426,12 +426,14 @@
426426
CLANG_WARN_BOOL_CONVERSION = YES;
427427
CLANG_WARN_COMMA = YES;
428428
CLANG_WARN_CONSTANT_CONVERSION = YES;
429+
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
429430
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
430431
CLANG_WARN_EMPTY_BODY = YES;
431432
CLANG_WARN_ENUM_CONVERSION = YES;
432433
CLANG_WARN_INFINITE_RECURSION = YES;
433434
CLANG_WARN_INT_CONVERSION = YES;
434435
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
436+
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
435437
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
436438
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
437439
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
@@ -479,12 +481,14 @@
479481
CLANG_WARN_BOOL_CONVERSION = YES;
480482
CLANG_WARN_COMMA = YES;
481483
CLANG_WARN_CONSTANT_CONVERSION = YES;
484+
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
482485
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
483486
CLANG_WARN_EMPTY_BODY = YES;
484487
CLANG_WARN_ENUM_CONVERSION = YES;
485488
CLANG_WARN_INFINITE_RECURSION = YES;
486489
CLANG_WARN_INT_CONVERSION = YES;
487490
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
491+
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
488492
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
489493
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
490494
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
@@ -518,6 +522,7 @@
518522
baseConfigurationReference = BF337CC062C599F5B25A0691 /* Pods-iStatusView_Example.debug.xcconfig */;
519523
buildSettings = {
520524
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
525+
DEVELOPMENT_TEAM = "";
521526
INFOPLIST_FILE = iStatusView/Info.plist;
522527
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
523528
MODULE_NAME = ExampleApp;
@@ -533,6 +538,7 @@
533538
baseConfigurationReference = 919E3D161DD5FE59F1BCDCE4 /* Pods-iStatusView_Example.release.xcconfig */;
534539
buildSettings = {
535540
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
541+
DEVELOPMENT_TEAM = "";
536542
INFOPLIST_FILE = iStatusView/Info.plist;
537543
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
538544
MODULE_NAME = ExampleApp;
@@ -547,6 +553,7 @@
547553
isa = XCBuildConfiguration;
548554
baseConfigurationReference = F992F78BE274EF618344C6C7 /* Pods-iStatusView_Tests.debug.xcconfig */;
549555
buildSettings = {
556+
DEVELOPMENT_TEAM = "";
550557
FRAMEWORK_SEARCH_PATHS = (
551558
"$(SDKROOT)/Developer/Library/Frameworks",
552559
"$(inherited)",
@@ -568,6 +575,7 @@
568575
isa = XCBuildConfiguration;
569576
baseConfigurationReference = 371EBB200BE973277099943E /* Pods-iStatusView_Tests.release.xcconfig */;
570577
buildSettings = {
578+
DEVELOPMENT_TEAM = "";
571579
FRAMEWORK_SEARCH_PATHS = (
572580
"$(SDKROOT)/Developer/Library/Frameworks",
573581
"$(inherited)",

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

Lines changed: 1 addition & 3 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 = "0930"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"
@@ -40,7 +40,6 @@
4040
buildConfiguration = "Debug"
4141
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
4242
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
43-
language = ""
4443
shouldUseLaunchSchemeArgsEnv = "YES">
4544
<Testables>
4645
<TestableReference
@@ -70,7 +69,6 @@
7069
buildConfiguration = "Debug"
7170
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
7271
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
73-
language = ""
7472
launchStyle = "0"
7573
useCustomWorkingDirectory = "NO"
7674
ignoresPersistentStateOnLaunch = "NO"

iStatusView.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ When an error has occured, the message can be displayed, and a rety button can b
3030
s.source = { :git => 'https://github.com/NextFaze/iStatusView.git', :tag => s.version.to_s }
3131
# s.social_media_url = 'https://twitter.com/<TWITTER_USERNAME>'
3232

33-
s.ios.deployment_target = '8.0'
33+
s.ios.deployment_target = '9.3'
3434

3535
s.source_files = 'iStatusView/Classes/**/*'
3636

iStatusView/Classes/StatusView.swift

Lines changed: 23 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -37,29 +37,35 @@ extension StatusViewError: LocalizedError {
3737

3838
@objc public class StatusView: UIView {
3939

40+
/// Appearance proxy property for setting the title label text color
4041
@objc public dynamic var titleLabelTextColor: UIColor? {
4142
get { return self.titleLabel.textColor }
4243
set { self.titleLabel.textColor = newValue }
4344
}
4445

46+
/// Appearance proxy property for setting the title label font
4547
@objc public dynamic var titleLabelFont: UIFont? {
4648
get { return self.titleLabel.font }
4749
set { self.titleLabel.font = newValue }
4850
}
4951

52+
/// Appearance proxy property for setting the message label text color
5053
@objc public dynamic var messageLabelTextColor: UIColor? {
5154
get { return self.messageLabel.textColor }
5255
set { self.messageLabel.textColor = newValue }
5356
}
5457

58+
/// Appearance proxy property for setting the message label font
5559
@objc public dynamic var messageLabelFont: UIFont? {
5660
get { return self.messageLabel.font }
5761
set { self.messageLabel.font = newValue }
5862
}
5963

6064

61-
private(set) var state = StatusViewState.hidden
65+
/// State of the StatusView
66+
public private(set) var state = StatusViewState.hidden
6267

68+
/// The loading view, which is shown when state is `.loading`
6369
public var loadingView: UIView? {
6470
didSet {
6571
guard let loadingView = self.loadingView else{
@@ -80,12 +86,20 @@ extension StatusViewError: LocalizedError {
8086
}
8187
}
8288

83-
public var button = UIButton()
84-
public var titleLabel = UILabel()
85-
public var messageLabel = UILabel()
86-
public var statusImageView = UIImageView()
89+
public let button = UIButton()
90+
public let titleLabel = UILabel()
91+
public let messageLabel = UILabel()
92+
public let statusImageView = UIImageView()
93+
8794
private var initial = true
8895

96+
/// Create
97+
/// Use this to setup the StatusView
98+
///
99+
/// - Parameters:
100+
/// - loadingView: pass the loading view to be shown during loading state
101+
/// - view: parent view to be added to
102+
/// - Returns: a configured StatusView
89103
public static func create(with loadingView: UIView? = nil, addTo view: UIView) -> StatusView {
90104
let statusView = StatusView()
91105
view.addSubview(statusView)
@@ -231,22 +245,17 @@ extension StatusViewError: LocalizedError {
231245

232246
var layoutConstraints = [NSLayoutConstraint]()
233247

234-
/// The current state of the status view
235-
var currentState: StatusViewState {
236-
return self.state
237-
}
238-
239248
/// Show or hide status view with the following paramaters, animates where appropriate
240249
/// If any paramater is unset, that component will not show
241250
/// Before use view will need to be added to a superview and layout constraints set
242251
///
243252
/// - Parameters:
244253
/// - state: to be set to
245-
/// - title: label text
246-
/// - message: label text
254+
/// - title: text to be set as predominant text
255+
/// - message: text to be set as the more detailed text
247256
/// - statusImage: image shown at the top of view
248-
/// - buttonImage: image shown in button
249-
/// - animate: animate the transition
257+
/// - buttonImage: image shown in button, also enabling the button
258+
/// - animate: true to animate the transition between states
250259
public func changeTo(state: StatusViewState, title: String? = nil, message: String? = nil, statusImage: UIImage? = nil, buttonImage: UIImage? = nil, animate: Bool = true ) throws {
251260

252261
guard let loadingView = self.loadingView else {

0 commit comments

Comments
 (0)