You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
let view: MyCustomView =try! SwiftMessages.viewFromNib()
263
263
````
264
264
265
-
#### MessageView
265
+
#### MessageView Class
266
266
267
267
268
268
[`MessageView`](./SwiftMessages/MessageView.swift) is a light-weight view that all of the bundled designs use. It primarily consists of the following optional `@IBOutlet` properties:
@@ -319,15 +319,15 @@ The suggested method for starting with `MessageView` as a base and __adding new
319
319
1. (recommended) override the implementation of `AccessibleMessage` as needed to incorporate new elements into Voice Over.
320
320
1. Use one of the nib-loading methods above to load the view.
321
321
322
-
#### BaseView
322
+
#### BaseView Class
323
323
324
324
[`BaseView`](./SwiftMessages/BaseView.swift) is the superclass of `MessageView` and provides numerous options that aren't specific to the "title + body + icon + button" design of `MessageView`. Custom views that are significantly different from `MessageView`, such as a progress indicator, should subclass `BaseView`.
325
325
326
-
#### CornerRoundingView
326
+
#### CornerRoundingView Class
327
327
328
328
[`CornerRoundingView`](./SwiftMessages/CornerRoundingView.swift) is a custom view that messages can use for rounding all or a subset of corners with squircles (the smoother method of rounding corners that you see on app icons). The nib files that feature rounded corners have `backgroundView` assigned to a `CornerRoundingView`. It provides a `roundsLeadingCorners` option to dynamically round only the leading corners of the view when presented from top or bottom (a feature used for the tab-style layouts).
329
329
330
-
#### Animator
330
+
#### Animator Protocol
331
331
332
332
[`Animator`](./SwiftMessages/Animator.swift) is the protocol that SwiftMessages uses for presentation and dismissal animations. Custom animations can be done through the `SwiftMessages.PresentationStyle.custom(animator:)`. Some related components:
333
333
*[`TopBottomAnimation`](./SwiftMessages/TopBottomAnimation.swift) is a sliding implementation of `Animator` used internally by `.top` and `.bottom` presentation styles. It provides some customization options.
@@ -336,23 +336,23 @@ The suggested method for starting with `MessageView` as a base and __adding new
336
336
337
337
High-quality PRs for cool `Animator` implementations are welcome!
338
338
339
-
#### MarginAdjustable
339
+
#### MarginAdjustable Protocol
340
340
341
341
[`MarginAdjustable`](./SwiftMessages/MarginAdjustable.swift) is a protocol adopted by `BaseView`. If the view being presented adopts `MarginAdjustable`, SwiftMessages takes ownership of the view's layout margins to ensure ideal spacing across the full range of presentation contexts.
342
342
343
-
#### BackgroundViewable
343
+
#### BackgroundViewable Protocol
344
344
345
345
[`BackgroundViewable`](./SwiftMessages/BackgroundViewable.swift) is a protocol adopted by `BaseView` and requires that a view provide a single `backgroundView` property. `BaseView` initializes `backgroundView = self`, which you can freely re-assign to any subview.
346
346
347
347
If the view being presented adopts `BackgroundViewable`, SwiftMessages will ignore touches outside of `backgroundView`. This is important because message views always span the full width of the device. Card and tab-style layouts appear inset from the edges of the device because the message view's background is transparent and `backgroundView` is assigned to a subview constrained to the layout margins. In these layouts, touches in the transparent margins should be ignored.
348
348
349
-
#### Identifiable
349
+
#### Identifiable Protocol
350
350
351
351
[`Identifiable`](./SwiftMessages/Identifiable.swift) is a protocol adopted by `MessageView` and requires that a view provide a single `id` property, which SwiftMessages uses for message deduplication.
352
352
353
353
`MessageView` computes the `id` based on the message content, but `id` can also be set explicitly as needed.
354
354
355
-
#### AccessibleMessage
355
+
#### AccessibleMessage Protocol
356
356
357
357
[`AccessibleMessage`](./SwiftMessages/AccessibleMessage.swift) is a protocol adopted by `MessageView`. If the view being presented adopts `AccessibleMessage`, SwiftMessages provides improved Voice Over.
0 commit comments