0% found this document useful (0 votes)
32 views

Inv. Frameworks

Frameworks are self-contained, reusable chunks of code and resources that can be imported into multiple apps. Frameworks have three main purposes: code encapsulation, modularity, and reuse. They allow sharing code between apps or with other developers, modularizing code, and distributing code as a third-party library. Some key advantages are that they allow sharing code, code modularity, distributing code as a library, and defining strong interfaces between modules when used with Swift access control.
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
32 views

Inv. Frameworks

Frameworks are self-contained, reusable chunks of code and resources that can be imported into multiple apps. Frameworks have three main purposes: code encapsulation, modularity, and reuse. They allow sharing code between apps or with other developers, modularizing code, and distributing code as a third-party library. Some key advantages are that they allow sharing code, code modularity, distributing code as a library, and defining strong interfaces between modules when used with Swift access control.
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Frameworks

¿What are Frameworks?


-Is a hierarchical directory
-Encapsulates shared resources in a single package, such as:
-Shared library -Nib files
-Image files -Localized strings
-Header files

-Multiple applications can use all of these resources simultaneously.


-A framework is also a bundle.
-Its contents can be accessed using Core Foundation Bundle Services or the
Cocoa NSBundle class.
-A framework bundle is a standard directory that the user can navigate. This
makes it easier for developers to browse the framework contents and view any
included documentation and header files.
Frameworks serve the same purpose as static and dynamic shared libraries,
that is, they provide a library of routines that can be called by an application to
perform a specific task. For example, the Application Kit and Foundation
frameworks provide the programmatic interfaces for the Cocoa classes and
methods. Frameworks offer the following advantages over static-linked
libraries and other types of dynamic shared libraries:
 Frameworks group related, but separate, resources together. This
grouping makes it easier to install, uninstall, and locate those resources.
 Frameworks can include a wider variety of resource types than
libraries. For example, a framework can include any relevant header
files and documentation.
 Multiple versions of a framework can be included in the same bundle.
This makes it possible to be backward compatible with older programs.
 Only one copy of a framework’s read-only resources reside physically
in-memory at any given time, regardless of how many processes are
using those resources. This sharing of resources reduces the memory
footprint of the system and helps improve performance.
The Darwin layer contains many static and dynamic libraries but otherwise,
most OS X interfaces are packaged as frameworks. Some key frameworks—
including Carbon, Cocoa, Application Services, and Core Services—provide
convenient groupings of several smaller but related frameworks. These
framework groups are called umbrella frameworks and they act as an
abstraction layer between a technology and the subframeworks that
implement that technology.
In addition to using the system frameworks, you can create your own
frameworks and use them privately for your own applications or make them
publicly available to other developers. Private frameworks are appropriate for
code modules you want to use in your own applications but do not want other
developers to use. Public frameworks are intended for use by other developers
and usually include headers and documentation defining the framework’s
public interface.

Are self-contained, reusable chunks of code and resources that you can import into
any number of apps.

Purposes:
Frameworks have three major purposes:
 Code encapsulation.
 Code modularity.
 Code reuse.

Advantages
Share a chunk of code between apps or to other developers
Modularize your code
Distribute your code as a third-party library
When combined with Swift’s access control, frameworks help define strong,
testable interfaces between code modules.

Disadvantages

Code Obfuscating for Swift:


-Swift is a compiled language
-The Clang compiler is highly optimized. In release mode it strips out symbols
and does a lot of optimization that does a great deal of obfuscation all by itself.
-Xcode also converts Swift code into a kind of intermediate representation
bytecode, called bitcode by Apple. But, IIRC, bitcode gets stripped out by Apple
before sending an app to customers, and the app's compiled code is also
encrypted by Apple. The optimizations performed by the Swift compiler on a
Release Build (including code re-ordering, etc.) performs some amount of
obfuscation

Bitcode by Apple:
Es un engranaje que Apple ha colocado entre el código de la aplicación y la
aplicación compilada y ejecutable. Es un paso intermedio dentro de LLVM (que
es el compilador que utiliza Apple y otras muchas plataformas) y la aplicación
final. con Bitcode Apple se asegura que:

 Las aplicaciones funcionarán lo mejor posible independientemente del


procesador en el que se ejecuten.
 Las aplicaciones podrán seguir funcionando en nuevos procesadores, y aquí
viene lo importante, incluso en aquellos que estén en la mesa de diseño
y todavía no existen.
 Apple no dependerá de los procesadores ARM, porque Bitcode se adaptará
a los cambios que la compañía de Cupertino haga en cualquiera de los
extremos de este flujo de trabajo. ¿Que decide no utilizar la arquitectura
ARM nunca más? No hay problema, Bitcode se encargará de adaptar el
código a la nueva arquitectura del procesador. Y problema solucionado.

Sources:
https://www.raywenderlich.com/5109-creating-a-framework-for-ios

You might also like