Skip to content

Commit cd8c3d0

Browse files
committed
Added Swift naming conventions
1 parent 88e0104 commit cd8c3d0

1 file changed

Lines changed: 17 additions & 17 deletions

File tree

TOSegmentedControl/TOSegmentedControl.h

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,6 @@
2323
#import <Foundation/Foundation.h>
2424
#import <UIKit/UIKit.h>
2525

26-
FOUNDATION_EXPORT double TOSegmentedControlFrameworkVersionNumber;
27-
FOUNDATION_EXPORT const unsigned char TOSegmentedControlFrameworkVersionString[];
28-
2926
NS_ASSUME_NONNULL_BEGIN
3027

3128
/**
@@ -98,102 +95,105 @@ IB_DESIGNABLE @interface TOSegmentedControl : UIControl
9895
9996
@param items An array of either images, or strings to display
10097
*/
101-
- (instancetype)initWithItems:(nullable NSArray *)items;
98+
- (instancetype)initWithItems:(nullable NSArray *)items NS_SWIFT_NAME(init(items:));
10299

103100
/**
104101
Replaces the content of an existing segment with a new image.
105102
106103
@param image The image to set.
107104
@param index The index of the segment to set.
108105
*/
109-
- (void)setImage:(UIImage *)image forItemAtIndex:(NSInteger)index;
106+
- (void)setImage:(UIImage *)image forItemAtIndex:(NSInteger)index NS_SWIFT_NAME(set(_:for:));
110107

111108
/**
112109
Returns the image that was assigned to a specific segment.
113110
Will return nil if the content at that segment is not an image.
114111
115112
@param index The index at which the image is located.
116113
*/
117-
- (nullable UIImage *)imageForItemAtIndex:(NSInteger)index;
114+
- (nullable UIImage *)imageForItemAtIndex:(NSInteger)index NS_SWIFT_NAME(image(for:));
118115

119116
/**
120117
Sets the content of a given segment to a text label.
121118
122119
@param title The text to display at the segment
123120
@param index The index of the segment to set.
124121
*/
125-
- (void)setTitle:(NSString *)title forItemAtIndex:(NSInteger)index;
122+
- (void)setTitle:(NSString *)title forItemAtIndex:(NSInteger)index NS_SWIFT_NAME(set(_:for:));
126123

127124
/**
128125
Returns the string of the title that was assigned to a specific segment.
129126
Will return nil if the content at that segment is not a string.
130127
131128
@param index The index at which the image is located.
132129
*/
133-
- (nullable NSString *)titleForItemAtIndex:(NSInteger)index;
130+
- (nullable NSString *)titleForItemAtIndex:(NSInteger)index NS_SWIFT_NAME(title(for:));
134131

135132
/**
136133
Adds a new text item to the end of the list.
137134
138135
@param title The title of the new item.
139136
*/
140-
- (void)addNewItemWithTitle:(NSString *)title;
137+
- (void)addNewItemWithTitle:(NSString *)title NS_SWIFT_NAME(addItem(with:));
141138

142139
/**
143140
Adds a new image item to the end of the list.
144141
145142
@param image The image of the new item.
146143
*/
147-
- (void)addNewItemWithImage:(UIImage *)image;
144+
- (void)addNewItemWithImage:(UIImage *)image NS_SWIFT_NAME(addItem(with:));
148145

149146
/**
150147
Inserts a new image item at the specified segment index.
151148
152149
@param image The image to set.
153150
@param index The index of the segment to which the image will be set.
154151
*/
155-
- (void)insertItemWithImage:(UIImage *)image atIndex:(NSInteger)index;
152+
- (void)insertItemWithImage:(UIImage *)image atIndex:(NSInteger)index NS_SWIFT_NAME(insertItem(_:at:));
156153

157154
/**
158155
Inserts a new image title at the specified segment index.
159156
160157
@param title The title to set.
161158
@param index The index of the segment to which the image will be set.
162159
*/
163-
- (void)insertItemWithTitle:(NSString *)title atIndex:(NSInteger)index;
160+
- (void)insertItemWithTitle:(NSString *)title atIndex:(NSInteger)index NS_SWIFT_NAME(insertItem(_:at:));
164161

165162
/**
166163
Remove the last item in the list
167164
*/
168-
- (void)removeLastItem;
165+
- (void)removeLastItem NS_SWIFT_NAME(removeLastItem());
169166

170167
/**
171168
Removes the item at the specified index.
172169
173170
@param index The index of the segment to remove.
174171
*/
175-
- (void)removeItemAtIndex:(NSInteger)index;
172+
- (void)removeItemAtIndex:(NSInteger)index NS_SWIFT_NAME(removeItem(at:));
176173

177174
/**
178175
Removes all of the items from this control.
179176
*/
180-
- (void)removeAllItems;
177+
- (void)removeAllItems NS_SWIFT_NAME(removeAllItems());
181178

182179
/**
183180
Enables or disables the item at the specified index.
184181
185182
@param enabled Whether the item is enabled or not.
186183
@param index The specific index to enable/disable.
187184
*/
188-
- (void)setEnabled:(BOOL)enabled forSegmentAtIndex:(NSInteger)index;
185+
- (void)setEnabled:(BOOL)enabled forSegmentAtIndex:(NSInteger)index NS_SWIFT_NAME(setEnabled(_:at:));
189186

190187
/**
191188
Returns whether the item at the specified index is currently enabled or not.
192189
193190
@param index The index to check.
194191
*/
195-
- (BOOL)isEnabledForSegmentAtIndex:(NSInteger)index;
192+
- (BOOL)isEnabledForSegmentAtIndex:(NSInteger)index NS_SWIFT_NAME(isEnabled(at:));
196193

197194
@end
198195

199196
NS_ASSUME_NONNULL_END
197+
198+
FOUNDATION_EXPORT double TOSegmentedControlFrameworkVersionNumber;
199+
FOUNDATION_EXPORT const unsigned char TOSegmentedControlFrameworkVersionString[];

0 commit comments

Comments
 (0)