Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?xml version="1.0" encoding="UTF-8"?>
<Bucket
type = "1"
version = "2.0">
<Breakpoints>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "AutoAdLabelScroll/HRAdView.h"
timestampString = "516247941.004553"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "4"
endingLineNumber = "4">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "AutoAdLabelScroll/ViewController.m"
timestampString = "516253345.054413"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "36"
endingLineNumber = "36"
landmarkName = "-viewDidLoad"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
</Breakpoints>
</Bucket>
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0830"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "86C739C31CB4A0FF00E27C05"
BuildableName = "AutoAdLabelScroll.app"
BlueprintName = "AutoAdLabelScroll"
ReferencedContainer = "container:AutoAdLabelScroll.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "86C739DC1CB4A0FF00E27C05"
BuildableName = "AutoAdLabelScrollTests.xctest"
BlueprintName = "AutoAdLabelScrollTests"
ReferencedContainer = "container:AutoAdLabelScroll.xcodeproj">
</BuildableReference>
</TestableReference>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "86C739E71CB4A0FF00E27C05"
BuildableName = "AutoAdLabelScrollUITests.xctest"
BlueprintName = "AutoAdLabelScrollUITests"
ReferencedContainer = "container:AutoAdLabelScroll.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "86C739C31CB4A0FF00E27C05"
BuildableName = "AutoAdLabelScroll.app"
BlueprintName = "AutoAdLabelScroll"
ReferencedContainer = "container:AutoAdLabelScroll.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "86C739C31CB4A0FF00E27C05"
BuildableName = "AutoAdLabelScroll.app"
BlueprintName = "AutoAdLabelScroll"
ReferencedContainer = "container:AutoAdLabelScroll.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "86C739C31CB4A0FF00E27C05"
BuildableName = "AutoAdLabelScroll.app"
BlueprintName = "AutoAdLabelScroll"
ReferencedContainer = "container:AutoAdLabelScroll.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>SchemeUserState</key>
<dict>
<key>AutoAdLabelScroll.xcscheme</key>
<dict>
<key>orderHint</key>
<integer>0</integer>
</dict>
</dict>
<key>SuppressBuildableAutocreation</key>
<dict>
<key>86C739C31CB4A0FF00E27C05</key>
<dict>
<key>primary</key>
<true/>
</dict>
<key>86C739DC1CB4A0FF00E27C05</key>
<dict>
<key>primary</key>
<true/>
</dict>
<key>86C739E71CB4A0FF00E27C05</key>
<dict>
<key>primary</key>
<true/>
</dict>
</dict>
</dict>
</plist>
63 changes: 32 additions & 31 deletions AutoAdLabelScroll/HRAdView.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,72 +11,73 @@
@interface HRAdView : UIView

/**
* 广告内容数组
当前索引,无内容时为NSNotFound
*/
@property (nonatomic, copy) NSArray *adTitles;
@property (nonatomic, assign, readonly) NSUInteger currentIndex;

@property (nonatomic, strong, readonly) UIImageView *iconView;
/**
* 头部图片 默认为nil
*/
@property (nonatomic, strong) UIImage *headImg;

@property (nonatomic, strong) UIImage *icon;
/**
* 图片位置
*/
@property (nonatomic, assign) UIEdgeInsets edgeInsets;

@property (nonatomic, assign) UIEdgeInsets iconInsets;
/**
* 广告字体 默认为16号系统字体
* 广告内容数组
*/
@property (nonatomic, strong) UIFont *labelFont;

@property (nonatomic, strong) NSArray<NSString *> *texts;
/**
* 广告字体颜色 默认为黑色
*/
@property (nonatomic, strong) UIColor *color;

@property (nonatomic, strong) UIColor *textColor;
/**
* 轮播时间间隔 默认2s
*/
@property (nonatomic, assign) NSTimeInterval time;

/**
* 是否开启点击事件 默认为NO
* 广告字体 默认为16号系统字体
*/
@property (nonatomic, assign) BOOL isHaveTouchEvent;

@property (nonatomic, strong) UIFont *font;
/**
* 点击事件响应
文字行数
*/
@property (nonatomic, copy) void (^clickAdBlock)(NSUInteger index);

@property (nonatomic, assign) NSInteger numberOfTextLines;
/**
* 文本对齐方式
*/
@property (nonatomic, assign) NSTextAlignment textAlignment;

/**
文字左边默认间距
文字边距
*/
@property (nonatomic, assign) CGFloat defaultMargin;

@property (nonatomic, assign) UIEdgeInsets textInsets;
/**
文字行数
* 轮播时间间隔 默认2s
*/
@property (nonatomic, assign) NSInteger numberOfTextLines;
@property (nonatomic, assign) NSTimeInterval duration;
/**
滚动动画时长 默认1s
*/
@property (nonatomic, assign) NSTimeInterval animateDuration;

/**
* 是否开启点击事件 默认为NO
*/
@property (nonatomic, assign) BOOL touchEnabled;
/**
* 点击事件响应
*/
@property (nonatomic, copy) void (^clickAdBlock)(NSUInteger index);
/**
* 开始轮播
*/
- (void)beginScroll;
- (void)startScroll;

/**
* 关闭轮播
*/
- (void)closeScroll;
- (void)stopScroll;

/**
* 实例化方法
*/
- (instancetype)initWithTitles:(NSArray *)titles;
- (instancetype)initWithTexts:(NSArray<NSString *> *)titles;

@end
Loading